<?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>Tue, 01 Nov 2011 00:43:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>MailScanner, Postfix, ClamAV and SpamAssassin Setup Howto for Ubuntu 10.04</title>
		<link>http://www.linuxmail.info/mailscanner-postfix-clamav-spamassassin-howto-ubuntu-10-04/</link>
		<comments>http://www.linuxmail.info/mailscanner-postfix-clamav-spamassassin-howto-ubuntu-10-04/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 20:59:11 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Anti-spam/Anti-virus]]></category>
		<category><![CDATA[MailScanner]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Ubuntu 10.04]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=429</guid>
		<description><![CDATA[How to setup MailScanner, Postfix, ClamAV and SpamAssassin in Ubuntu 10.04]]></description>
			<content:encoded><![CDATA[<p>This page will guide you in configuring MailScanner, ClamAV and SpamAssassin to work in Postfix. Before proceeding, make sure <a href="/postfix-smtp-server-howto-ubuntu-10-04/">Postfix is installed and working.</a></p>
<span id="more-429"></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>Configuring MailScanner</h2>
<div class="clearfix steps"><a href="/images/ubuntu-10-04/apt-get-mailscanner.png"><img class="preview" alt="Install MailScanner" src="/images/ubuntu-10-04/t-apt-get-mailscanner.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Install MailScanner using the command below.
<pre class="steps">
sudo apt-get install mailscanner
</pre>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-virus-scanners-conf.png"><img class="preview" alt="MailScanner Virus Config" src="/images/centos-5/t-edit-virus-scanners-conf.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Edit the file <em>/etc/MailScanner/virus.scanners.conf</em> and change the path of <em>clamav</em> to <em>/usr</em>.</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-mailscanner-conf.png"><img class="preview" alt="MailScanner Config" src="/images/centos-5/t-edit-mailscanner-conf.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Edit the file <em>/etc/MailScanner/MailScanner.conf</em> and update the lines below.</div>
<pre class="steps">
%org-name% = <em>your organization name</em>
%org-long-name% = <em>your full organization name</em>
%web-site% = <em>your mail support website or company website</em>
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
Incoming Work Group = clamav
Incoming Work Permissions = 0640
MTA = postfix
Virus Scanners = clamd
Use SpamAssassin = yes
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin
</pre>
<div class="clearfix steps"><a href="/images/ubuntu-10-04/edit-mailscanner.png"><img class="preview" alt="Edit mailscanner" src="/images/ubuntu-10-04/t-edit-mailscanner.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Edit the file <em>/etc/default/mailScanner</em> and update the line below
<pre class="steps">
run_mailscanner=1
</pre>
</div>
<div class="clearfix steps"><a href="/images/ubuntu-10-04/edit-sbin-mailscanner.png"><img class="preview" alt="Edit mailscanner" src="/images/ubuntu-10-04/t-edit-sbin-mailscanner.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. Edit the file <em>/usr/sbin/mailscanner</em> and add a <em>-U</em> parameter on the first line.</div>
<h2>Integrating MailScanner into Postfix</h2>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-2.png"><img class="preview" alt="Postfix Configuration" src="/images/centos-5/t-edit-main-cf-2.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 
<pre class="steps">
header_checks = regexp:/etc/postfix/header_checks
</pre>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-header-checks.png"><img class="preview" alt="Header Checks" src="/images/centos-5/t-edit-header-checks.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Create the file <em>/etc/postfix/header_checks</em> and add the line below 
<pre class="steps">
/^Received:/ HOLD
</pre>
This will now place all incoming mail into the holding area until released by MailScanner.
</div>
<div class="clearfix steps"><a href="/images/ubuntu-10-04/mailscanner-start.png"><img class="preview" alt="start MailScanner" src="/images/ubuntu-10-04/t-mailscanner-start.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div class="m">3. Use the commands below to start MailScanner.
<pre class="steps">
sudo service postfix restart
sudo service clamav-daemon start
sudo service mailscanner start
</pre>
</div>
</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. Test if Postfix is still working. See <a href="/postfix-smtp-server-howto-ubuntu-10-04/#test-postfix">Test Postfix using Telnet.</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/mail.log.</em></div>
<h2>Congratulations</h2>
<p>Congratulations, your mails are now checked for spam and viruses. Each mail you send or receive will now contain the lines below to indicate that MailScanner is doing its job.</p>
<pre class="steps">
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
</pre>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />The English language message templates used in MailScanner is stored in <em>/etc/MailScanner/reports/en</em> and can even be <a href="/postfix-disclaimer/">configured to add a disclaimer message to outgoing mails.</a></div>
<div style="clear: both">&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/mailscanner-postfix-clamav-spamassassin-howto-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix SMTP Server Setup Howto for Ubuntu 10.04</title>
		<link>http://www.linuxmail.info/postfix-smtp-server-howto-ubuntu-10-04/</link>
		<comments>http://www.linuxmail.info/postfix-smtp-server-howto-ubuntu-10-04/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 21:45:19 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Ubuntu 10.04]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=425</guid>
		<description><![CDATA[How to install Postfix SMTP Server in Ubuntu 10.04 LTS]]></description>
			<content:encoded><![CDATA[<p>Installing and setting up Postfix SMTP Server in Ubuntu 10.04 is easy. Postfix by default uses the <a href="/mbox-maildir-mail-storage-formats/">mbox mail format so we&#8217;ll just change it to maildir</a>.</p>
<span id="more-425"></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>Configure Postfix</h2>
<div class="clearfix steps"><a href="/images/ubuntu-10-04/edit-main-cf.png"><img class="preview" alt="Edit main.cf" src="/images/ubuntu-10-04/t-edit-main-cf.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> using the command
<pre class="steps">
sudo vi /etc/postfix/main.cf
</pre>
and add the line below
<pre class="steps">
home_mailbox = Maildir/
</pre>
</div>
<p>In main.cf, lines starting with <tt>#</tt> are comments. Save the file after completing your changes.</p>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />Make sure that the <tt>mail_spool_directory</tt> and <tt>mailbox_command</tt> lines are commented out. Otherwise, it will override the setting in the <tt>home_mailbox</tt> line.</div>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />If you are not familiar with <em>vi</em>, check out this quick <a href="/vi-editor-tutorial/">vi tutorial</a>.</div>
</div>
<div class="clearfix steps"><a href="/images/ubuntu-10-04/service-postfix-restart.png"><img class="preview" alt="Service Configuration" src="/images/ubuntu-10-04/t-service-postfix-restart.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Restart postfix using the command
<pre class="steps">
sudo service postfix restart
</pre>
</div>
<h2 id="test-postfix">Test Postfix</h2>
<p>Here is a sample postfix session. Replace <strong>johndoe</strong> with any valid user account. The dot after the line <strong>test</strong> is a command that should be typed in.</p>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />If you need to add new user accounts, <a href="/how-to-add-remove-user-accounts-centos-5/#console">learn how to add or remove user accounts here.</a></div>
<div class="clearfix">
<pre class="steps">
johndoe@mail:~$ <span class="h">telnet localhost smtp</span>
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail ESMTP Postfix (Ubuntu)
<span class="h">ehlo localhost</span>
250-mail
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
<span class="h">mail from:&lt;johndoe&gt;</span>
250 2.1.0 Ok
<span class="h">rcpt to:&lt;johndoe&gt;</span>
250 2.1.5 Ok
<span class="h">data</span>
354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;
<span class="h">test</span>
<span class="h">.</span>
250 2.0.0 Ok: queued as 9729067C17
<span class="h">quit</span>
221 2.0.0 Bye
Connection closed by foreign host.
johndoe@mail:~$
</pre>
<p>&nbsp;</p>
<p>To check if the mail indeed exists</p>
<pre class="steps">
johndoe@mail:~$ <span class="h">cd /home/johndoe/Maildir/new</span>
johndoe@mail:~/Maildir/new$ <span class="h">ls</span>
1185669817.Vfd00I18012M795756.mail
johndoe@mail:~/Maildir/new$ <span class="h">cat 1185669817.Vfd00I18012M795756.mail</span>
</pre>
<p>Don&#8217;t worry, you don&#8217;t have to type in the whole filename above. Just type in the first few characters say <tt>118</tt> then press Tab to activate automatic completion.</p>
<pre class="steps">
From johndoe@mail.acme.local  Thu Feb 22 21:48:28 2007
Return-Path: &lt;johndoe@mail.acme.local&gt;
X-Original-To: johndoe
Delivered-To: johndoe@mail.acme.local
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
        by mail.acme.local (Postfix) with SMTP id 9729067C17
        for &lt;johndoe&gt;; Thu, 22 Feb 2007 21:48:26 -0500 (EST)
Message-Id: &lt;20070222134827.9729067C17@mail.acme.local&gt;
Date: Thu, 22 Feb 2007 21:48:26 -0500 (EST)
From: johndoe@mail.acme.local
To: undisclosed-recipients:;

test

johndoe@mail:~/Maildir/new$
</pre>
</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/mail.log.</em></div>
<div style="clear: both">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/postfix-smtp-server-howto-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix SMTP Authentication and Dovecot SASL for RHEL/CentOS 6</title>
		<link>http://www.linuxmail.info/postfix-smtp-auth-dovecot-sasl-centos-6/</link>
		<comments>http://www.linuxmail.info/postfix-smtp-auth-dovecot-sasl-centos-6/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 12:28:15 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[CentOS 6]]></category>
		<category><![CDATA[Dovecot]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Red Hat Enterprise Linux 6]]></category>
		<category><![CDATA[SASL]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=406</guid>
		<description><![CDATA[How to enable Postfix SMTP Authentication using Dovecot SASL in Red Hat Enterprise Linux 6 or CentOS 6]]></description>
			<content:encoded><![CDATA[<p><strong>SMTP Authentication (SMTP Auth)</strong> provides an access control mechanism that can be used to allow legitimate users to relay mail while denying relay service to unauthorized users, such as spammers.</p>
<span id="more-406"></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>Configure Postfix and Dovecot</h2>
<div class="clearfix steps"><a href="/images/centos-6/edit-dovecot-master-conf.png"><img class="preview" alt="Edit dovecot 10-master.conf" src="/images/centos-6/t-edit-dovecot-master-conf.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div>1. Edit the file <em>/etc/dovecot/conf.d/10-master.conf</em> and make sure your <em>service auth</em> section has the lines below.</div>
<div class="m">
<pre class="steps">
service auth {	
  unix_listener /var/spool/postfix/private/auth {
	mode = 0666
	user = postfix
	group = postfix
  }	
}
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-6/edit-dovecot-auth-conf.png"><img class="preview" alt="Edit dovecot 10-auth.conf" src="/images/centos-6/t-edit-dovecot-auth-conf.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a><div>2. Edit the file <em>/etc/dovecot/conf.d/10-auth.conf</em> and update the line below.</div>
<div class="m">
<pre class="steps">
auth_mechanisms = plain login
</pre>
</div>
</div>
<div class="clearfix steps"><a href="/images/centos-5/edit-main-cf-dovecot-sasl.png"><img class="preview" alt="Edit main.cf" src="/images/centos-5/t-edit-main-cf-dovecot-sasl.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>3. Edit <em>/etc/postfix/main.cf</em>, find the keys below and change its values as follows or add it at the bottom of the file if the key (the word before the = sign) cannot be found.
<pre class="steps">
mynetworks = 127.0.0.0/8
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions =  permit_mynetworks, 
    permit_sasl_authenticated, 
    reject_unauth_destination
broken_sasl_auth_clients = yes
</pre>
</div>
<div>The first line says trust only localhost, meaning only localhost can send email outside the network (relay). The last line is there to support old clients like Microsoft Outlook Express 4.0 and Microsoft Exchange 5.0 just in case someone is still using it.</div>
<div>&nbsp;</div>
<div>Lines starting with <tt>#</tt> are comments. Save the file after completing your changes.</div>
<div>&nbsp;</div>
<div class="clearfix steps"><a href="/images/centos-6/terminal-semodule-postfixdovecotsasl.png"><img class="preview" alt="Install postfixdovecotsasl.te" src="/images/centos-6/t-terminal-semodule-postfixdovecotsasl.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>4. Configure SELinux using the commands below. Here&#8217;s the content of <a href="/files/rhel6/postfixdovecotsasl.te">postfixdovecotsasl.te</a></div>
<div class="clearfix steps">
<pre class="steps">
wget linuxmail.info/files/rhel6/postfixdovecotsasl.te
checkmodule -M -m -o postfixdovecotsasl.mod postfixdovecotsasl.te
semodule_package -o postfixdovecotsasl.pp -m postfixdovecotsasl.mod
semodule -i postfixdovecotsasl.pp
</pre>
</div>
<div class="clearfix steps"><a href="/images/centos-6/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-6/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>5. Restart the Dovecot and Postfix service. But if you installed MailScanner, restart MailScanner instead of Postfix. <a href="/how-to-start-stop-services-centos-6/">Learn how to restart services here.</a></div>
<h2 id="test-postfix">Test Postfix</h2>
<div class="clearfix steps"><a href="/images/centos-5/telnet-smtp-sasl.png"><img class="preview" alt="Terminal" src="/images/centos-5/t-telnet-smtp-sasl.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>In a <strong>Terminal</strong> window, type in the highlighted commands below.</div>
<p>Sample postfix session</p>
<pre class="steps">
[root@mail ~]# <span class="h">telnet mail smtp</span>
</pre>
<p><img class="icon32x32 left" alt="Important" src="/images/emblem-important.png" />Replace <strong>mail</strong> with the name of your server. We should not use localhost since localhost is a trusted client ip address. And make sure the domain name you specified does not resolve to 127.0.0.1 which is the IP address of localhost.</p>
<pre class="steps">
Trying 192.168.0.1...
Connected to mail.acme.local (192.168.0.1).
Escape character is '^]'.
220 mail.acme.local ESMTP Postfix
<span class="h">ehlo localhost</span>
250-mail.acme.local
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
</pre>
<p>Note the new <tt>250-AUTH</tt> lines. See the old <a href="/postfix-smtp-server-howto-centos-6/#test-postfix">SMTP Telnet Test</a>.</p>
<pre class="steps">
<span class="h">mail from:&lt;johndoe&gt;</span>
250 2.1.0 Ok
<span class="h">rcpt to:&lt;test@example.com&gt;</span>
554 5.7.1 &lt;test@example.com&gt;: Relay access denied
</pre>
<p>It works, now to check if we can send it after authenticating.</p>
<pre class="steps">
<span class="h">auth plain AGpvaG5kb2UAcGFzc3dvcmQ=</span>
235 2.0.0 Authentication successful
<span class="h">rcpt to:&lt;test@example.com&gt;</span>
250 2.1.5 Ok
<span class="h">quit</span>
221 2.0.0 Bye
Connection closed by foreign host.
[root@mail ~]#
</pre>
<p><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />You can send to email addresses belonging to your domain without authentication. This is normal as it enables you to receive mail from the outside.</p>
<p>The gibberish text after <strong>AUTH PLAIN</strong> is the base64 encoded value of the user name <em>johndoe</em> and password <em>password</em>. You can generate your own base64 text using the form below.</p>
<form name="base64Form" action="">
<label for="username" style="display: block; width: 9em; float: left">User Name:</label><input type="text" name="username" id="username" style="width: 25em" /><br />
<label for="password" style="display: block; width: 9em; float: left">Password:</label><input type="password" name="password" id="password" style="width: 25em" /><br />
<br />
<input type="button" value="Encode" style="margin-left: 18em" onclick="document.base64Form.result.value=base64('\0' + document.base64Form.username.value + '\0' + document.base64Form.password.value);" /><br />
<br />
<label for="result" style="display: block; width: 9em; float: left">Result:</label><input type="text" name="result" id="result" readonly="readonly" style="width: 25em" />
<br /><br />
</form>
<p><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></p>
<div>&nbsp;</div>
<div class="left">&laquo;&laquo; Previous: <a href="/install-setup-dovecot-centos-6/">How to Setup Dovecot</a></div><div class="right">Next: <a href="/squirrelmail-webmail-setup-howto-centos-6/">How to Install SquirrelMail</a> &raquo;&raquo;</div>
<div class="clear">&nbsp;</div>
<script type="text/javascript">function base64(input){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;do{chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4);}while(i< input.length);return output;}</script>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/postfix-smtp-auth-dovecot-sasl-centos-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix SMTP Server Setup Howto for RHEL/CentOS 6</title>
		<link>http://www.linuxmail.info/postfix-smtp-server-howto-centos-6/</link>
		<comments>http://www.linuxmail.info/postfix-smtp-server-howto-centos-6/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 23:57:37 +0000</pubDate>
		<dc:creator>consultant</dc:creator>
				<category><![CDATA[CentOS 6]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Red Hat Enterprise Linux 6]]></category>

		<guid isPermaLink="false">http://www.linuxmail.info/?p=401</guid>
		<description><![CDATA[How to install Postfix SMTP Server in Red Hat Enterprise Linux 6 or CentOS 6]]></description>
			<content:encoded><![CDATA[<p>Installing and setting up Postfix SMTP Server in Red Hat Enterprise Linux 6 or CentOS 6 is easy. Postfix has secure default settings so we just need to open it up a bit.</p>
<span id="more-401"></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>Configure Postfix</h2>
<div class="clearfix steps"><a href="/images/centos-6/edit-main-cf.png"><img class="preview" alt="Edit main.cf" src="/images/centos-6/t-edit-main-cf.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Edit the file <em>/etc/postfix/main.cf</em> and update the lines below.</div>
<pre class="steps">
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
home_mailbox = Maildir/
</pre>
<p>In main.cf, lines starting with <tt>#</tt> are comments. Save the file after completing your changes.</p>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />Make sure that all <tt>mail_spool_directory</tt> lines are commented out. Otherwise, it will override the setting in the <tt>home_mailbox</tt> line above.</div>
<div class="clearfix steps"><a href="/images/centos-6/service-config-2.png"><img class="preview" alt="Service Configuration" src="/images/centos-6/t-service-config-2.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. Restart the postfix service. <a href="/how-to-start-stop-services-centos-6/">Learn how to restart services here.</a></div>
<h2 id="test-postfix">Test Postfix</h2>
<div class="clearfix steps"><a href="/images/centos-6/terminal-shortcut.png"><img class="preview" alt="Terminal" src="/images/centos-6/t-terminal-shortcut.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>1. Click <em>Applications</em>, select <em>System Tools</em>, and click <em>Terminal</em>. This will launch the <strong>Terminal</strong> window.</div>
<div class="clearfix steps"><a href="/images/centos-6/terminal.png"><img class="preview" alt="Terminal" src="/images/centos-6/t-terminal.png" onmouseover="changeSrc(this)" /><img class="full" alt="" src="/images/busy.gif" /></a>2. In the <strong>Terminal</strong> window, type in the highlighted commands below.</div>
<p>Sample postfix session. Replace <strong>johndoe</strong> with any valid user account. The dot after the line <strong>test</strong> is a command that should be typed in.</p>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />If you need to add new user accounts, <a href="/how-to-add-remove-user-accounts-centos-5/">learn how to add or remove user accounts here.</a></div>
<div class="clearfix">
<pre class="steps">
[root@mail ~]# <span class="h">telnet localhost smtp</span>
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.acme.local ESMTP Postfix
<span class="h">ehlo localhost</span>
250-mail.acme.local
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
<span class="h">mail from:&lt;johndoe&gt;</span>
250 2.1.0 Ok
<span class="h">rcpt to:&lt;johndoe&gt;</span>
250 2.1.5 Ok
<span class="h">data</span>
354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;
<span class="h">test</span>
<span class="h">.</span>
250 2.0.0 Ok: queued as 9729067C17
<span class="h">quit</span>
221 2.0.0 Bye
Connection closed by foreign host.
[root@mail ~]#
</pre>
<p>&nbsp;</p>
<p>To check if the mail indeed exists</p>
<pre class="steps">
[root@mail ~]# <span class="h">cd /home/johndoe/Maildir/new</span>
[root@mail new]# <span class="h">ls</span>
1185669817.Vfd00I18012M795756.mail.acme.local
[root@mail new]# <span class="h">cat 1185669817.Vfd00I18012M795756.mail.acme.local</span>
</pre>
<p>Don&#8217;t worry, you don&#8217;t have to type in the whole filename above. Just type in the first few characters say <tt>118</tt> then press Tab to activate automatic completion.</p>
<pre class="steps">
From johndoe@mail.acme.local  Thu Feb 22 21:48:28 2007
Return-Path: &lt;johndoe@mail.acme.local&gt;
X-Original-To: johndoe
Delivered-To: johndoe@mail.acme.local
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
        by mail.acme.local (Postfix) with SMTP id 9729067C17
        for &lt;johndoe&gt;; Thu, 22 Feb 2007 21:48:26 -0500 (EST)
Message-Id: &lt;20070222134827.9729067C17@mail.acme.local&gt;
Date: Thu, 22 Feb 2007 21:48:26 -0500 (EST)
From: johndoe@mail.acme.local
To: undisclosed-recipients:;

test

[root@mail mail]#
</pre>
</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>
<div class="clearfix steps"><img class="icon32x32 left" alt="Note" src="/images/emblem-note.png" />Review your <a href="/postfix-aliases-mailing-list/">Postfix aliases configuration file</a>. There are some predefined email aliases that might conflict with your existing mail accounts like sales, marketing, info, etc.</div>
<div class="left">&laquo;&laquo; Previous: <a href="/how-to-setup-centos-6-linux/">How to Setup CentOS 6 Linux</a></div><div class="right">Next: <a href="/install-setup-dovecot-centos-6/">How to Setup Dovecot</a> &raquo;&raquo;</div>
<div style="clear: both">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.linuxmail.info/postfix-smtp-server-howto-centos-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
	</channel>
</rss>

