<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Debian Tutorials &#187; mailscanner</title>
	<atom:link href="http://www.debiantutorials.com/tag/mailscanner/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.debiantutorials.com</link>
	<description>Copy/Paste tutorials for Debian Linux</description>
	<lastBuildDate>Wed, 18 Aug 2010 00:35:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Install and configure MailWatch monitoring tool for MailScanner</title>
		<link>http://www.debiantutorials.com/install-and-configure-mailwatch-monitoring-tool-for-mailscanner/</link>
		<comments>http://www.debiantutorials.com/install-and-configure-mailwatch-monitoring-tool-for-mailscanner/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 00:35:59 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mailscanner]]></category>
		<category><![CDATA[mailwatch]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.com/?p=349</guid>
		<description><![CDATA[MailWatch for MailScanner is a web-based front-end to MailScanner written in PHP, MySQL and JpGraph. It comes with a CustomConfig module for MailScanner which causes MailScanner to log all message data (excluding body text) to a MySQL database which is then queried by MailWatch for reporting and statistics. 
1. Install Apache2, MySql server and PHP5 [...]]]></description>
			<content:encoded><![CDATA[<p>MailWatch for MailScanner is a web-based front-end to MailScanner written in PHP, MySQL and JpGraph. It comes with a CustomConfig module for MailScanner which causes MailScanner to log all message data (excluding body text) to a MySQL database which is then queried by MailWatch for reporting and statistics. </p>
<p>1. Install Apache2, MySql server and PHP5 with required modules. You may already have some or all of these packages installed.</p>
<p><code>apt-get install apache2 php5-cli php5 mysql-server libdbd-mysql-perl php5-gd php5-mysql libapache2-mod-php5<br />
</code><span id="more-349"></span></p>
<p>2. Download the latest version of MailWatch</p>
<p><code>wget http://downloads.sourceforge.net/project/mailwatch/mailwatch/1.0.5/mailwatch-1.0.5.tar.gz<br />
</code></p>
<p><em>At the time this tutorial was written, version 1.0.5 was the latest version. Check this location for latest version: http://sourceforge.net/projects/mailwatch/files/</em></p>
<p>3. Extract and enter the mailwatch directory</p>
<p><code>tar zxvf mailwatch-1.0.5.tar.gz<br />
cd mailwatch-1.0.5<br />
</code></p>
<p>4. Create the database and tables</p>
<p><code>mysql -p < create.sql<br />
</code></p>
<p>5. Create a MySql user used for MailScanner logging (mysql -u root -p)</p>
<p><code>GRANT ALL ON mailscanner.* TO '{username}'@'localhost' IDENTIFIED BY '{password}';<br />
FLUSH PRIVILEGES;<br />
</code></p>
<p><em>Replace {username} and {password} with a username and password of choice.</em></p>
<p>6. Configure the MailScanner logger (pico MailWatch.pm)</p>
<p><code>my($db_user) = '{username}';<br />
my($db_pass) = '{password}';<br />
</code></p>
<p><em>On line 43 and 44, input your MySql user created in step 5</em></p>
<p>7. Move the MailScanner logger to correct directory</p>
<p><code>mv MailWatch.pm /usr/share/MailScanner/MailScanner/CustomFunctions/<br />
</code></p>
<p>8. Edit Mail Scanner config to enable MailWatch logger (pico /etc/MailScanner/MailScanner.conf)</p>
<p><code>Always Looked Up Last = &#038;MailWatchLogging<br />
</code></p>
<p>9. Create a MailWatch web admin user (mysql -u root -p)</p>
<p><code>USE mailscanner;<br />
INSERT INTO users VALUES ('{username}',md5('{password}'),'Administrator name','A','0','0','0','0','0');<br />
</code></p>
<p><em>Replace {username} and {password} with a username and password used to enter the web interface.</em></p>
<p>10. Move the web interface to the web server's root</p>
<p><code>mv mailscanner /var/www/mailwatch<br />
</code></p>
<p>11. Make the temp and cache directories writeable</p>
<p><code>chmod 777 /var/www/mailwatch/temp<br />
chmod 777 /var/www/mailwatch/images/cache<br />
</code></p>
<p>12. Copy the example config file</p>
<p><code>mv /var/www/mailwatch/conf.php.example /var/www/mailwatch/conf.php<br />
</code></p>
<p>13. Configure the web interface (pico /var/www/mailwatch/conf.php)</p>
<p><code>define('DB_USER', '{username}');<br />
define('DB_PASS', '{password}');<br />
define('MAILWATCH_HOME', '/var/www/mailscanner');<br />
</code></p>
<p><em>Type the MySql username and password created in step 5</em></p>
<p>14. Install PEAR PHP framework</p>
<p><code>apt-get install php-pear<br />
</code></p>
<p>15. Install required PEAR packages</p>
<p><code>pear install DB<br />
pear install DB_Pager<br />
pear install Mail_mimeDecode-1.5.1<br />
</code></p>
<p>16. On line 37, add /usr/share/php to the mailwatch include path (pico /var/www/mailwatch/functions.php)</p>
<p><code>ini_set('include_path','.:'.MAILWATCH_HOME.'/pear:'.MAILWATCH_HOME.'/fpdf:'.MAILWATCH_HOME.'/xmlrpc:/usr/share/php');<br />
</code></p>
<p>17. Restart Apache and MailScanner</p>
<p><code>/etc/init.d/apache2 restart<br />
/etc/init.d/mailscanner restart<br />
</code></p>
<p>18. You're all set. Enter the web interface at this location http://yourserver/mailwatch</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/install-and-configure-mailwatch-monitoring-tool-for-mailscanner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing SPF checks in Postfix</title>
		<link>http://www.debiantutorials.com/implementing-spf-checks-in-postfix/</link>
		<comments>http://www.debiantutorials.com/implementing-spf-checks-in-postfix/#comments</comments>
		<pubDate>Sat, 15 May 2010 18:56:02 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[mailscanner]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spf]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=299</guid>
		<description><![CDATA[Sender Policy Framework (SPF), as defined in RFC 4408, is an e-mail validation system designed to prevent e-mail spam by addressing a common vulnerability, source address spoofing. SPF allows administrators to specify which hosts are allowed to send e-mail from a given domain by creating a specific DNS SPF record in the public DNS. Mail [...]]]></description>
			<content:encoded><![CDATA[<p>Sender Policy Framework (SPF), as defined in RFC 4408, is an e-mail validation system designed to prevent e-mail spam by addressing a common vulnerability, source address spoofing. SPF allows administrators to specify which hosts are allowed to send e-mail from a given domain by creating a specific DNS SPF record in the public DNS. Mail exchangers then use the DNS to check that mail from a given domain is being sent by a host sanctioned by that domain's administrators.<span id="more-299"></span></p>
<p>It's assumed that you have already installed Postfix and MailScanner. If not, check these tutorials:</p>
<p><a href="http://www.debiantutorials.net/installing-postfix-with-mysql-backend-and-sasl-for-smtp-authentication/">Installing Postfix with MySql backend and SASL for SMTP authentication</a><br />
<a href="http://www.debiantutorials.net/installing-and-configuring-mailscanner-for-virus-and-spam-filtering-postfix-clamav-spamassassin-razor/">Installing and configuring MailScanner for virus and spam filtering (Postfix, ClamAV, SpamAssassin, Razor)</a></p>
<p>1. Install the Postfix policy engine</p>
<p><code>apt-get install postfix-policyd-spf-perl<br />
</code></p>
<p>2. Add the policy check to smtpd_recipient_restrictions (pico /etc/postfix/main.cf)</p>
<p><code>smtpd_recipient_restrictions = [...], check_policy_service unix:private/policy<br />
</code></p>
<p><em>Make sure you don't remove other restrictions, just add it to the end of the line.</em></p>
<p>3. Add the policy engine to the Postfix master.cf (pico /etc/postfix/master.cf)</p>
<p><code>policy  unix    -       n       n       -       -       spawn<br />
user=nobody argv=/usr/bin/perl /usr/sbin/postfix-policyd-spf-perl<br />
</code></p>
<p>4. Reload Postfix configuration</p>
<p><code>postfix reload<br />
</code></p>
<p>5. Check if this is working</p>
<p><code>telnet yourserver 25<br />
HELO gmail.com<br />
MAIL FROM: <user*@gmail.com><br />
RCPT TO: <user*@domain.com><br />
DATA<br />
test<br />
.<br />
</code></p>
<p><em>Replace user*@domain.com with a e-mail address hosted on your Postfix mailserver and user*@gmail.com with a valid Gmail e-mail address.</em></p>
<p>Look at /var/log/mail.log and you should see that the MailScanner score has been increased by SPF related rules:</p>
<p><code>Message 62ACA1813C.AFC5A from 192.168.1.4 (user@gmail.com) to domain.com is spam, SpamAssassin (score=7.394, required 6, MISSING_SUBJECT 1.28, SPF_HELO_NEUTRAL 2.00, SPF_NEUTRAL 1.21, TVD_SPACE_RATIO 2.90)<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/implementing-spf-checks-in-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blacklisting e-mail addresses using MailScanner</title>
		<link>http://www.debiantutorials.com/blacklisting-e-mail-addresses-using-mailscanner/</link>
		<comments>http://www.debiantutorials.com/blacklisting-e-mail-addresses-using-mailscanner/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 21:53:30 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[mailscanner]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=229</guid>
		<description><![CDATA[1. Create a new file containing the blacklisted e-mail addresses (pico /etc/MailScanner/rules/spam.blacklist.rules)
FromOrTo:	user1@domain.com	yes
FromOrTo:	user2@domain.net	yes
FromOrTo:	default			no

2. Configure MailScanner to handle all messages in the blacklist as spam (pico /etc/MailScanner/MailScanner.conf)
Replace this line:
Is Definitely Spam = no
&#160;
with this:
Is Definitely Spam = %rules-dir%/spam.blacklist.rules

3. Restart MailScanner
/etc/init.d/mailscanner restart

]]></description>
			<content:encoded><![CDATA[<p>1. Create a new file containing the blacklisted e-mail addresses (pico /etc/MailScanner/rules/spam.blacklist.rules)</p>
<p><code>FromOrTo:	user1@domain.com	yes<br />
FromOrTo:	user2@domain.net	yes<br />
FromOrTo:	default			no<br />
</code><span id="more-229"></span></p>
<p>2. Configure MailScanner to handle all messages in the blacklist as spam (pico /etc/MailScanner/MailScanner.conf)</p>
<p><code>Replace this line:<br />
Is Definitely Spam = no<br />
&nbsp;<br />
with this:<br />
Is Definitely Spam = %rules-dir%/spam.blacklist.rules<br />
</code></p>
<p>3. Restart MailScanner</p>
<p><code>/etc/init.d/mailscanner restart<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/blacklisting-e-mail-addresses-using-mailscanner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and configuring MailScanner for virus and spam filtering (Postfix, ClamAV, SpamAssassin, Razor)</title>
		<link>http://www.debiantutorials.com/installing-and-configuring-mailscanner-for-virus-and-spam-filtering-postfix-clamav-spamassassin-razor/</link>
		<comments>http://www.debiantutorials.com/installing-and-configuring-mailscanner-for-virus-and-spam-filtering-postfix-clamav-spamassassin-razor/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 20:57:29 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[mailscanner]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[razor]]></category>
		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=209</guid>
		<description><![CDATA[MailScanner is an e-mail security and anti-spam package for e-mail gateway systems. MailScanner is highly configurable using a very easy-to-use system of rulesets. Virtually every configuration option can, for example, be controlled on a per-user, per-domain or per-IP basis. 
It's assumed that you have already installed and configured Postfix according to this tutorial:
Installing Postfix with [...]]]></description>
			<content:encoded><![CDATA[<p>MailScanner is an e-mail security and anti-spam package for e-mail gateway systems. MailScanner is highly configurable using a very easy-to-use system of rulesets. Virtually every configuration option can, for example, be controlled on a per-user, per-domain or per-IP basis. </p>
<p>It's assumed that you have already installed and configured Postfix according to this tutorial:<br />
<a href="http://www.debiantutorials.net/installing-postfix-with-mysql-backend-and-sasl-for-smtp-authentication/">Installing Postfix with MySql backend and SASL for SMTP authentication</a></p>
<p>1. Add backports to your apt sources (pico /etc/apt/sources.list)</p>
<p><code>deb http://www.backports.org/debian lenny-backports main contrib non-free<br />
</code></p>
<p>2. Add the backports keyring and update apt</p>
<p><code>apt-get update<br />
apt-get install debian-backports-keyring<br />
apt-get update<br />
</code></p>
<p>3. Install required packages (ClamAV, SpamAssassin, Razor and required libs for MailScanner)</p>
<p><code>apt-get install clamav clamav-base clamav-freshclam libclamav6 spamassassin razor unzip libarchive-zip-perl libconvert-tnef-perl libhtml-parser-perl libmime-tools-perl libmime-perl libcompress-zlib-perl libconvert-binhex-perl libdbd-sqlite3-perl libfilesys-df-perl libsys-syslog-perl libsys-hostname-long-perl libmailtools-perl libole-storage-lite-perl libnet-cidr-perl<br />
</code><span id="more-209"></span></p>
<p>4. Install libnet-dns-perl from backports</p>
<p><code>apt-get -t lenny-backports install libnet-dns-perl<br />
</code></p>
<p>5. Install MailScanner</p>
<p><code>apt-get install mailscanner<br />
</code></p>
<p>6. Enable MailScanner (pico /etc/default/mailscanner)</p>
<p><code>run_mailscanner=1<br />
</code></p>
<p>7. Edit MailScanner configuration (pico /etc/MailScanner/MailScanner.conf)</p>
<p><code>Run As User = postfix<br />
Run As Group = postfix<br />
Incoming Queue Dir = /var/spool/postfix/hold<br />
Outgoing Queue Dir = /var/spool/postfix/incoming<br />
MTA = postfix<br />
Always Include SpamAssassin Report = yes<br />
Send Notices = no<br />
Spam List = RFC-IGNORANT-DSN SORBS-SMTP spamhaus-ZEN spamcop.net CBL<br />
Spam Lists To Reach High Score = 2<br />
High SpamAssassin Score = 8<br />
Rebuild Bayes Every = 86400<br />
Wait During Bayes Rebuild = yes<br />
High Scoring Spam Actions = delete<br />
</code></p>
<p>8. Create razorhome, discover razor servers and register for identify</p>
<p><code>razor-admin -create<br />
razor-admin -register<br />
</code></p>
<p>9. Make Postfix put all messages on hold to allow MailScanner to scan the messages (pico /etc/postfix/main.cf)</p>
<p><code>header_checks = regexp:/etc/postfix/header_checks<br />
</code></p>
<p>10. Create the header checks file referenced by previous line (pico /etc/postfix/header_checks)</p>
<p><code>/^Received:/ HOLD<br />
</code></p>
<p>11. Restart MailScanner and Postfix</p>
<p><code>/etc/init.d/mailscanner restart<br />
postfix reload<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-and-configuring-mailscanner-for-virus-and-spam-filtering-postfix-clamav-spamassassin-razor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
