<?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/tag/mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.debiantutorials.com</link>
	<description>Copy/Paste tutorials for Debian based Linux distros</description>
	<lastBuildDate>Tue, 27 Dec 2011 01:15:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Installing Dovecot IMAP and POP3 daemon with MySql backend on squeeze</title>
		<link>http://www.debiantutorials.com/installing-dovecot-imap-and-pop3-daemon-with-mysql-backend-on-squeeze/</link>
		<comments>http://www.debiantutorials.com/installing-dovecot-imap-and-pop3-daemon-with-mysql-backend-on-squeeze/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 00:52:14 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[pop]]></category>
		<category><![CDATA[pop3]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.com/?p=409</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 [...]]]></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-409"></span></p>
<p>2. Configure Dovecot (pico /etc/dovecot/dovecot.conf)</p>
<p><code>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-pop3-daemon-with-mysql-backend-on-squeeze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install Roundcube on squeeze</title>
		<link>http://www.debiantutorials.com/how-to-install-roundcube-on-squeeze/</link>
		<comments>http://www.debiantutorials.com/how-to-install-roundcube-on-squeeze/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 00:35:17 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[roundcube]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.com/?p=406</guid>
		<description><![CDATA[Roundcube is a browser-based multilingual IMAP client with an application-like user interface. It provides full functionality you expect from an e-mail client, including MIME support, address book, folder manipulation, message searching and spell checking. Installation is easy in Debian but the application is pretty outdated in the squeeze apt repository so you may want to [...]]]></description>
			<content:encoded><![CDATA[<p>Roundcube is a browser-based multilingual IMAP client with an application-like user interface. It provides full functionality you expect from an e-mail client, including MIME support, address book, folder manipulation, message searching and spell checking.</p>
<p>Installation is easy in Debian but the application is pretty outdated in the squeeze apt repository so you may want to install the latest version manually instead. You can download the source from <a href="http://sourceforge.net/projects/roundcubemail/files/roundcubemail/">Sourceforge</a>.</p>
<p>1. Install roundcube</p>
<p><code>apt-get install roundcube roundcube-mysql<br />
</code><span id="more-406"></span></p>
<p>2. Configure apache (pico /etc/apache2/conf.d/roundcube)</p>
<p><code>Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/<br />
Alias /roundcube /var/lib/roundcube<br />
</code></p>
<p>3. For some reason the default language is set to ar_SA. Change it to English (pico /var/lib/roundcube/config/main.inc.php)</p>
<p><code>$rcmail_config['language'] = 'en_US';<br />
</code></p>
<p>4. Restart apache</p>
<p><code>/etc/init.d/apache2 restart<br />
</code></p>
<p>Now you can access Roundcube on this location: http://yourserver/roundcube</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/how-to-install-roundcube-on-squeeze/feed/</wfw:commentRss>
		<slash:comments>2</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>1</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 [...]]]></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>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 [...]]]></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>1</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 [...]]]></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 the DSPAM web frontend on lenny</title>
		<link>http://www.debiantutorials.com/installing-the-dspam-web-frontend-on-lenny/</link>
		<comments>http://www.debiantutorials.com/installing-the-dspam-web-frontend-on-lenny/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 23:38:59 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dspam]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[lenny]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=90</guid>
		<description><![CDATA[This tutorial covers installing and configuring the DSPAM web frontend. Using the web frontend, the mail users can configure the sensitivity of the spam filter, see statistics and more. I assume you already have the Apache2 web server and DSPAM daemon installed. 1. Install the dspam-webfrontend package and suexec module for the Apache2 web server. [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial covers installing and configuring the DSPAM web frontend. Using the web frontend, the mail users can configure the sensitivity of the spam filter, see statistics and more.</p>
<p>I assume you already have the Apache2 web server and DSPAM daemon installed.</p>
<p>1. Install the dspam-webfrontend package and suexec module for the Apache2 web server.</p>
<p><code>apt-get install dspam-webfrontend apache2-suexec<br />
</code><span id="more-90"></span></p>
<p>2. Enable the suexec module</p>
<p><code>a2enmod suexec<br />
</code></p>
<p>3. Configure the default web site to allow access to DSPAM webfrontend. Append these lines to the file somewhere between &lt;VirtualHost *:80&gt;&lt;/VirtualHost&gt; (pico /etc/apache2/sites-enabled/000-default)</p>
<p><code>SuexecUserGroup dspam dspam<br />
Addhandler cgi-script .cgi<br />
Options +ExecCGI -Indexes<br />
&nbsp;<br />
Alias /dspam /var/www/dspam/<br />
&lt;Directory /var/www/dspam/&gt;<br />
Addhandler cgi-script .cgi<br />
Options +ExecCGI -Indexes<br />
DirectoryIndex dspam.cgi<br />
&nbsp;<br />
AuthType Basic<br />
AuthName "DSPAM Control Center"<br />
AuthUserFile /etc/dspam/webfrontend.htpasswd<br />
Require valid-user<br />
&nbsp;<br />
AllowOverride None<br />
&lt;/Directory&gt;<br />
</code></p>
<p>4. Create a file containing users that have access to the webfrontend</p>
<p><code>htpasswd -c /etc/dspam/webfrontend.htpasswd user1<br />
</code></p>
<p><em>Change user1 into the username you want to allow access. The username must match the username used by you mail server to indentify the mail box so you may want to use other authentication backend to match the one used by you mail server.</em></p>
<p>Now you can access the webfrontend by entering http://yourserver/dspam/ in your web browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-the-dspam-web-frontend-on-lenny/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing DSPAM with ClamAV for Postfix on lenny</title>
		<link>http://www.debiantutorials.com/installing-dspam-with-clamav-for-postfix-on-lenny/</link>
		<comments>http://www.debiantutorials.com/installing-dspam-with-clamav-for-postfix-on-lenny/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 23:23:15 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[dspam]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=81</guid>
		<description><![CDATA[DSPAM is a scalable and open-source content-based spam filter designed for multi-user enterprise systems. On a properly configured system, many users experience results between 99.5% - 99.95%, or one error for every 200 to 2000 messages. Install and configure the DSPAM daemon 1. Install DSPAM daemon with MySql storage driver and ClamAV. The installer will [...]]]></description>
			<content:encoded><![CDATA[<p>DSPAM is a scalable and open-source content-based spam filter designed for multi-user enterprise systems. On a properly configured system, many users experience results between 99.5% - 99.95%, or one error for every 200 to 2000 messages.</p>
<p><strong>Install and configure the DSPAM daemon</strong></p>
<p>1. Install DSPAM daemon with MySql storage driver and ClamAV. The installer will create a database and required table structure.</p>
<p><code>apt-get install DSPAM libdspam7-drv-mysql clamav<br />
 &gt; Yes<br />
 &gt; Type the password for the root user in MySql<br />
 &gt; Select a strong password or allow a random password to be generated<br />
</code><span id="more-81"></span></p>
<p>2. Configure DSPAM to deliver mail to the Postfix mail server on port 10025, use ClamAV for virus filtering and more. You should read the config file carefully and adjust as needed. (pico /etc/dspam/dspam.conf)</p>
<p><code>StorageDriver /usr/lib/dspam/libmysql_drv.so<br />
DeliveryHost        127.0.0.1<br />
DeliveryPort        10025<br />
DeliveryIdent       dspam<br />
DeliveryProto       SMTP<br />
Preference "signatureLocation=headers"<br />
Preference "spamSubject=SPAM"<br />
Opt out<br />
TrackSources spam<br />
ClamAVPort      3310<br />
ClamAVHost      127.0.0.1<br />
ClamAVResponse accept<br />
ServerMode auto<br />
ServerPass.Relay1       "secret"<br />
ServerParameters        "--deliver=innocent -d %u"<br />
ServerDomainSocketPath  "/var/run/dspam/dspam.sock"<br />
</code></p>
<p>3. Enable the DSPAM daemon (pico /etc/default/dspam)</p>
<p><code>START=yes<br />
</code></p>
<p>4. Restart the DSPAM daemon</p>
<p><code>/etc/init.d/dspam restart<br />
</code></p>
<p>&nbsp;</p>
<p><strong>Install and configure Postfix mail system</strong></p>
<p>1. Install Postfix mail system if not already installed. The postfix-pcre package is required for the dspam_filter_access and dspam_check_aliases files created later.</p>
<p><code>apt-get install postfix postfix-pcre<br />
</code></p>
<p>2. We only want to filter incoming mail (pico /etc/postfix/dspam_filter_access)</p>
<p><code>/^(spam|ham)@.*$/ OK<br />
/./ FILTER dspam:dspam<br />
</code></p>
<p>Set correct permissions on the newly created file</p>
<p><code>chown root.postfix /etc/postfix/dspam_filter_access<br />
</code></p>
<p>3. Set up special aliases to train DSPAM (pico /etc/aliases)</p>
<p><code>ham: ham@ham.ham<br />
spam: spam@spam.spam<br />
</code></p>
<p><code>postalias /etc/aliases<br />
</code></p>
<p>Add entries into the transports file (pico /etc/postfix/transports)</p>
<p><code>spam.spam       dspam-retrain:spam<br />
ham.ham         dspam-retrain:innocent<br />
</code></p>
<p><code>postmap /etc/postfix/transports<br />
</code></p>
<p>Create a filter to prevent unwanted use of the spam and ham aliases (pico /etc/postfix/dspam_check_aliases)</p>
<p><code>/^.*(spam|ham)@.*$/ REJECT<br />
</code></p>
<p><code>postmap /etc/postfix/dspam_check_aliases<br />
</code></p>
<p>4. Configure Postfix (pico /etc/postfix/main.cf)</p>
<p><code>smtpd_client_restrictions = check_client_access pcre:/etc/postfix/dspam_filter_access<br />
dspam_destination_recipient_limit = 1<br />
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access pcre:/etc/postfix/dspam_check_aliases, check_sender_access pcre:/etc/postfix/dspam_check_aliases<br />
transport_maps = hash:/etc/postfix/transports<br />
</code></p>
<p><em>If you have changed the config of your mail server from the default ones, you may need to append the new values instead of replacing the whole line.</em></p>
<p>Append these lines to the master.cf file (pico /etc/postfix/master.cf)</p>
<p><code>dspam                 unix    -       n       n       -       -    pipe<br />
flags=Ru user=dspam argv=/usr/bin/dspam --client --deliver=innocent,spam --user ${recipient} --mail-from=${sender}<br />
&nbsp;<br />
dspam-retrain         unix    -       n       n       -      -     pipe<br />
flags=Rhq user=dspam argv=/usr/bin/dspam --client --mode=teft --class=$nexthop --source=error --user dspam<br />
&nbsp;<br />
localhost:10025 inet  n -       n       -       -        smtpd<br />
  -o content_filter=<br />
  -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks<br />
  -o smtpd_helo_restrictions=<br />
  -o smtpd_client_restrictions=<br />
  -o smtpd_sender_restrictions=<br />
  -o smtpd_recipient_restrictions=permit_mynetworks,reject<br />
  -o mynetworks=127.0.0.0/8<br />
  -o smtpd_authorized_xforward_hosts=127.0.0.0/8<br />
</code></p>
<p>&nbsp;</p>
<p><strong>Train DSPAM</strong></p>
<p>1. Install bzip2</p>
<p><code>apt-get install bzip2<br />
</code></p>
<p>2. Download training content</p>
<p><code>cd /tmp<br />
wget http://spamassassin.apache.org/publiccorpus/20050311_spam_2.tar.bz2<br />
wget http://spamassassin.apache.org/publiccorpus/20030228_easy_ham_2.tar.bz2<br />
</code></p>
<p>3. Extract the training content</p>
<p><code>tar xvfj 20050311_spam_2.tar.bz2<br />
tar xvfj 20030228_easy_ham_2.tar.bz2<br />
</code></p>
<p>4. Start the training. This may take a few minutes.</p>
<p><code>dspam_train test spam_2/ easy_ham_2/<br />
</code></p>
<p>You're all set, now you should have a fully function mail system with powerful spam and virus filtering.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-dspam-with-clamav-for-postfix-on-lenny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Courier POP3 and IMAP services with MySql backend</title>
		<link>http://www.debiantutorials.com/installing-courier-pop3-and-imap-services-with-mysql-backend/</link>
		<comments>http://www.debiantutorials.com/installing-courier-pop3-and-imap-services-with-mysql-backend/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 23:55:46 +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[imap]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[pop3]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=64</guid>
		<description><![CDATA[This tutorial assumes you already have Postfix installed with MySql backend as described in this tutorial: Installing Postfix with MySql backend and TLS 1. Install required packages apt-get install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl 2. Make the auth daemon support MySql virtual users (pico /etc/courier/authdaemonrc) authmodulelist="authmysql" 3. Configure courier to use MySql backend (pico [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial assumes you already have Postfix installed with MySql backend as described in this tutorial: <a href="http://www.debiantutorials.net/installing-postfix-with-mysql-backend-and-tls/">Installing Postfix with MySql backend and TLS</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-64"></span></p>
<p>2. Make the auth daemon support MySql virtual users (pico /etc/courier/authdaemonrc)</p>
<p><code>authmodulelist="authmysql"<br />
</code></p>
<p>3. Configure courier to use MySql backend (pico /etc/courier/authmysqlrc)</p>
<p><code>MYSQL_SERVER {mysql_host}<br />
MYSQL_USERNAME {mysql_username}<br />
MYSQL_PASSWORD {mysql_password}<br />
MYSQL_PORT 0<br />
MYSQL_DATABASE {mysql_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>4. Restart affected 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>
<p>You can now connect to your server on port 110 for pop3, 995 for pop3s, 143 for imap and 993 for imaps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-courier-pop3-and-imap-services-with-mysql-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Postfix with MySql backend and TLS</title>
		<link>http://www.debiantutorials.com/installing-postfix-with-mysql-backend-and-tls/</link>
		<comments>http://www.debiantutorials.com/installing-postfix-with-mysql-backend-and-tls/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 22:57:36 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[sasl]]></category>
		<category><![CDATA[tls]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=61</guid>
		<description><![CDATA[In this tutorial we'll install a ready to use Postfix mail server with MySql backend for virtual users. Notice that this tutorial only covers installing the SMTP server (not POP3 and IMAP). Click here for a tutorial on installing Courier POP3 and IMAp services. Once installed and configured, you can easily create your own admin [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we'll install a ready to use Postfix mail server with MySql backend for virtual users. Notice that this tutorial only covers installing the SMTP server (not POP3 and IMAP). <a href="http://www.debiantutorials.net/installing-courier-pop3-and-imap-services-with-mysql-backend/">Click here for a tutorial on installing Courier POP3 and IMAp services</a>.</p>
<p>Once installed and configured, you can easily create your own admin system to modifiy the domains and users because the table structure is very simple.</p>
<p>This tutorial has been tested on Debian etch and lenny</p>
<p>1. Install the Postfix mail server, MySql server and other required packages</p>
<p><code>apt-get install postfix postfix-mysql sasl2-bin libsasl2-modules mysql-client mysql-server libpam-mysql<br />
</code><span id="more-61"></span>	</p>
<p>In the configuration wizzard for Postfix select and input the following</p>
<p><code>General type of mail configuration<br />
 -> Internet Site<br />
&nbsp;<br />
System mail name<br />
 -> server.domain.com (your server host name)<br />
</code></p>
<p>2. Create a MySql database that will contain domains and mappings and create a user that has read privileges on it. Execute the following SQL queries to create the table structure:</p>
<p><code>CREATE TABLE domains (<br />
  domain varchar(63) NOT NULL,<br />
  PRIMARY KEY (domain)<br />
) ENGINE=MyISAM;<br />
&nbsp;<br />
CREATE TABLE forwardings (<br />
  email varchar(255) NOT NULL,<br />
  destination text NOT NULL,<br />
  PRIMARY KEY (email)<br />
) ENGINE=MyISAM;<br />
&nbsp;<br />
CREATE TABLE transport (<br />
  domain varchar(255) NOT NULL,<br />
  transport varchar(255) NOT NULL,<br />
  PRIMARY KEY (domain)<br />
) ENGINE=MyISAM;<br />
&nbsp;<br />
CREATE TABLE users (<br />
  email varchar(255) NOT NULL,<br />
  password varchar(255) NOT NULL,<br />
  quota int(10) unsigned NOT NULL default '102400',<br />
  PRIMARY KEY (email)<br />
) ENGINE=MyISAM;<br />
</code></p>
<p>3. Populate tables with some test data</p>
<p><code>INSERT INTO domains (domain) VALUES (mydomain.com);<br />
INSERT INTO users (email, password) VALUES ('address@mydomain.com', ENCRYPT('mypassword'));<br />
INESRT INTO forwardings (email, desination) VALUES ('myforward@mydomain.com', 'address@mydomain.com, otheraddress@mydomain.com');<br />
INSERT INTO transport (domain, transport) VALUES ('transport.com', 'smtp:mail.transport.com');<br />
</code></p>
<p><em>If you want to create a user or forwarding for a domain, you must add it to the domains table. Using the transport table you can forward all mail received to another mail server, when using the transport table you don't have to add the domain to the domains table.</em></p>
<p>4. Create MySql mappings for Postfix. Replace {mysql_*} with your MySql credentials.</p>
<p><code>pico /etc/postfix/mysql-virtual_domains.cf<br />
	hosts = {mysql_host}<br />
	user = {mysql_username}<br />
	password = {mysql_password}<br />
	dbname = {mysql_database}<br />
	table = domains<br />
	select_field = 'virtual'<br />
	where_field = domain<br />
&nbsp;<br />
pico /etc/postfix/mysql-virtual_forwardings.cf<br />
	hosts = {mysql_host}<br />
	user = {mysql_username}<br />
	password = {mysql_password}<br />
	dbname = {mysql_database}<br />
	table = forwardings<br />
	select_field = destination<br />
	where_field = email<br />
&nbsp;<br />
pico /etc/postfix/mysql-virtual_mailboxes.cf<br />
	hosts = {mysql_host}<br />
	user = {mysql_username}<br />
	password = {mysql_password}<br />
	dbname = {mysql_database}<br />
	table = users<br />
	select_field = CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')<br />
	where_field = email<br />
&nbsp;<br />
pico /etc/postfix/mysql-virtual_email2email.cf<br />
	hosts = {mysql_host}<br />
	user = {mysql_username}<br />
	password = {mysql_password}<br />
	dbname = {mysql_database}<br />
	table = users<br />
	select_field = email<br />
	where_field = email<br />
&nbsp;<br />
pico /etc/postfix/mysql-virtual_transports.cf<br />
	hosts = {mysql_host}<br />
	user = {mysql_username}<br />
	password = {mysql_password}<br />
	dbname = {mysql_database}<br />
	table = transport<br />
	select_field = transport<br />
	where_field = domain<br />
&nbsp;<br />
pico /etc/postfix/mysql-virtual_mailbox_limit_maps.cf<br />
	hosts = {mysql_host}<br />
	user = {mysql_username}<br />
	password = {mysql_password}<br />
	dbname = {mysql_database}<br />
	table = users<br />
	select_field = quota<br />
	where_field = email<br />
</code></p>
<p>5. Set correct permissions on the newly created files and allow Postfix to read the files</p>
<p><code>chmod 640 /etc/postfix/mysql-virtual_*<br />
chgrp postfix /etc/postfix/mysql-virtual_*<br />
</code></p>
<p>6. Create a new user and group named vmail. All incoming mail will be stored in this users home directory</p>
<p><code>groupadd -g 5000 vmail<br />
useradd -g vmail -u 5000 vmail -d /home/vmail -m<br />
</code></p>
<p>7. Configure Postfix to use SASL for user authentication and TLS for encryption</p>
<p><code>postconf -e 'smtpd_sasl_auth_enable = yes'<br />
postconf -e 'broken_sasl_auth_clients = yes'<br />
postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination'<br />
postconf -e 'smtpd_use_tls = yes'<br />
postconf -e 'smtpd_tls_cert_file = /etc/postfix/smtpd.cert'<br />
postconf -e 'smtpd_tls_key_file = /etc/postfix/smtpd.key'<br />
postconf -e 'smtpd_sasl_local_domain = $myhostname'<br />
postconf -e 'smtpd_sasl_security_options = noanonymous'<br />
</code></p>
<p>8. Configure Postfix to use the MySql database to find virtual users, where to store mail and what to do for users over quota</p>
<p><code>postconf -e 'virtual_alias_domains ='<br />
postconf -e 'virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf'<br />
postconf -e 'virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf'<br />
postconf -e 'virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf'<br />
postconf -e 'virtual_mailbox_base = /home/vmail'<br />
postconf -e 'virtual_uid_maps = static:5000'<br />
postconf -e 'virtual_gid_maps = static:5000'<br />
postconf -e 'transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf'<br />
postconf -e 'virtual_create_maildirsize = yes'<br />
postconf -e 'virtual_mailbox_extended = yes'<br />
postconf -e 'virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf'<br />
postconf -e 'virtual_mailbox_limit_override = yes'<br />
postconf -e 'virtual_maildir_limit_message = "The user you are trying to reach is over quota."'<br />
postconf -e 'virtual_overquota_bounce = yes'<br />
postconf -e 'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps    $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps'<br />
</code></p>
<p>9. Create a self signed certificate to encrypt connections</p>
<p><code>openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509<br />
chmod 640 /etc/postfix/smtpd.key<br />
</code></p>
<p>10. Make Postfix listen on port 465 for secure smtp connections (pico /etc/postfix/master.cf)</p>
<p><code>smtps     inet  n       -       -       -       -       smtpd<br />
 -o smtpd_tls_wrappermode=yes<br />
 -o smtpd_sasl_auth_enable=yes<br />
 -o smtpd_client_restrictions=permit_sasl_authenticated,reject<br />
</code></p>
<p>11. Force SASL to store the PID files in a location where Postfix can read them</p>
<p><code>mkdir -p /var/spool/postfix/var/run/saslauthd<br />
</code></p>
<p>Edit SASL config to enable the daemon and make it use the new PID file location (pico /etc/default/saslauthd)</p>
<p><code>START=yes<br />
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"<br />
</code></p>
<p>Edit the init file for SASL (pico /etc/init.d/saslauthd)</p>
<p><code>PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"<br />
</code></p>
<p>12. Insert MySql credentials for PAM (pico /etc/pam.d/smtp)</p>
<p><code>auth    required   pam_mysql.so user={mysql_username} passwd={mysql_password} host={mysql_host} db={mysql_database} table=users usercolumn=email passwdcolumn=password crypt=1<br />
account sufficient pam_mysql.so user={mysql_username} passwd={mysql_password} host={mysql_host} db={mysql_database} table=users usercolumn=email passwdcolumn=password crypt=1<br />
</code></p>
<p>13. Config SASL for Postfix and specify MySql credentials (pico /etc/postfix/sasl/smtpd.conf)</p>
<p><code>pwcheck_method: saslauthd<br />
mech_list: plain login<br />
allow_plaintext: true<br />
auxprop_plugin: mysql<br />
sql_hostnames: {mysql_host}<br />
sql_user: {mysql_username}<br />
sql_passwd: {mysql_password}<br />
sql_database: {mysql_database}<br />
sql_select: select password from users where email = '%u'<br />
</code></p>
<p>14. Add the Postfix user to the SASL group allowing Postfix to communicate with SASL</p>
<p><code>adduser postfix sasl<br />
</code></p>
<p>15. Restart Postfix and SASL</p>
<p><code>/etc/init.d/postfix restart<br />
/etc/init.d/saslauthd restart<br />
</code></p>
<p>You're all done. Now you can connect to ports 25 and 465 to sent mails to your virtual users specified in the MySql database. When authenticating with your e-mail client, use the full e-mail address as the username.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-postfix-with-mysql-backend-and-tls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
