<?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; Mail</title>
	<atom:link href="http://www.debiantutorials.com/category/mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.debiantutorials.com</link>
	<description>Copy/Paste tutorials for Debian Linux</description>
	<lastBuildDate>Wed, 08 Sep 2010 08:36:07 +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>Configuring goldfish autoresponder for Postfix</title>
		<link>http://www.debiantutorials.com/configuring-goldfish-autoresponder-for-postfix/</link>
		<comments>http://www.debiantutorials.com/configuring-goldfish-autoresponder-for-postfix/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 13:46:21 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Etch]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[autoresponder]]></category>
		<category><![CDATA[goldfish]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=335</guid>
		<description><![CDATA[goldfish is a quite simple autoresponder for Postfix in conjunction with MySQL, written in PHP. It consists of only one PHP file which can be started through a cronjob. 
In this tutorial, it's assumed that you have already installed Postfix with MySql backend using this tutorial: Installing Postfix with MySql backend and SASL for SMTP [...]]]></description>
			<content:encoded><![CDATA[<p>goldfish is a quite simple autoresponder for Postfix in conjunction with MySQL, written in PHP. It consists of only one PHP file which can be started through a cronjob. </p>
<p>In this tutorial, it's assumed that you have already installed Postfix with MySql backend using this tutorial: <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. Install PHP5-CLI (Command Line Interpreter) if it's not already installed</p>
<p><code>apt-get install php5-cli<br />
</code><span id="more-335"></span></p>
<p>2. Create a MySql table for goldfish and a user that has only read access to the users table and read/update access to the autoresponder table (mysql -u root -p)</p>
<p><code>USE mail;<br />
&nbsp;<br />
CREATE TABLE autoresponder (<br />
email varchar(255) NOT NULL,<br />
descname varchar(255) default NULL,<br />
`from` date NOT NULL,<br />
`to` date NOT NULL,<br />
message text NOT NULL,<br />
enabled tinyint(4) NOT NULL default '0',<br />
subject varchar(255) NOT NULL,<br />
PRIMARY KEY (email),<br />
FULLTEXT KEY message (message)<br />
) TYPE=MyISAM;<br />
&nbsp;<br />
-- Insert a sample out of office message for the<br />
-- e-mail address email@example.com<br />
-- Goldfish automatically enables and disables the out of office<br />
-- message according to the from and to dates<br />
-- (in this case: 7th of august to 14th of august 2010)<br />
INSERT INTO autoresponder ('email@example.com', 'Your name', '2010-08-07', '2010-08-14', 'Your message', '1', 'Your subject');<br />
&nbsp;<br />
GRANT SELECT,UPDATE ON mail.autoresponder TO '{username}'@'localhost' IDENTIFIED BY '{password}';<br />
GRANT SELECT ON mail.users TO '{username}'@'localhost' IDENTIFIED BY '{password}';<br />
FLUSH PRIVILEGES;<br />
&nbsp;<br />
exit;<br />
</code></p>
<p><em>Replace {username} and {password} with selected username and password that will be used by goldfish</em></p>
<p><em>We'll use the mail database that was created in the Postfix installation tutorial.</em></p>
<p>3. Download goldfish and put it to any location on the server. In this example I'll place it in /usr/local/goldfish</p>
<p><code>mkdir /usr/local/goldfish<br />
wget http://www.remofritzsche.com/projects/goldfish/download/goldfish-1.1-STABLE.tar.gz<br />
tar zxvf goldfish-1.1-STABLE.tar.gz<br />
mv goldfish-1.1-STABLE/* /usr/local/goldfish/<br />
rm goldfish-1.1-STABLE* -rf # Clean up<br />
</code></p>
<p><em>1.1 was the latest stable version when this tutorial was written. Check this location for updated version: http://www.remofritzsche.com/projects/goldfish/download/</em></p>
<p>4. Configure database information in goldfish (pico /usr/local/goldfish/autoresponder.php)</p>
<p><code>/* Database information */<br />
$conf['mysql_host'] = "localhost";<br />
$conf['mysql_user'] = "{username}";<br />
$conf['mysql_password'] = "{password}";<br />
$conf['mysql_database'] = "mail";<br />
</code></p>
<p><em>Input your MySql server information and the login created in step 2. mysql_host should be localhost in most cases and the mysql_database should be mail (if you didn't choose another name for the database when Postfix was installed with MySql backend)</em></p>
<p>5. Configure database queries in goldfish (pico /usr/local/goldfish/autoresponder.php)</p>
<p><code>/* Database Queries */<br />
&nbsp;<br />
# This query has to return the path (`path`) of the corresponding<br />
# maildir-Mailbox with email-address %m<br />
$conf['q_mailbox_path'] = "SELECT CONCAT('/home/vmail/', SUBSTRING_INDEX(email,'@',-1), '/', SUBSTRING_INDEX(email,'@',1), '/') as `path` FROM users WHERE `email` = '%m'";<br />
</code></p>
<p><em>The database queries begin on line 56 in version 1.1. Replace the q_mailbox_path query with the one shown above. The only change is that the table name is changed from view_users to users.</em></p>
<p>6. Make the vmail user the owner of the goldfish directory and make the php file executable. The vmail user was created when you installed Postfix.</p>
<p><code>chown vmail /usr/local/goldfish -R<br />
chmod 700 /usr/local/goldfish/autoresponder.php<br />
</code></p>
<p>7. Create a cronjob to run goldfish every 5 minutes as the vmail user. It must be running as a user that can read the maildir mailboxes currently located in /home/vmail. (crontab -e)</p>
<p><code>*/5 * * * * vmail /usr/local/goldfish/autoresponder.php<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/configuring-goldfish-autoresponder-for-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup DomainKeys Identified Mail (DKIM) in Postfix</title>
		<link>http://www.debiantutorials.com/setup-domainkeys-identified-mail-dkim-in-postfix/</link>
		<comments>http://www.debiantutorials.com/setup-domainkeys-identified-mail-dkim-in-postfix/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 08:39:04 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[dkim]]></category>
		<category><![CDATA[DomainKeys]]></category>
		<category><![CDATA[milter]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=323</guid>
		<description><![CDATA[DomainKeys Identified Mail (DKIM) is a method for email authentication that allows an organization to take responsibility for a message it has sent in a way that can be validated by a recipient. The technique is based on public-key cryptography: Responsibility is claimed by the signer by adding a digital signature to a message's header, [...]]]></description>
			<content:encoded><![CDATA[<p>DomainKeys Identified Mail (DKIM) is a method for email authentication that allows an organization to take responsibility for a message it has sent in a way that can be validated by a recipient. The technique is based on public-key cryptography: Responsibility is claimed by the signer by adding a digital signature to a message's header, the DKIM-Signature header field. The verifier recovers the signer's public key using the DNS, and then verifies that the signed parts have not been altered.</p>
<p>1. Install DKIM filter</p>
<p><code>apt-get install dkim-filter<br />
</code><span id="more-323"></span></p>
<p>2. Create a key for each domain verified</p>
<p><code>mkdir -p /etc/dkim/keys/domain1.com<br />
cd /etc/dkim/keys/domain1.com<br />
dkim-genkey -r -d domain1.com<br />
</code></p>
<p><em>Replace domain1.com with the domain that this mail server should authenticate using DKIM</em></p>
<p>3. Add a line for each domain to dkim-keys.conf file (pico /etc/dkim-keys.conf)</p>
<p><code>*@domain1.com:domain1.com:/etc/dkim/keys/domain1.com/default.private<br />
</code></p>
<p><em>Replace domain1.com with the domain that this mail server should authenticate using DKIM</em></p>
<p>4. Add a TXT record to the DNS for the domain being authenticated using DKIM. The record is automatically created and stored in /etc/dkim/keys/domain1.com/default.txt. You just need to add it to the DNS server. (cat /etc/dkim/keys/domain1.com/default.txt)</p>
<p>Here's a sample output:</p>
<p><code>default._domainkey IN TXT "v=DKIM1; g=*; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8IQNYlS+8jyrbAxNsghsPrWYgOQQWI0Ab4e9MToZYLTBGI41V3Zet5Awrt19nMIUlTpuE+/YVnjP/pu3fgeYkoe6NUzp+oEcWAioQXBmx0njigac7iJ/I0naTP1xTrDacnwsTp/F+lMwGgjiHpaJA7iBmL0AfYMXlTBo5pFog2QIDAQAB" ; ----- DKIM default for domain1.com<br />
</code></p>
<p>Repeat steps 2, 3 and 4 for every domain that this server should authenticate using DKIM.</p>
<p>5. Uncomment line 37 to make DKIM filter use the dkim-keys.conf file to look up domains available (pico /etc/dkim-filter.conf)</p>
<p><code>KeyList                /etc/dkim-keys.conf<br />
</code></p>
<p>6. Add a inet socket that Postfix can communicate with (pico /etc/default/dkim-filter)</p>
<p><code>SOCKET="inet:8891@localhost"<br />
</code></p>
<p>7. Restart DKIM filter</p>
<p><code>/etc/init.d/dkim-filter restart<br />
</code></p>
<p>8. Configure Postfix to query DKIM filter using the socket created earlier. Add these lines to main.cf (pico /etc/postfix/main.cf)</p>
<p><code>milter_default_action = accept<br />
milter_protocol = 2<br />
smtpd_milters = inet:localhost:8891<br />
non_smtpd_milters = inet:localhost:8891<br />
</code></p>
<p>9. Reload Postfix config</p>
<p><code>postfix reload<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/setup-domainkeys-identified-mail-dkim-in-postfix/feed/</wfw:commentRss>
		<slash:comments>1</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>Transfer mailboxes between IMAP servers with imapsync</title>
		<link>http://www.debiantutorials.com/transfer-mailboxes-between-imap-servers-with-imapsync/</link>
		<comments>http://www.debiantutorials.com/transfer-mailboxes-between-imap-servers-with-imapsync/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 09:22:40 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[sync]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=260</guid>
		<description><![CDATA[imapsync is a tool for facilitating incremental recursive IMAP transfers from one mailbox to another. It is useful for mailbox migration, and reduces the amount of data transferred by only copying messages that are not present on both servers. Read, unread, and deleted flags are preserved, and the process can be stopped and resumed. The [...]]]></description>
			<content:encoded><![CDATA[<p>imapsync is a tool for facilitating incremental recursive IMAP transfers from one mailbox to another. It is useful for mailbox migration, and reduces the amount of data transferred by only copying messages that are not present on both servers. Read, unread, and deleted flags are preserved, and the process can be stopped and resumed. The original messages can optionally be deleted after a successful transfer.</p>
<p>1. Install imapsync</p>
<p><code>apt-get install imapsync<br />
</code><span id="more-260"></span></p>
<p>2. Sync the mailboxes</p>
<p><code>imapsync --host1 {host1} --user1 {user1} --password1 {password1} --host2 {host2} --user2 {user2} --password2 {password2} --subscribe<br />
</code></p>
<p><em>{host1}: The source mail server's host or ip address<br />
{user1}: User name on the source mail server<br />
{password1}: Password on the source mail server<br />
{host2}: The destination mail server's host or ip address<br />
{user2}: User name on the destination mail server<br />
{password2}: Password on the destination mail server<br />
</em></p>
<p>When moving between different server software you may need to add or remove prefixes. For example when moving from dovecot to courier you need to add this parameter to remove the INBOX. prefix from the folder names: --prefix1 INBOX.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/transfer-mailboxes-between-imap-servers-with-imapsync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing nginx from source with mail support</title>
		<link>http://www.debiantutorials.com/installing-nginx-from-source-with-mail-support/</link>
		<comments>http://www.debiantutorials.com/installing-nginx-from-source-with-mail-support/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 23:14:33 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=251</guid>
		<description><![CDATA[nginx is a lightweight, high performance web server/reverse proxy and e-mail (SMTP/IMAP/POP3) proxy.
1. Install required packages
apt-get install build-essential autotools-dev debhelper libpcre3-dev zlib1g-dev libssl-dev

2. Receive the nginx source
apt-get source nginx

3. Enable the mail modules
cd nginx-x.x.x
pico debian/rules

Replace nginx-x.x.x with the correct folder created.
Add "--with-mail --with-mail_ssl_module" to the line starting with ./configure so that it looks something like [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.debiantutorials.net/wp-content/uploads/2010/03/nginx-logo.png" alt="nginx" title="nginx" width="175" height="45" class="alignright size-full wp-image-253" />nginx is a lightweight, high performance web server/reverse proxy and e-mail (SMTP/IMAP/POP3) proxy.</p>
<p>1. Install required packages</p>
<p><code>apt-get install build-essential autotools-dev debhelper libpcre3-dev zlib1g-dev libssl-dev<br />
</code><span id="more-251"></span></p>
<p>2. Receive the nginx source</p>
<p><code>apt-get source nginx<br />
</code></p>
<p>3. Enable the mail modules</p>
<p><code>cd nginx-x.x.x<br />
pico debian/rules<br />
</code></p>
<p><em>Replace nginx-x.x.x with the correct folder created.</em></p>
<p>Add "--with-mail --with-mail_ssl_module" to the line starting with ./configure so that it looks something like this:</p>
<p><code>./configure $(CONFIGURE_OPTS) --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock   --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-mail --with-mail_ssl_module<br />
</code></p>
<p>4. Build the package</p>
<p><code>dpkg-buildpackage<br />
</code></p>
<p>5. Install the new nginx package</p>
<p><code>dpkg -i ../nginx_x.x.x-x.deb<br />
</code></p>
<p><em>Replace nginx_x.x.x-x.deb with the correct version and platform. In my case the filename is: nginx_0.6.32-3+lenny3_amd64.deb</em></p>
<p>6. Configure nginx</p>
<p>Next step is to configure the nginx rules. That's outside the scope of this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-nginx-from-source-with-mail-support/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

If you want to handle all messages from blacklisted e-mail addresses like high scoring spam, change this property:
Definite Spam Is [...]]]></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>If you want to handle all messages from blacklisted e-mail addresses like high scoring spam, change this property:</p>
<p><code>Definite Spam Is High Scoring = yes<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>
		<item>
		<title>Installing Dovecot IMAP and POP daemon with MySql backend</title>
		<link>http://www.debiantutorials.com/installing-dovecot-imap-and-pop-daemon-with-mysql-backend/</link>
		<comments>http://www.debiantutorials.com/installing-dovecot-imap-and-pop-daemon-with-mysql-backend/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 15:06:03 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[pop3]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=197</guid>
		<description><![CDATA[Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like systems, written primarily with security in mind. Dovecot primarily aims to be a lightweight, fast and easy to set up open source mailserver.
It's assumed that you have already installed and configured Postfix according to this tutorial:
Installing Postfix with MySql backend and SASL for SMTP [...]]]></description>
			<content:encoded><![CDATA[<p>Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like systems, written primarily with security in mind. Dovecot primarily aims to be a lightweight, fast and easy to set up open source mailserver.</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. Install required packages</p>
<p><code>apt-get install dovecot-imapd dovecot-pop3d<br />
</code><span id="more-197"></span></p>
<p>2. Configure Dovecot (pico /etc/dovecot/dovecot.conf)</p>
<p><code>protocols = imap imaps pop3 pop3s<br />
ssl_disable = no<br />
mail_location = maildir:/home/vmail/%d/%n<br />
auth default {<br />
	passdb sql {<br />
	  args = /etc/dovecot/dovecot-sql.conf<br />
	}<br />
	userdb sql {<br />
	  args = /etc/dovecot/dovecot-sql.conf<br />
	}<br />
}<br />
disable_plaintext_auth = no<br />
user = vmail<br />
</code></p>
<p><em>Add or edit the above properties and leave everything else with the default value or configure according to your needs</em></p>
<p>3. Configure the MySql connector (pico /etc/dovecot/dovecot-sql.conf)</p>
<p><code>driver = mysql<br />
connect = host=127.0.0.1 dbname={database} user={username} password={password}<br />
default_pass_scheme = CRYPT<br />
password_query = SELECT email as user, password FROM users WHERE email = '%u'<br />
user_query = SELECT CONCAT('/home/vmail/',SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') as home, '5000' as uid, '5000' as gid FROM users WHERE email = '%u'<br />
</code></p>
<p><em>{database} = MySql database name<br />
{username} = MySql username<br />
{password} = MySql password</em></p>
<p>4. Restart Dovecot daemon</p>
<p><code>/etc/init.d/dovecot restart<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-dovecot-imap-and-pop-daemon-with-mysql-backend/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Installing Courier POP3 and IMAP daemon with MySql backend</title>
		<link>http://www.debiantutorials.com/installing-courier-pop3-and-imap-daemon-with-mysql-backend-install-courier/</link>
		<comments>http://www.debiantutorials.com/installing-courier-pop3-and-imap-daemon-with-mysql-backend-install-courier/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 11:02:31 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[courier]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[pop3]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=191</guid>
		<description><![CDATA[The Courier mail transfer agent (MTA) is an integrated mail/groupware server based on open commodity protocols, such as ESMTP, IMAP, POP3, LDAP, SSL, and HTTP. Courier provides ESMTP, IMAP, POP3, webmail, and mailing list services within a single, consistent, framework. In this tutorial we'll only use the Courier POP3 and IMAP services.
It's assumed that you [...]]]></description>
			<content:encoded><![CDATA[<p>The Courier mail transfer agent (MTA) is an integrated mail/groupware server based on open commodity protocols, such as ESMTP, IMAP, POP3, LDAP, SSL, and HTTP. Courier provides ESMTP, IMAP, POP3, webmail, and mailing list services within a single, consistent, framework. In this tutorial we'll only use the Courier POP3 and IMAP services.</p>
<p>It's assumed that you have already installed and configured Postfix according to this tutorial: <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. Install required packages</p>
<p><code>apt-get install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl<br />
</code><span id="more-191"></span></p>
<p>2. Make Courier use MySql backend (pico /etc/courier/authdaemonrc)</p>
<p><code>authmodulelist="authmysql"<br />
</code></p>
<p>3. Configure the MySql connector (pico /etc/courier/authmysqlrc)</p>
<p><code>MYSQL_SERVER 127.0.0.1<br />
MYSQL_USERNAME {username}<br />
MYSQL_PASSWORD {password}<br />
MYSQL_PORT 0<br />
MYSQL_DATABASE {database}<br />
MYSQL_USER_TABLE users<br />
MYSQL_CRYPT_PWFIELD password<br />
MYSQL_UID_FIELD 5000<br />
MYSQL_GID_FIELD 5000<br />
MYSQL_LOGIN_FIELD email<br />
MYSQL_HOME_FIELD "/home/vmail"<br />
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')<br />
MYSQL_QUOTA_FIELD quota<br />
</code></p>
<p><em>{database} = MySql database name<br />
MySql username<br />
MySql password</em></p>
<p>4. Restart Courier daemons</p>
<p><code>/etc/init.d/courier-authdaemon restart<br />
/etc/init.d/courier-imap restart<br />
/etc/init.d/courier-imap-ssl restart<br />
/etc/init.d/courier-pop restart<br />
/etc/init.d/courier-pop-ssl restart<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-courier-pop3-and-imap-daemon-with-mysql-backend-install-courier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
