<?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>Linux Mail Server Setup and Howto Guide &#187; Postfix</title>
	<atom:link href="http://www.linuxmail.info/category/postfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxmail.info</link>
	<description>Rapidly deploy Linux based mail solutions today</description>
	<lastBuildDate>Sat, 26 Jun 2010 16:30:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Static DB Virtual Users in Postfix and Dovecot</title>
		<link>http://www.linuxmail.info/postfix-dovecot-static-db/</link>
		<comments>http://www.linuxmail.info/postfix-dovecot-static-db/#comments</comments>
		<pubDate>Sat, 29 May 2010 05:44:44 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Dovecot]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=385</guid>
		<description><![CDATA[This article describes how to use a text file or static db file as the source for user accounts in Postfix and Dovecot.]]></description>
			<content:encoded><![CDATA[<p>This article describes how to use a text file or static db file as the source for user accounts in Postfix and Dovecot. This is suitable for very simple mail account requirements. For larger implementations, check out the <a href="/multiple-domains-postfix-admin-centos-5/">MySQL virtual accounts</a> or <a href="/postfix-dovecot-ldap-centos-5/">Active Directory/LDAP virtual accounts</a>.</p>
<span id="more-385"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<h2>Create the Virtual Mail User Account</h2>
<div class="clearfix steps"><a href="/images/centos-5/create-user-vmail.png"><img class="preview" alt="Create user vmail" src="/images/centos-5/t-create-user-vmail.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Create a new user, we will call it <em>vmail.</em> Change the <em>Login Shell</em> to <em>/sbin/nologin</em>, this user account should not be used for logging in. <a href="/how-to-add-remove-user-accounts-centos-5/">Learn how to use the User Manager application here.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/user-manager-vmail.png"><img class="preview" alt="User Manager" src="/images/centos-5/t-user-manager-vmail.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Take note of the <em>User ID</em> and <em>Home Directory</em> of vmail.</div>
<div class="clearfix steps"><a href="/images/centos-5/user-manager-vmail-groups.png"><img class="preview" alt="User Manager" src="/images/centos-5/t-user-manager-vmail-groups.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Click the <em>Groups</em> tab and now note down the <em>Group ID</em>  of vmail. We&#8217;ll be needing all of them later.</div>
<h2>Configure Postfix for Virtual User Accounts</h2>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-virtual-2.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-virtual-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the postfix configuration file <em>/etc/postfix/main.cf</em> and edit the line below</div>
<pre class="steps">
mydestination = $myhostname, localhost.$mydomain, localhost
</pre>
<p>and add the lines below</p>
<pre class="steps">
virtual_mailbox_domains = $mydomain
virtual_mailbox_base = /home/vmail/
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_uid_maps = static:501
virtual_gid_maps = static:501
</pre>
<p><em>virtual_mailbox_base</em>, <em>virtual_uid_maps</em> and <em>virtual_gid_maps</em> should contain the home directory, user id and group id of vmail respectively.</p>
<div class="clearfix steps"><a href="/images/centos-5/edit-vmailbox.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-vmailbox.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Create the file <em>/etc/postfix/vmailbox</em> containing the mapping from an email address to a mailbox path relative to virtual_mailbox_base. See the example below.
<div class="m">
<pre class="steps">
johndoe@acme.local johndoe/Maildir/
janedoe@acme.local janedoe/Maildir/
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/postmap-vmailbox.png"><img class="preview" alt="postmap vmailbox" src="/images/centos-5/t-postmap-vmailbox.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">3. Type in the command below to generate the static db that will be used for the lookup.
<pre class="steps">
postmap /etc/postfix/vmailbox
</pre>
</div></div>
<div class="clearfix steps"><a href="/images/centos-5/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Restart the Postfix or MailScanner service if you have installed MailScanner. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/terminal.png"><img class="preview" alt="Terminal" src="/images/centos-5/t-terminal.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. Try sending an email. See <a href="/postfix-smtp-server-howto-centos-5/#test-postfix">Test Postfix using Telnet</a>. New mails should now be stored under the path specified in virtual_mailbox_base.</div>
<h2>Configure Dovecot Virtual User Accounts</h2>
<div class="clearfix steps"><a href="/images/centos-5/edit-dovecot-conf-virtual.png"><img class="preview" alt="Edit dovecot.conf" src="/images/centos-5/t-edit-dovecot-conf-virtual.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the file <em>/etc/dovecot.conf</em> and change the value of the following keys below
<div class="m">
<pre class="steps">
passdb static {
  args = /etc/dovecot-passdb
}

userdb static {
  args = uid=501 gid=501 home=/home/vmail/%u
}
</pre>
</div>
</div>
<p><em>uid</em>, <em>gid</em> and <em>home</em> should contain the user id, group id and home directory respectively of the vmail user account.</p>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />Make sure comment out all the other <em>passdb</em> and <em>userdb</em> sections to avoid any conflicts.</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-dovecot-passdb.png"><img class="preview" alt="Edit dovecot-passdb" src="/images/centos-5/t-edit-dovecot-passdb.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Create the file <em>/etc/dovecot-passdb</em> containing the password of a user name. See the example below.
<div class="m">
<pre class="steps">
johndoe:{PLAIN}secret
janedoe:{HMAC-MD5}dd59f669267e9bb13d42a1ba57c972c5b13a4b2ae457c9ada803dc7d8bae4ab
</pre>
</div>
</div>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />You can generate a hash password using the <tt>dovecotpw</tt> command.</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config-3.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-3.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Restart the dovecot service. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/terminal.png"><img class="preview" alt="Terminal" src="/images/centos-5/t-terminal.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. <a href="/install-setup-dovecot-centos-5/#test-dovecot">Test Dovecot using Telnet</a>. You should be able to read the recently sent mail which was stored in a new location.</div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/postfix-dovecot-static-db/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix Restrict Senders or Recipients</title>
		<link>http://www.linuxmail.info/postfix-restrict-sender-recipient/</link>
		<comments>http://www.linuxmail.info/postfix-restrict-sender-recipient/#comments</comments>
		<pubDate>Mon, 17 May 2010 12:52:16 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=383</guid>
		<description><![CDATA[This article describes how to configure Postfix to restrict mails from a sender, to a recipient, or both.]]></description>
			<content:encoded><![CDATA[<p>This article describes how to configure Postfix to restrict mails from a sender, to a recipient, or both.</p>
<span id="more-383"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<h2>Restrict Sender</h2>
<p>This section describes how to allow/reject a specific sender or a specific domain.</p>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-sender-restrict.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-sender-restrict.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">1. Edit the file <em>/etc/postfix/main.cf</em> and add the line below.
<pre class="steps">
smtpd_sender_restrictions = 
  check_sender_access hash:/etc/postfix/sender_access
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-sender-access.png"><img class="preview" alt="Edit sender_access" src="/images/centos-5/t-edit-sender-access.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">2. Create the file <em>/etc/postfix/sender_access</em> and review the example below.
<pre class="steps">
janedoe@acme.local  REJECT
bugsbunny@acme.com  OK
acme.com            REJECT
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/postmap-sender-access.png"><img class="preview" alt="Edit sender_access" src="/images/centos-5/t-postmap-sender-access.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">3. Type in the command below in a terminal window to create a hash file.
<pre class="steps">
postmap /etc/postfix/sender_access
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config.png"><img class="preview" alt="CentOS 5 Service Configuration" src="/images/centos-5/t-service-config.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Restart the Postfix or MailScanner service. <a href="/how-to-start-stop-services-centos-5/">Learn how to restart services.</a></div>
<h2>Restrict Recipient</h2>
<p>This section describes how to allow/reject a specific recipient or a specific domain.</p>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-recipient-restrict.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-recipient-restrict.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the file <em>/etc/postfix/main.cf</em> and add the line below.</div>
<pre class="steps">
smtpd_recipient_restrictions = 
  check_recipient_access hash:/etc/postfix/recipient_access,
  reject_unauth_destinations
</pre>
<div class="clearfix steps"><a href="/images/centos-5/edit-recipient-access.png"><img class="preview" alt="Edit recipient_access" src="/images/centos-5/t-edit-recipient-access.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">2. Create the file <em>/etc/postfix/recipient_access</em> and review the example below.
<pre class="steps">
janedoe@acme.local  REJECT
bugsbunny@acme.com  OK
acme.com            REJECT
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/postmap-recipient-access.png"><img class="preview" alt="postmap recipient_access" src="/images/centos-5/t-postmap-recipient-access.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">3. Type in the command below in a terminal window to create a hash file.
<pre class="steps">
postmap /etc/postfix/recipient_access
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config.png"><img class="preview" alt="CentOS 5 Service Configuration" src="/images/centos-5/t-service-config.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Restart the Postfix or MailScanner service. <a href="/how-to-start-stop-services-centos-5/">Learn how to restart services.</a></div>
<h2>Restrict Sender and Recipient</h2>
<p>This section describes how to restrict both the sender and recipient. Example usage of this is when you have a private domain which should not be allowed to send to the internet.</p> 
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-restriction-classes.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-restriction-classes.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the file <em>/etc/postfix/main.cf</em> and add the lines below.</div>
<pre class="steps">
smtpd_recipient_restrictions = 
  check_sender_access hash:/etc/postfix/sender_access,
  reject_unauth_destinations

smtpd_restriction_classes = local_only
local_only = check_recipient_access hash:/etc/postfix/local_domains, 
  reject
</pre>
<div class="clearfix steps"><a href="/images/centos-5/edit-sender-access-local-only.png"><img class="preview" alt="Edit sender_access" src="/images/centos-5/t-edit-sender-access-local-only.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">2. Create the file <em>/etc/postfix/sender_access</em> and review the example below.
<pre class="steps">
acme.local  local_only
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-local-domains.png"><img class="preview" alt="Edit local_domains" src="/images/centos-5/t-edit-local-domains.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">3. Create the file <em>/etc/postfix/local_domains</em> and review the example below.
<pre class="steps">
acme.local  OK
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/postmap-sender-access.png"><img class="preview" alt="Edit sender_access" src="/images/centos-5/t-postmap-sender-access.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">4. Type in the command belows in a terminal window to create the hash files.
<pre class="steps">
postmap /etc/postfix/sender_access
postmap /etc/postfix/local_domains
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config.png"><img class="preview" alt="CentOS 5 Service Configuration" src="/images/centos-5/t-service-config.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. Restart the Postfix or MailScanner service. <a href="/how-to-start-stop-services-centos-5/">Learn how to restart services.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/postfix-restrict-sender-recipient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a Disclaimer to Outgoing Postfix Emails</title>
		<link>http://www.linuxmail.info/postfix-disclaimer/</link>
		<comments>http://www.linuxmail.info/postfix-disclaimer/#comments</comments>
		<pubDate>Sun, 16 May 2010 10:55:14 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[MailScanner]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=382</guid>
		<description><![CDATA[This article describes how to use MailScanner to add a disclaimer message to outgoing mails in Postfix.]]></description>
			<content:encoded><![CDATA[<p>This article describes how to use MailScanner to add a disclaimer message to outgoing mails in Postfix. Make sure <a href="/mailscanner-postfix-clamav-spamassassin-howto-centos-5/">MailScanner is integrated into Postfix</a> and tested to be working.</p>
<span id="more-382"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<div class="clearfix steps"><a href="/images/centos-5/edit-inline-sig-txt.png"><img class="preview" alt="Inline Signature" src="/images/centos-5/t-edit-inline-sig-txt.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the file <em>/etc/MailScanner/reports/en/inline.sig.txt</em> and <em>/etc/MailScanner/reports/en/inline.sig.html</em> and replace it with your own message.</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-mailscanner-conf-sig.png"><img class="preview" alt="MailScanner Config" src="/images/centos-5/t-edit-mailscanner-conf-sig.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Edit the file <em>/etc/MailScanner/MailScanner.conf</em> and update the line below.</div>
<pre class="steps">
Sign Clean Messages = /etc/MailScanner/rules/signing.rules
</pre>
<div class="clearfix steps"><a href="/images/centos-5/edit-signing-rules.png"><img class="preview" alt="signing.rules" src="/images/centos-5/t-edit-signing-rules.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">3. Create the file <em>/etc/MailScanner/rules/signing.rules</em> and add the lines below.
<pre class="steps">
From:      *@acme.local  yes
FromOrTo:  default       no
</pre>
</div>
Replace <strong>acme.local</strong> with your own domain name.
</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config.png"><img class="preview" alt="CentOS 5 Service Configuration" src="/images/centos-5/t-service-config.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Restart the MailScanner service. <a href="/how-to-start-stop-services-centos-5/">Learn how to restart services.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/sm-message-sig.png"><img class="preview" alt="SquirrelMail Message" src="/images/centos-5/t-sm-message-sig.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. You should now see your disclaimer message on outbound emails.</div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/postfix-disclaimer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup Postfix Mailbox</title>
		<link>http://www.linuxmail.info/backup-postfix-mailbox/</link>
		<comments>http://www.linuxmail.info/backup-postfix-mailbox/#comments</comments>
		<pubDate>Sun, 09 May 2010 12:36:48 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Dovecot]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=381</guid>
		<description><![CDATA[This article describes how to backup and restore your Postfix mailboxes using the tar command.]]></description>
			<content:encoded><![CDATA[<p>Backing up your mailboxes is a simple as copying your mailbox folder. This article describes how to backup and restore your Postfix mailboxes using the tar command.</p>
<span id="more-381"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<div class="clearfix steps"><a href="/images/centos-5/postfix-backup-mailbox.png"><img class="preview" alt="Backup mailbox" src="/images/centos-5/t-postfix-backup-mailbox.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">To backup the mailbox, type the command below in a terminal window.
<pre class="steps">
tar cvzf mailbox-`date +%F_%H%M`.tar.gz /home/vmail
</pre>
</div>
<p>Replace <strong>/home/vmail</strong> with the location of your own mailbox.</p>
</div>
<div class="clearfix steps"><a href="/images/centos-5/postfix-restore-mailbox.png"><img class="preview" alt="Restore mailbox" src="/images/centos-5/t-postfix-restore-mailbox.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">To restore the mailbox, type the command below in a terminal window.
<pre class="steps">
tar xvzf mailbox.tar.gz -C /
</pre>
</div>
<p>Replace <strong>mailbox.tar.gz</strong> with the name of your backup file.</p>
</div>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />Ideally, the Postfix and Dovecot configurations should be documented, or better yet, maintained using a change configuration process. But you can also use the procedure above to backup the <em>/etc</em> directory although it is not recommended since you may restore your configuration on an updated OS.</div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/backup-postfix-mailbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix SMTP Gateway</title>
		<link>http://www.linuxmail.info/postfix-smtp-gateway/</link>
		<comments>http://www.linuxmail.info/postfix-smtp-gateway/#comments</comments>
		<pubDate>Sun, 02 May 2010 23:12:21 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=380</guid>
		<description><![CDATA[This article describes how to configure Postfix as an SMTP gateway.]]></description>
			<content:encoded><![CDATA[<p>To improve security or offload services like virus and spam checking, you may want to implement an SMTP gateway. This article describes how to configure Postfix as an SMTP gateway.</p>
<span id="more-380"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<img src="/images/smtp-gateway.png" alt="SMTP Gateway" style="width: 480px; height: 180px; margin: auto; display: block" />
<h2>DMZ Mail Server</h2>
<p>The DMZ mail server forwards the inbound mail to the internal mail server and delivers the outbound mail.</p>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-relay.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-relay.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">1. Edit <em>/etc/postfix/main.cf</em> and update the lines below.
<pre class="steps">
mydestination = 
local_recipient_maps = 
local_transport = error:local mail delivery is disabled

mynetworks = 127.0.0.0/8 192.168.1.3
relay_domains = example.com
transport_maps = hash:/etc/postfix/transport
smtpd_recipient_restrictions = permit_mynetworks
    reject_unauth_destination
</pre>
</div>
<p>The first three lines above disables local delivery. Replace <em>192.168.1.3</em> with the IP address of your internal mail server.</p>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-transport-relay.png"><img class="preview" alt="Edit transport" src="/images/centos-5/t-edit-transport-relay.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">2. Edit the file <em>/etc/postfix/transport</em> and add the line below.
<pre class="steps">
example.com :[192.168.1.3]
</pre>
<p>Replace <em>192.168.1.3</em> with the hostname or IP address of your internal mail server.</p>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/postmap-transport-relay.png"><img class="preview" alt="postmap transport" src="/images/centos-5/t-postmap-transport-relay.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Type the line command below to create a transport database file.
<pre class="steps">
postmap /etc/postfix/transport
</pre>
</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Restart the Postfix or MailScanner service if you have installed it. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/terminal.png"><img class="preview" alt="Terminal" src="/images/centos-5/t-terminal.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. You should now be able to send mails to your DMZ mail server and those mails will be automatically relayed to your internal mail server. See <a href="/postfix-smtp-server-howto-centos-5/#test-postfix">Test Postfix using Telnet</a>.</div>
<h2>Internal Mail Server</h2>
<p>The internal mail server holds the mailbox and forward all outbound mail to the DMZ mail server for delivery. Make sure you have <a href="/#basic">working Postfix mail server</a>.</p>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-relay.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-relay.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">1. Edit <em>/etc/postfix/main.cf</em> and update the lines below.
<pre class="steps">
transport_maps = hash:/etc/postfix/transport
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-transport-gateway.png"><img class="preview" alt="Edit transport" src="/images/centos-5/t-edit-transport-gateway.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">2. Edit the file <em>/etc/postfix/transport</em> and add the lines below.
<pre class="steps">
example.com    :
.example.com   :
*              smtp:[192.168.3.2]
</pre>
<p>Replace <em>192.168.3.2</em> with the hostname or IP address of your DMZ mail server.</p>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/postmap-transport-relay.png"><img class="preview" alt="postmap transport" src="/images/centos-5/t-postmap-transport-relay.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Type the line command below to create a transport database file.
<pre class="steps">
postmap /etc/postfix/transport
</pre>
</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Restart the Postfix or MailScanner service if you have installed it. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/terminal.png"><img class="preview" alt="Terminal" src="/images/centos-5/t-terminal.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. Your outbound mail should now be sent the DMZ mail server. See <a href="/postfix-smtp-server-howto-centos-5/#test-postfix">Test Postfix using Telnet</a>.</div>
<h2>SMTP Gateway Notes</h2>
<p>It is easy to setup an SMTP gateway mail server but you also need to consider the items below.</p>
<ul>
<li><p><strong>Add Antivirus and Antispam Filtering.</strong> Since the DMZ mail server is exposed on the internet, make sure it has <a href="/#antivirus">anti-virus and anti-spam filtering</a>.</p></li>
<li><p><strong>Verify Recipient.</strong> If possible, you also need to apply the same recipient verification method you used in your internal mail server. This will allow your DMZ mail server to reject all invalid recipient address instead of having the internal mail server bounce the relayed emails with invalid recipients. Use the <em>relay_recipient_maps</em> setting in <em>/etc/postfix/main.cf</em> to specify the valid recipients.</p></li>
<li><p><strong>Use IP Address.</strong> By specifying the hostname or IP address in the transport file, the DNS MX lookup can be eliminated. Specifying the IP address will be even better since this will eliminate the need for any DNS lookup.</p></li>
<li><p><strong>Flush Mail Queue.</strong> You can force Postfix to immediately send all the mail in its queue by typing in the command below.</p>
<pre class="steps">
postfix flush
</pre>
</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/postfix-smtp-gateway/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prevent Sender From Spoofing Email Address</title>
		<link>http://www.linuxmail.info/prevent-sender-spoofing-email-address/</link>
		<comments>http://www.linuxmail.info/prevent-sender-spoofing-email-address/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 15:22:59 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=379</guid>
		<description><![CDATA[This article describes how to configure the sender restriction in Postfix to prevent senders from spoofing email addresses.]]></description>
			<content:encoded><![CDATA[<p>Postfix can be configured to prevent email senders from using an email address that does not belong to them. This article describes how to configure the sender restriction in Postfix to prevent senders from spoofing email addresses.</p>
<span id="more-379"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<div class="clearfix steps"><a href="/images/centos-5/telnet-smtp-sasl.png"><img class="preview" alt="Configure SASL" src="/images/centos-5/t-telnet-smtp-sasl.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. <a href="/postfix-smtp-auth-dovecot-sasl/">Make sure SMTP authentication in Postfix is working.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/edit-sender-login-pcre.png"><img class="preview" alt="Edit sender-login.pcre" src="/images/centos-5/t-edit-sender-login-pcre.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">2. Create a Postfix map file which returns a user name given an email address. The line below is a regular expression that returns the user part from an email address. Example, <em>bugsbunny@acme.local</em> returns <em>bugsbunny</em> as the user name. If this works for you, then save it into the file <em>/etc/postfix/sender_login.pcre</em>
<pre class="steps">
/(.*)@.*/ $1
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-spoofing.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-spoofing.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Edit the file <em>/etc/postfix/main.cf</em> and add the lines below.</div>
<pre class="steps">
smtpd_sender_login_maps = pcre:/etc/postfix/sender_login.pcre
smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch
</pre>
<p>If you have a different map file, specify it in the <strong>smtpd_sender_login_maps</strong> line.</p>
<div class="clearfix steps"><a href="/images/centos-5/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Restart the Postfix or MailScanner service if you have installed it. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>
<div class="clearfix steps"><a href="/images/windows-xp/oe-sender-address-rejected.png"><img class="preview" alt="Terminal" src="/images/windows-xp/t-oe-sender-address-rejected.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. Try sending an email using an address that does not belong to you, Postfix should reject your attempt.</div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/prevent-sender-spoofing-email-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix and Dovecot SSL/TLS</title>
		<link>http://www.linuxmail.info/postfix-dovecot-ssl/</link>
		<comments>http://www.linuxmail.info/postfix-dovecot-ssl/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 17:01:32 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Dovecot]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[SSL/TLS]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=378</guid>
		<description><![CDATA[This article describes how to configure Postfix and Dovecot to use SSL/TLS to encrypt communication.]]></description>
			<content:encoded><![CDATA[<p>This article describes how to configure Postfix and Dovecot to use SSL/TLS to encrypt communication. Before you begin, <a href="/generate-ssl-certificate/">generate an SSL certificate</a>.</p>
<span id="more-378"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<h2>Postfix</h2>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-tls.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-tls.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the file <em>/etc/postfix/main.cf</em> and add the lines below.</div>
<pre class="steps">
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_cert_file = /etc/pki/tls/certs/mail.acme.local.cert
smtpd_tls_key_file = /etc/pki/tls/private/mail.acme.local.key
tls_random_source = dev:/dev/urandom
</pre>
<p>Make sure <strong>smtpd_tls_cert_file</strong> and <strong>smtpd_tls_key_file</strong> refers to your own certificate and key file respectively.</p>
<div class="clearfix steps"><a href="/images/centos-5/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Restart the Postfix or MailScanner service if you have installed it. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/terminal.png"><img class="preview" alt="Terminal" src="/images/centos-5/t-terminal.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. <a href="/postfix-smtp-server-howto-centos-5/#test-postfix">Test Postfix using Telnet</a> and check if <tt>250-STARTTLS</tt> is present after the <tt>ehlo host</tt> command.</div>
<h2>Dovecot</h2>
<div class="clearfix steps"><a href="/images/centos-5/edit-dovecot-conf-tls.png"><img class="preview" alt="Edit dovecot.conf" src="/images/centos-5/t-edit-dovecot-conf-tls.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the file <em>/etc/dovecot.conf</em> and add the lines below.</div>
<pre class="steps">
ssl_cert_file = /etc/pki/tls/certs/mail.acme.local.cert
ssl_key_file = /etc/pki/tls/private/mail.acme.local.key
</pre>
<p>Make sure <strong>ssl_cert_file</strong> and <strong>ssl_key_file</strong> refers to your own certificate and key file respectively.</p>
<div class="clearfix steps"><a href="/images/centos-5/service-config-3.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-3.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Restart the dovecot service. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/postfix-dovecot-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure Postfix to Accept All Mails</title>
		<link>http://www.linuxmail.info/configure-postfix-accept-all-mails/</link>
		<comments>http://www.linuxmail.info/configure-postfix-accept-all-mails/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 23:23:45 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=375</guid>
		<description><![CDATA[This article describes how to configure Postfix to accept all emails without doing any recipient checking.]]></description>
			<content:encoded><![CDATA[<p>This article describes how to configure Postfix to blindly accept all emails, meaning receive email without checking the recipient. This setup is useful as a <a href="/backup-mail-postfix/">backup or archive mail destination.</a></p>
<span id="more-375"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<h2>Create the Virtual Mail User Account</h2>
<div class="clearfix steps"><a href="/images/centos-5/create-user-vmail.png"><img class="preview" alt="Create user vmail" src="/images/centos-5/t-create-user-vmail.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Create a new user, we will call it <em>vmail.</em> Change the <em>Login Shell</em> to <em>/sbin/nologin</em>, this user account should not be used for logging in. <a href="/how-to-add-remove-user-accounts-centos-5/">Learn how to use the User Manager application here.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/user-manager-vmail.png"><img class="preview" alt="User Manager" src="/images/centos-5/t-user-manager-vmail.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Take note of the <em>User ID</em> and <em>Home Directory</em> of vmail.</div>
<div class="clearfix steps"><a href="/images/centos-5/user-manager-vmail-groups.png"><img class="preview" alt="User Manager" src="/images/centos-5/t-user-manager-vmail-groups.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Click the <em>Groups</em> tab and now note down the <em>Group ID</em>  of vmail. We&#8217;ll be needing all of them later.</div>
<h2>Configuring Postfix and Dovecot</h2>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-dovecot-transport.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-edit-main-cf-dovecot-transport.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the file <em>/etc/postfix/main.cf</em> and add the lines below.
<pre class="steps">
virtual_transport = dovecot
virtual_mailbox_domains = $mydomain
</pre>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-dovecot-transport.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-edit-main-cf-dovecot-transport.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Edit the file <em>/etc/dovecot.conf</em> and add the lines below.</div>
<pre class="steps">
userdb static {
  args = uid=501 gid=501 home=/home/vmail/%u allow_all_users=yes
}

socket listen {
  master {
    path = /var/run/dovecot/auth-master
    mode = 0600
    user = vmail
    group = vmail
  }
}
</pre>
<p><em>uid</em>, <em>gid</em> and <em>home</em> should contain the user id, group id and home directory respectively of the vmail user account.</p>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />Comment out all the other <em>passdb</em> and <em>userdb</em> sections except for those specified above to ensure that nothing will conflict with our virtual accounts setting.</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Restart the Postfix or MailScanner service if you have installed it. Do the same for Dovecot. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />If you encounter any problems, check the log file at <em>/var/log/maillog.</em></div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/configure-postfix-accept-all-mails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup Incoming Mail in Postfix</title>
		<link>http://www.linuxmail.info/backup-mail-postfix/</link>
		<comments>http://www.linuxmail.info/backup-mail-postfix/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 03:59:27 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=373</guid>
		<description><![CDATA[This article will show you how to copy incoming mail to another mail server using the blind carbon copy (BCC) feature in Postfix. This capability is useful for backup, archive or disaster recovery purposes. 1. Edit the file /etc/postfix/main.cf and add the lines below. recipient_bcc_maps = pcre:/etc/postfix/backup_bcc.pcre transport_maps = hash:/etc/postfix/transport smtp_generic_maps = pcre:/etc/postfix/generic.pcre 2. Create [...]]]></description>
			<content:encoded><![CDATA[<p>This article will show you how to copy incoming mail to another mail server using the blind carbon copy (BCC) feature in Postfix. This capability is useful for backup, archive or disaster recovery purposes.</p>
<span id="more-373"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-backup.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-backup.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the file <em>/etc/postfix/main.cf</em> and add the lines below.
<pre class="steps">
recipient_bcc_maps = pcre:/etc/postfix/backup_bcc.pcre
transport_maps = hash:/etc/postfix/transport
smtp_generic_maps = pcre:/etc/postfix/generic.pcre
</pre>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-backup-bcc-pcre.png"><img class="preview" alt="Edit backup-bcc.pcre" src="/images/centos-5/t-edit-backup-bcc-pcre.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">2. Create the file <em>/etc/postfix/backup_bcc.pcre</em> containing 
<pre class="steps">
/^(.*)@acme\.local$/ $1@backup.invalid
</pre>
<p>which tells Postfix to BCC emails to the domain <em>backup.invalid</em>.</p>
<table>
<tr><th>Email for</th><th>BCC to</th></tr>
<tr><td>johndoe@acme.local</td><td>johndoe@backup.invalid</td></tr>
<tr><td>janedoe@acme.local</td><td>janedoe@backup.invalid</td></tr>
</table>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-transport-backup.png"><img class="preview" alt="Edit transport" src="/images/centos-5/t-edit-transport-backup.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">3. Edit the file <em>/etc/postfix/transport</em> and add the line below.
<pre class="steps">
backup.invalid smtp:[192.168.1.4]
</pre>
<p>Replace the IP address with the IP address of your backup mail server.</p>
<p>Next, type in the command below to convert it to a database file.</p>
<pre class="steps">
postmap /etc/postfix/transport
</pre>
<p>This tells Postfix to send all emails for the domain <em>backup.invalid</em> to the specified mail server.</p>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-generic-pcre.png"><img class="preview" alt="Edit generic.pcre" src="/images/centos-5/t-edit-generic-pcre.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">4. Create the file <em>/etc/postfix/generic.pcre</em> containing 
<pre class="steps">
/^(.*)@backup\.invalid$/ $1@acme.local
</pre>
<p>which tells Postfix to change the email address back to the original recipient before sending it out.</p>
<table>
<tr><th>BCC to</th><th>Email for</th></tr>
<tr><td>johndoe@backup.invalid</td><td>johndoe@acme.local</td></tr>
<tr><td>janedoe@backup.invalid</td><td>janedoe@acme.local</td></tr>
</table>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. Restart the Postfix or MailScanner service if you have installed it. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />The destination <a href="/configure-postfix-accept-all-mails/">Postfix server can be configured to accept emails without validating the recipient.</a></div>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />If you encounter any problems, check the log file at <em>/var/log/maillog.</em></div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/backup-mail-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix Backup MX</title>
		<link>http://www.linuxmail.info/postfix-backup-mx/</link>
		<comments>http://www.linuxmail.info/postfix-backup-mx/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 15:42:49 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=371</guid>
		<description><![CDATA[This article describes how to configure Postfix to act as a backup MX server.]]></description>
			<content:encoded><![CDATA[<p>Postfix can be configured to act as a backup mail server. A backup MX server accepts mail if the primary mail server goes down and will forward all mails in its queue if the primary mail server goes back online.</p>
<span id="more-371"></span>
<div class="post-info-spacing"><script type="text/javascript">google_ad_client="pub-3384844279561399";google_ad_slot="5340126843";google_ad_width=336;google_ad_height=280;</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>

<img src="/images/backup-mx.png" alt="Backup MX" style="width: 450px; height: 320px; margin: auto; display: block" />
<p>This article describes how to configure Postfix to act as a backup MX server.</p>
<h2>Configuring Postfix</h2>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-relay.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-relay.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">1. Edit the file <em>/etc/postfix/main.cf</em> and update the lines below.
<pre class="steps">
mynetworks = 127.0.0.0/8
relay_domains = example.com
smtpd_recipient_restrictions = permit_mynetworks, 
    reject_unauth_destination
transport_maps = hash:/etc/postfix/transport
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-transport-relay.png"><img class="preview" alt="Edit transport" src="/images/centos-5/t-edit-transport-relay.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">2. Edit the file <em>/etc/postfix/transport</em> and add the line below.
<pre class="steps">
example.com :[192.168.1.3]
</pre>
<p>Replace <em>192.168.1.3</em> with the hostname or IP address of your primary mail server.</p>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/postmap-transport-relay.png"><img class="preview" alt="postmap transport" src="/images/centos-5/t-postmap-transport-relay.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Type the line command below to create a transport database file.
<pre class="steps">
postmap /etc/postfix/transport
</pre>
</div>
<div class="clearfix steps"><a href="/images/centos-5/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-5/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Restart the Postfix or MailScanner service if you have installed it. <a href="/how-to-start-stop-services-centos-5/">Learn how to start and stop services here.</a></div>
<div class="clearfix steps"><a href="/images/centos-5/terminal.png"><img class="preview" alt="Terminal" src="/images/centos-5/t-terminal.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. You should now be able to send mails to your backup mail server and those mails will be automatically forwarded to your primary mail server. See <a href="/postfix-smtp-server-howto-centos-5/#test-postfix">Test Postfix using Telnet</a>.</div>
<h2>Backup MX Notes</h2>
<p>It is easy to setup a backup mail server but you also need to consider the items below.</p>
<ul>
<li><p><strong>Add DNS MX Record.</strong> In order for your backup mail server to be identified over the internet, you need to add a lower priority DNS MX record. A higher number means lower priority.</p>
<table style="width: 100%; text-align: center; margin-bottom: 1em">
<tr style="background-color: #dbe6ea"><th>Domain</th><th>TTL</th><th>Priority</th><th>Mail Server Name</th></tr>
<tr><td>acme.local</td><td>86400</td><td>10</td><td>mail.acme.local</td></tr>
<tr><td>acme.local</td><td>86400</td><td>20</td><td>mail2.acme.local</td></tr>
</table>
</li>
<li><p><strong>Add Antivirus and Antispam Filtering.</strong> Make sure to have the same or better <a href="/mail-server-setup-centos-5/#antivirus">virus and spam protection</a> in your backup mail server as you have in your primary mail server. Otherwise, viruses and spams will be entering your inbox through the backdoor.</p></li>
<li><p><strong>Verify Recipient.</strong> If possible, you also need to apply the same recipient verification method you used in your primary mail server. This will allow your backup mail server to reject all invalid recipient address instead of having the primary mail server bounce the forwarded emails with invalid recipients. Use the <em>relay_recipient_maps</em> setting in <em>/etc/postfix/main.cf</em> to specify the valid recipients.</p></li>
<li><p><strong>Relay Only.</strong> In your <em>/etc/postfix/main.cf</em>, make sure the relay domain is not found in <em>mydestination</em>, <em>virtual_alias_domains</em> and <em>virtual_mailbox_domains</em>. Otherwise, the backup mail server will not forward emails to the primary mail server and will instead store it into its own mailbox.</p></li>
<li><p><strong>Use IP Address.</strong> By specifying the hostname or IP address in the transport file, the DNS MX lookup can be eliminated. Specifying the IP address will be even better since this will eliminate the need for any DNS lookup. It will also avoid relay loopback problems if you are using port forwarding in your backup mail server.</p></li>
<li><p><strong>Flush Mail Queue.</strong> You can force Postfix to immediately send all the mail in its queue by typing in the command below. This useful after bringing the primary mail server back online to eliminate the waiting period for the backup mail server to resend mails in its queue.</p>
<pre class="steps">
postfix flush
</pre>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/postfix-backup-mx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
