<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Anuhema&#039;s Blog</title>
	<atom:link href="http://anuhema.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://anuhema.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 30 May 2011 03:47:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='anuhema.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Anuhema&#039;s Blog</title>
		<link>http://anuhema.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://anuhema.wordpress.com/osd.xml" title="Anuhema&#039;s Blog" />
	<atom:link rel='hub' href='http://anuhema.wordpress.com/?pushpress=hub'/>
		<item>
		<title>PostfixBasicSetupHowto</title>
		<link>http://anuhema.wordpress.com/2009/09/06/postfixbasicsetuphowto/</link>
		<comments>http://anuhema.wordpress.com/2009/09/06/postfixbasicsetuphowto/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 07:16:04 +0000</pubDate>
		<dc:creator>anuhema</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anuhema.wordpress.com/2009/09/06/postfixbasicsetuphowto/</guid>
		<description><![CDATA[Introduction This document will teach you how to set up a basic Postfix mail server with IMAP and POP3 services. It does not included advanced topics such as integrating virus-checking and spam-filtering, which are dealt with in PostfixVirtualMailBoxClamSmtpHowto and PostfixCompleteVirtualMailSystemHowto. Setup Overview In our setup, Postfix sends and receives mail from Internet and stores them [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anuhema.wordpress.com&amp;blog=9348431&amp;post=5&amp;subd=anuhema&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Introduction</p>
<p>This document will teach you how to set up a basic Postfix mail server with IMAP and POP3 services. It does not included advanced topics such as integrating virus-checking and spam-filtering, which are dealt with in PostfixVirtualMailBoxClamSmtpHowto and PostfixCompleteVirtualMailSystemHowto.</p>
<p>Setup Overview</p>
<p>In our setup, Postfix sends and receives mail from Internet and stores them in the user mailboxes while clients on the Internet can retrieve their mails via Courier IMAP or POP3. The user authentication is done by Courier Authdaemon. The following diagram shows this process.</p>
<p>SetupOverview.jpg</p>
<p>Anatomy of Postfix</p>
<p>Components</p>
<p>The following figure shows the main Postfix system components, and the main information flows between them.</p>
<p>    * Yellow ellipsoids are mail programs.<br />
    * Yellow boxes are mail queues or files.<br />
    * Blue boxes are lookup tables.<br />
    * Programs in the large box run under control by the Postfix resident master daemon.<br />
    * Data in the large box is property of the Postfix mail system. </p>
<p>Receiving Mail</p>
<p>When a message enters the Postfix mail system, the first stop is the incoming queue. The figure below shows the main components that are involved with new mail.</p>
<p>      Mail is posted locally. The Postfix sendmail program invokes the privileged postdrop program which deposits the message into the maildrop directory, where the message is picked up by the pickup daemon. This daemon does some sanity checks, in order to protect the rest of the Postfix system.</p>
<p>      Mail comes in via the network. The Postfix SMTP server receives the message and does some sanity checks, in order to protect the rest of the Postfix system.</p>
<p>      Mail is generated internally by the Postfix system itself, in order to return undeliverable mail to the sender. The bounce or defer daemon brings the bad news.</p>
<p>      Mail is forwarded by the local delivery agent, either via an entry in the system-wide alias database, or via an entry in a per-user .forward file. This is indicated with the unlabeled arrow.</p>
<p>      Mail is generated internally by the Postfix system itself, in order to notify the postmaster of a problem (this path is also indicated with the unlabeled arrow).The Postfix system can be configured to notify the postmaster of SMTP protocol problems, UCE policy violations, and so on.</p>
<p>      The cleanup daemon implements the final processing stage for new mail. It adds missing From: and other message headers, arranges for address rewriting to the standard user@fully.qualified.domain form, and optionally extracts recipient addresses from message headers. The cleanup daemon inserts the result as a single queue file into the incoming queue, and notifies the queue manager of the arrival of new mail. The cleanup daemon can be configured to transform addresses on the basis of canonical and virtua table lookups.</p>
<p>      On request by the cleanup daemon, the trivial-rewrite daemon rewrites addresses to the standard user@fully.qualified.domain form. </p>
<p>Install Postfix</p>
<p>In this setup I assume that your domain is yourdomain.com and it has a valid MX record setup as mail.yourdomain.com. Remember to replace yourdomain.com with your actual domain in the example codes in this howto. Also I assume that you know what an MX record is. To find out MX your type in a terminal:</p>
<p>dig mx yourdomain.com</p>
<p>To install postfix</p>
<p>sudo apt-get install postfix</p>
<p>Intall mailx package for use as command mail utility program. Mail command is installed with this package.</p>
<p>sudo apt-get install mailx</p>
<p>Test your default setup</p>
<p>Add a user before you start this.</p>
<p>sudo useradd -m -s /bin/bash fmaster<br />
sudo passwd fmaster</p>
<p>Test your default installation using the following code segment.</p>
<p>netcat localhost 25</p>
<p>Postfix will prompt like following in the terminal so that you can use to type SMTP commands.</p>
<p>Trying 127.0.0.1&#8230;<br />
Connected to mail.fossedu.org.<br />
Escape character is &#8216;^]&#8217;.<br />
220 localhost.localdomain ESMTP Postfix (Ubuntu)</p>
<p>Type the following code segment in Postfix&#8217;s prompt.</p>
<p>ehlo localhost<br />
mail from: root@localhost<br />
rcpt to: fmaster@localhost<br />
data<br />
Subject: My first mail on Postfix</p>
<p>Hi,<br />
Are you there?<br />
regards,<br />
Admin<br />
. (Type the .[dot] in a new Line and press Enter )<br />
quit</p>
<p>Check the mailbox of fmaster</p>
<p>su &#8211; fmaster<br />
mail</p>
<p>When you type mail command an output like follows display in your terminal.</p>
<p>Mail version 8.1.2 01/15/2001.  Type ? for help.<br />
&#8220;/var/mail/fmaster&#8221;: 2 messages 2 new<br />
&gt;N  1 root@localhost     Mon Mar  6 12:49   13/479   Just a test<br />
 N  2 root@localhost     Mon Mar  6 12:51   15/487   My first mail<br />
&amp;</p>
<p>You will observe that mails are indexed by numbers and you can type the number of which the mail that you want to read. For example type no &#8220;2&#8243; to read the 2nd mail. The type &#8220;q&#8221; to quit. The mail will be written to a file called mbox in user&#8217;s home directory. According to our example it will be /home/fmaster/mbox.</p>
<p>All messages in an mbox type of mailbox are concatenated and stored in a single file. The beginning of each message is indicated by a line whose first five characters are &#8220;From &#8221; and a blank line is appended to the end of each message</p>
<p>Setting Postfix Support for Maildir-style Mailboxes</p>
<p>Maildir is a format for an e-mail spool that does not require file locking to maintain message integrity because the messages are kept in separate files with unique names. A Maildir is a directory (often named Maildir) with three subdirectories named tmp, new, and cur. The subdirectories should all reside on the same filesystem.</p>
<p>Another reason to use Maildir format is that Courier IMAP/POP3 servers only work with Maildir format of mailboxes.</p>
<p>Please find out more about Maildir here</p>
<p>Instruct Postfix to use Maildirs instead of Mboxes:</p>
<p> sudo postconf -e &#8220;home_mailbox = Maildir/&#8221;</p>
<p>Ensure Procmail isn&#8217;t used: (if the step was taken during dpkg-reconfigure, by mistake)</p>
<p>sudo postconf -e &#8220;mailbox_command = &#8220;</p>
<p>Restart Postfix to make changes effect.</p>
<p>sudo  /etc/init.d/postfix restart</p>
<p>Test your setup again</p>
<p>Installing courier IMAP and POP3</p>
<p>sudo apt-get install courier-pop<br />
sudo apt-get install courier-imap</p>
<p>Adding your local domains to postfix</p>
<p>Add your domains to mydestination:</p>
<p>sudo postconf -e &#8220;mydestination = mail.fossedu.org, localhost.localdomain, localhost, yourdoamin.com&#8221;</p>
<p>Add your local networks, too:</p>
<p>Postfix comes with the localhost (127.0.0.1) entry; you may have others, here we assume your LAN is on 192.168.1.0/24. Make changes to suit your situation.</p>
<p>sudo postconf -e &#8220;mynetworks = 127.0.0.0/8, 192.168.1.0/24&#8243;</p>
<p>Make Postfix to receive mail from the Internet</p>
<p>Instruct Postfix to receive on all interfaces:</p>
<p>sudo postconf -e &#8220;inet_interfaces = all&#8221;</p>
<p>(optional) Make Postfix accept IPv4, IPv6 protocols</p>
<p>If you&#8217;re not using IPv6 yet, and you&#8217;re paranoid, use &#8220;ipv4&#8243; instead of &#8220;all&#8221;. Again, this is to suit your own network sensibilities.</p>
<p>sudo postconf -e &#8220;inet_protocols = all&#8221;</p>
<p>Finally, restart Postfix;</p>
<p>sudo  /etc/init.d/postfix restart</p>
<p>Test your setup again using following code:</p>
<p>netcat mail.yourdomain.com 25<br />
ehlo yourdomain.com<br />
mail from: root@yourdomain.com<br />
rcpt to: fmaster@yourdomain.com<br />
data<br />
Subject: My first mail for my domain</p>
<p>Hi,<br />
Are you there?<br />
regards,<br />
Admin<br />
. (and Enter In a new Line)<br />
quit</p>
<p>Check the mailbox of fmaster</p>
<p>su &#8211; fmaster<br />
cd Maildir/new<br />
ls</p>
<p>Now you will see mail has a separate file.</p>
<p>Testing Courier POP3</p>
<p>Type in a terminal:</p>
<p>netcat mail.yourdomain.com 110</p>
<p>Use the following example code segment for your test. Be intelligent to tweak the changes appropriately to your environment. An output like follows will display in your terminal.</p>
<p>Connected to mail.yourdomain.com (208.77.188.166).<br />
Escape character is &#8216;^]&#8217;.<br />
+OK Hello there.</p>
<p>Type the following code segment in the prompt provided by the Courier POP3 server. I assume that you are intelligent enough not to type the lines which starts from +OK</p>
<p>user fmaster<br />
+OK Password required.<br />
pass password<br />
+OK logged in.<br />
quit</p>
<p>Testing Courier IMAP</p>
<p>Type in a terminal:</p>
<p>netcat mail.yourdomain.com 143</p>
<p>Use the following example code segment for your test. Be intelligent and tweak the changes appropriately to your environment. An output like follows will display in your terminal.</p>
<p>* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS XCOURIEROUTBOX=INBOX.Outbox] Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc.  See COPYING for distribution information.</p>
<p>Type the following code segment in the prompt provided by the Courier IMAP server.</p>
<p>a login fmaster password<br />
a OK LOGIN Ok.<br />
a logout</p>
<p>Local Alias database</p>
<p>When mail is to be delivered locally, the local delivery agent runs each local recipient name through the aliases database. The mapping does not affect addresses in message headers. Local aliases are typically used to implement distribution lists, or to direct mail for standard aliases such as postmaster to real people. The table can also be used to map Firstname.Lastname addresses to login names.</p>
<p>Alias lookups are enabled by default and you will see following code segment in main.cf file.</p>
<p>&#8230;<br />
alias_maps = hash:/etc/aliases<br />
&#8230;</p>
<p>Creating an alias for an account</p>
<p>The following codes illustrate how you can setup an alias. This step is optional since we are going to configure virtual mail domains later in this howto. I have added this step to make sure you understand how you can do this in case it is required.</p>
<p>Create a user</p>
<p>sudo useradd -m -s /bin/bash sysadmin<br />
sudo passwd sysadmin</p>
<p>Edit the alias table</p>
<p>Open the alias file with:</p>
<p>sudo vi /etc/aliases</p>
<p>Add the following code:</p>
<p>fmaster: sysadmin</p>
<p>To make your changes take effect type:</p>
<p>sudo newaliases</p>
<p>To test your changes send a mail to fmaster and check the mail in /home/sysadmin/Maildir/new folder.</p>
<p>Per User .forward Files</p>
<p>Users can control their own mail delivery by specifying destinations in a file called .forward in their home directories. The syntax of these files is the same as system aliases, except that the lookup key and colon are not present.</p>
<p>I will illustrate an example here:</p>
<p>Assume that you need to forward all the mails which come to the sysadmin account to an another account. Enter the following commands:</p>
<p>su &#8211; sysadmin<br />
touch .forward</p>
<p>Then open the .forward file</p>
<p>vi .forward</p>
<p>Add the following code:</p>
<p>fossedu@example.com</p>
<p>Remember to use email address which exists in this exercise.</p>
<p>Now send a mail to sysadmin and mail should come to fossedu@example.com</p>
<p>Postfix virtual Aliases for separate domains and Linux system accounts</p>
<p>With this approach, every hosted domain can have its own info etc. email address. However, it still uses Linux system accounts for local mailbox deliveries.</p>
<p>With virtual alias domains, each hosted address is aliased to a local UNIX system account or to a remote address. The example below shows how to use this mechanism for the fossedu.org and linuxelabs.com domains.</p>
<p>Inside the main.cf file, we tell it how to handle these virtual domains:</p>
<p>sudo postconf -e &#8220;virtual_alias_domains = fossedu.org linuxelabs.com&#8221;<br />
sudo postconf -e &#8220;virtual_alias_maps = hash:/etc/postfix/virtual&#8221;</p>
<p>Edit the /etc/postfix/virtual file:</p>
<p>Add two Linux system accounts</p>
<p>sudo useradd -m -s /bin/bash sigiri<br />
sudo useradd -m -s /bin/bash kala</p>
<p>Set passwords for the above users.</p>
<p>sudo passwd sigiri<br />
sudo passwd kala</p>
<p>sudo vi /etc/postfix/virtual</p>
<p>Add the following code segment:</p>
<p>info@fossedu.org       sigiri<br />
info@linuxelabs.com    kala</p>
<p>To create a Map Database type :</p>
<p>sudo postmap /etc/postfix/virtual</p>
<p>postmap is utility program that will convert /etc/postfix/virtual to /etc/postfix/virtual.db in Berkley DB format, so that Postfix can access the data faster.</p>
<p>Restart Postfix to make changes take effect:</p>
<p>sudo /etc/init.d/postfix restart</p>
<p>Send mails to both info@fossedu.org and info@linuxelabs.com and those mails should come to mailboxes of sigiri and kala respectively.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anuhema.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anuhema.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anuhema.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anuhema.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anuhema.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anuhema.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anuhema.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anuhema.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anuhema.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anuhema.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anuhema.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anuhema.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anuhema.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anuhema.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anuhema.wordpress.com&amp;blog=9348431&amp;post=5&amp;subd=anuhema&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anuhema.wordpress.com/2009/09/06/postfixbasicsetuphowto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4d1624d683b098c254fbc97203c7111?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anuhema</media:title>
		</media:content>
	</item>
		<item>
		<title>Postfix</title>
		<link>http://anuhema.wordpress.com/2009/09/06/postfix/</link>
		<comments>http://anuhema.wordpress.com/2009/09/06/postfix/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 07:09:08 +0000</pubDate>
		<dc:creator>anuhema</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anuhema.wordpress.com/2009/09/06/postfix/</guid>
		<description><![CDATA[Introduction: Postfix is the default Mail Transfer Agent (MTA) for Ubuntu. It is in Ubuntu&#8217;s main repository, which means that it receives security updates. This guide explains how to install and configure postfix and set it up as an SMTP server using a secure connection. Installation: In order to install Postfix with SMTP-AUTH and TLS, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anuhema.wordpress.com&amp;blog=9348431&amp;post=4&amp;subd=anuhema&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Introduction:<br />
Postfix is the default Mail Transfer Agent (MTA) for Ubuntu. It is in Ubuntu&#8217;s main repository, which means that it receives security updates. This guide explains how to install and configure postfix and set it up as an SMTP server using a secure connection.<br />
Installation:<br />
In order to install Postfix with SMTP-AUTH and TLS, first install the postfix package from the Main repository using your favorite package manager. For example:</p>
<p>sudo aptitude install postfix</p>
<p>Simply accept the defaults when the installation process asks questions. The configuration will be done in greater detail in the next stage.</p>
<p>Configuration</p>
<p>From a terminal prompt:</p>
<p>sudo dpkg-reconfigure postfix</p>
<p>Now is a good time to decide which mailbox format you want to use. By default Postifx will use mbox for the mailbox format. Rather than editing the configuration file directly, you can use the postconf command to configure all postfix parameters. The configuration parameters will be stored in /etc/postfix/main.cf file. Later if you wish to re-configure a particular parameter, you can either run the command or change it manually in the file.</p>
<p>To configure the mailbox format for Maildir:</p>
<p>sudo postconf -e &#8216;home_mailbox = Maildir/&#8217;</p>
<p>You may need to issue this as well:</p>
<p>sudo postconf -e &#8216;mailbox_command =&#8217;</p>
<p>Note: This will place new mail in /home/username/Maildir so you will need to configure your Mail Delivery Agent to use the same path.</p>
<p>Configure Postfix to do SMTP AUTH using SASL (saslauthd):</p>
<p>sudo postconf -e &#8216;smtpd_sasl_local_domain =&#8217;<br />
sudo postconf -e &#8216;smtpd_sasl_auth_enable = yes&#8217;<br />
sudo postconf -e &#8216;smtpd_sasl_security_options = noanonymous&#8217;<br />
sudo postconf -e &#8216;broken_sasl_auth_clients = yes&#8217;<br />
sudo postconf -e &#8216;smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination&#8217;<br />
sudo postconf -e &#8216;inet_interfaces = all&#8217;</p>
<p>Next edit /etc/postfix/sasl/smtpd.conf and add the following lines:</p>
<p>pwcheck_method: saslauthd<br />
mech_list: plain login</p>
<p>Generate certificates to be used for TLS encryption and/or certificate Authentication:</p>
<p>touch smtpd.key<br />
chmod 600 smtpd.key<br />
openssl genrsa 1024 &gt; smtpd.key<br />
openssl req -new -key smtpd.key -x509 -days 3650 -out smtpd.crt # has prompts<br />
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650 # has prompts<br />
sudo mv smtpd.key /etc/ssl/private/<br />
sudo mv smtpd.crt /etc/ssl/certs/<br />
sudo mv cakey.pem /etc/ssl/private/<br />
sudo mv cacert.pem /etc/ssl/certs/</p>
<p>Configure Postfix to do TLS encryption for both incoming and outgoing mail:</p>
<p>sudo postconf -e &#8216;smtp_tls_security_level = may&#8217;<br />
sudo postconf -e &#8216;smtpd_tls_security_level = may&#8217;<br />
sudo postconf -e &#8216;smtpd_tls_auth_only = no&#8217;<br />
sudo postconf -e &#8216;smtp_tls_note_starttls_offer = yes&#8217;<br />
sudo postconf -e &#8216;smtpd_tls_key_file = /etc/ssl/private/smtpd.key&#8217;<br />
sudo postconf -e &#8216;smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt&#8217;<br />
sudo postconf -e &#8216;smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem&#8217;<br />
sudo postconf -e &#8216;smtpd_tls_loglevel = 1&#8242;<br />
sudo postconf -e &#8216;smtpd_tls_received_header = yes&#8217;<br />
sudo postconf -e &#8216;smtpd_tls_session_cache_timeout = 3600s&#8217;<br />
sudo postconf -e &#8216;tls_random_source = dev:/dev/urandom&#8217;<br />
sudo postconf -e &#8216;myhostname = server1.example.com&#8217; # remember to change this to yours</p>
<p>The file /etc/postfix/main.cf should now look like this:</p>
<p># See /usr/share/postfix/main.cf.dist for a commented, more complete version</p>
<p>smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)<br />
biff = no</p>
<p># appending .domain is the MUA&#8217;s job.<br />
append_dot_mydomain = no</p>
<p># Uncomment the next line to generate &#8220;delayed mail&#8221; warnings<br />
#delay_warning_time = 4h</p>
<p>myhostname = server1.example.com<br />
alias_maps = hash:/etc/aliases<br />
alias_database = hash:/etc/aliases<br />
myorigin = /etc/mailname<br />
mydestination = server1.example.com, example.com, localhost.example.com, localhost<br />
relayhost =<br />
mynetworks = 127.0.0.0/8<br />
mailbox_command = procmail -a &#8220;$EXTENSION&#8221;<br />
mailbox_size_limit = 0<br />
recipient_delimiter = +<br />
inet_interfaces = all<br />
smtpd_sasl_local_domain =<br />
smtpd_sasl_auth_enable = yes<br />
smtpd_sasl_security_options = noanonymous<br />
broken_sasl_auth_clients = yes<br />
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination<br />
smtpd_tls_auth_only = no<br />
#Use these on Postfix 2.2.x only<br />
#smtp_use_tls = yes<br />
#smtpd_use_tls = yes<br />
#For Postfix 2.3 or above use:<br />
smtp_tls_security_level = may<br />
smtpd_tls_security_level = may<br />
smtp_tls_note_starttls_offer = yes<br />
smtpd_tls_key_file = /etc/ssl/private/smtpd.key<br />
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt<br />
smtpd_tls_CAfile = /etc/ssl/cacert.pem<br />
smtpd_tls_loglevel = 1<br />
smtpd_tls_received_header = yes<br />
smtpd_tls_session_cache_timeout = 3600s<br />
tls_random_source = dev:/dev/urandom</p>
<p>Restart the postfix daemon like this:</p>
<p>sudo /etc/init.d/postfix restart</p>
<p>Authentication</p>
<p>The next steps are to configure Postfix to use SASL for SMTP AUTH.</p>
<p>First you will need to install the libsasl2-2 and sasl2-bin from the Main repository [i.e. sudo apt-get install them both].</p>
<p>Note: if you are using Ubuntu 6.06 (Dapper Drake) the package name is libsasl2.</p>
<p>We have to change a few things to make it work properly. Because Postfix runs chrooted in /var/spool/postfix we have change a couple paths to live in the false root. (ie. /var/run/saslauthd becomes /var/spool/postfix/var/run/saslauthd):</p>
<p>IconsPage/warning.png Note: by changing the saslauthd path other applications that use saslauthd may be affected.</p>
<p>First we edit /etc/default/saslauthd in order to activate saslauthd. Remove # in front of START=yes and add the PWDIR, PARAMS, and PIDFILE lines:</p>
<p># This needs to be uncommented before saslauthd will be run automatically<br />
START=yes</p>
<p>PWDIR=&#8221;/var/spool/postfix/var/run/saslauthd&#8221;<br />
PARAMS=&#8221;-m ${PWDIR}&#8221;<br />
PIDFILE=&#8221;${PWDIR}/saslauthd.pid&#8221;</p>
<p># You must specify the authentication mechanisms you wish to use.<br />
# This defaults to &#8220;pam&#8221; for PAM support, but may also include<br />
# &#8220;shadow&#8221; or &#8220;sasldb&#8221;, like this:<br />
# MECHANISMS=&#8221;pam shadow&#8221;</p>
<p>MECHANISMS=&#8221;pam&#8221;</p>
<p># Other options (default: -c)<br />
# See the saslauthd man page for information about these options.<br />
#<br />
# Example for postfix users: &#8220;-c -m /var/spool/postfix/var/run/saslauthd&#8221;<br />
# Note: See /usr/share/doc/sasl2-bin/README.Debian<br />
#OPTIONS=&#8221;-c&#8221;</p>
<p>#make sure you set the options here otherwise it ignores params above and will not work<br />
OPTIONS=&#8221;-c -m /var/spool/postfix/var/run/saslauthd&#8221;</p>
<p>Note: If you prefer, you can use &#8220;shadow&#8221; instead of &#8220;pam&#8221;. This will use MD5 hashed password transfer and is perfectly secure. The username and password needed to authenticate will be those of the users on the system you are using on the server.</p>
<p>Next, we update the dpkg &#8220;state&#8221; of /var/spool/postfix/var/run/saslauthd. The saslauthd init script uses this setting to create the missing directory with the appropriate permissions and ownership:</p>
<p>dpkg-statoverride &#8211;force &#8211;update &#8211;add root sasl 755 /var/spool/postfix/var/run/saslauthd</p>
<p>This may report an error that &#8220;&#8211;update given&#8221; and the &#8220;/var/spool/postfix/var/run/saslauthd&#8221; directory does not exist. You can ignore this because when you start saslauthd next it will be created.</p>
<p>Finally, start saslauthd:</p>
<p>sudo /etc/init.d/saslauthd start</p>
<p>Testing</p>
<p>To see if SMTP-AUTH and TLS work properly now run the following command:</p>
<p>telnet localhost 25</p>
<p>After you have established the connection to your postfix mail server type</p>
<p>ehlo localhost</p>
<p>If you see the lines</p>
<p>250-STARTTLS<br />
250-AUTH</p>
<p>among others, everything is working.</p>
<p>Type quit to return to the system&#8217;s shell.</p>
<p>Troubleshooting</p>
<p>Remove Postfix from chroot</p>
<p>If you run into issues while running Postfix you may be asked to remove Postfix from chroot to better diagnose the problem. In order to do that you will need to edit /etc/postfix/master.cf locate the following line:</p>
<p>smtp      inet  n       &#8211;       &#8211;       &#8211;       &#8211;       smtpd</p>
<p>and modify it as follows:</p>
<p>smtp      inet  n       &#8211;       n       &#8211;       &#8211;       smtpd</p>
<p>Then restart Postfix:</p>
<p>sudo /etc/init.d/postfix restart</p>
<p>Configuring saslauthd to Default</p>
<p>If you don&#8217;t want to run Postfix in a chroot, or you&#8217;d like to not use chroot for troubleshooting purposes you will probably also want to return saslauthd back to its default configuration.</p>
<p>The first step in accomplishing this is to edit /etc/default/saslauthd comment the following lines we added above:</p>
<p>#PWDIR=&#8221;/var/spool/postfix/var/run/saslauthd&#8221;<br />
#PARAMS=&#8221;-m ${PWDIR}&#8221;<br />
#PIDFILE=&#8221;${PWDIR}/saslauthd.pid&#8221;</p>
<p>Then return the saslauthd dpkg &#8220;state&#8221; to its default location:</p>
<p>dpkg-statoverride &#8211;force &#8211;update &#8211;add root sasl 755 /var/run/saslauthd</p>
<p>And restart saslauthd:</p>
<p>sudo /etc/init.d/saslauthd restart</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anuhema.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anuhema.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anuhema.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anuhema.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anuhema.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anuhema.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anuhema.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anuhema.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anuhema.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anuhema.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anuhema.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anuhema.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anuhema.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anuhema.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anuhema.wordpress.com&amp;blog=9348431&amp;post=4&amp;subd=anuhema&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anuhema.wordpress.com/2009/09/06/postfix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4d1624d683b098c254fbc97203c7111?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anuhema</media:title>
		</media:content>
	</item>
		<item>
		<title>mailserver postfix sendmail</title>
		<link>http://anuhema.wordpress.com/2009/09/06/mailserver-postfix-sendmail/</link>
		<comments>http://anuhema.wordpress.com/2009/09/06/mailserver-postfix-sendmail/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 06:46:40 +0000</pubDate>
		<dc:creator>anuhema</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postfix in ubuntu]]></category>

		<guid isPermaLink="false">http://anuhema.wordpress.com/2009/09/06/mailserver-postfix-sendmail/</guid>
		<description><![CDATA[Reference: https://help.ubuntu.com/community/Postfix https://help.ubuntu.com/community/PostfixBasicSetupHowto<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anuhema.wordpress.com&amp;blog=9348431&amp;post=3&amp;subd=anuhema&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Reference:</p>
<p>https://help.ubuntu.com/community/Postfix</p>
<p>https://help.ubuntu.com/community/PostfixBasicSetupHowto</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anuhema.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anuhema.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anuhema.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anuhema.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anuhema.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anuhema.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anuhema.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anuhema.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anuhema.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anuhema.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anuhema.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anuhema.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anuhema.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anuhema.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anuhema.wordpress.com&amp;blog=9348431&amp;post=3&amp;subd=anuhema&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anuhema.wordpress.com/2009/09/06/mailserver-postfix-sendmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4d1624d683b098c254fbc97203c7111?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anuhema</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://anuhema.wordpress.com/2009/09/06/hello-world/</link>
		<comments>http://anuhema.wordpress.com/2009/09/06/hello-world/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 06:38:35 +0000</pubDate>
		<dc:creator>anuhema</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anuhema.wordpress.com&amp;blog=9348431&amp;post=1&amp;subd=anuhema&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anuhema.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anuhema.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anuhema.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anuhema.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anuhema.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anuhema.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anuhema.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anuhema.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anuhema.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anuhema.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anuhema.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anuhema.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anuhema.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anuhema.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anuhema.wordpress.com&amp;blog=9348431&amp;post=1&amp;subd=anuhema&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anuhema.wordpress.com/2009/09/06/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4d1624d683b098c254fbc97203c7111?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anuhema</media:title>
		</media:content>
	</item>
	</channel>
</rss>
