<?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>gHacks technology news &#187; mail relaying</title> <atom:link href="http://www.ghacks.net/tag/mail-relaying/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Thu, 18 Mar 2010 18:01:40 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Mail relaying made simple with Postfix</title><link>http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/</link> <comments>http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/#comments</comments> <pubDate>Wed, 23 Sep 2009 01:17:26 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Email]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[software]]></category> <category><![CDATA[mail relaying]]></category> <category><![CDATA[mail server]]></category> <category><![CDATA[Postfix]]></category><guid isPermaLink="false">http://www.ghacks.net/?p=16586</guid> <description><![CDATA[Have you installed the Postfix as an easier to use, more secure alternative to Sendmail only to find yourself having trouble with the old &#8220;unable to relay&#8221; errors? This can be very frustrating and have you pulling out your hair in no time. MTAs (Mail Transfer Agents) can be a tricky lot to set up. Add [...]]]></description> <content:encoded><![CDATA[<p>Have you installed the Postfix as an easier to use, more secure alternative to Sendmail only to find yourself having trouble with the old &#8220;unable to relay&#8221; errors? This can be very frustrating and have you pulling out your hair in no time.</p><p>MTAs (Mail Transfer Agents) can be a tricky lot to set up. Add in to the mix something like relaying and you have all the ingredients for an installation NOT working. Fortunately <a title="Postfix" href="http://www.postfix.org/" target="_blank">Postfix</a> isn&#8217;t nearly as complicated as Sendmail, so relaying isn&#8217;t something you need guru-level access to solve. In this tutorial I am going to show you how to set up Postfix for easy relaying. You can always add this to the Ubuntu Server series that started with the article &#8220;<a title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04</a>&#8220;.</p><p><span id="more-16586"></span><strong>Installing Postfix</strong></p><p>Just in case you haven&#8217;t already, you can install Postfix on your already running Ubuntu Server install with the command:</p><p><em>sudo apt-get install postfix</em></p><p>But I am going to assume you already have Postfix up and running already. And if you&#8217;re looking into relaying with Postfix, your problem is that you can receive mail, you just can&#8217;t send it. Let&#8217;s fix that problem.</p><p><strong>Configure Postfix</strong></p><p>The file you need to first take care of is <strong>/etc/postfix/main.cf</strong>. You will need sudo access so open this file with the command:</p><p><em>sudo nano /etc/postfix/main.cf</em></p><p>Now add this to the bottom of that file:</p><p><code># SMTP Authentication<br /> smtp_sasl_auth_enable = yes<br /> smtpd_sasl_type = dovecot<br /> smtpd_sasl_path = private/auth<br /> smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd</code></p><p>NOTE: The portion starting with &#8220;smtpd_recipient_restrictions&#8221; and ending with &#8220;reject_unauth_destination&#8221; is actually one line.</p><p>NOTE: The portion starting with &#8220;reject_unauth&#8221; and ending with &#8220;sasl_passwd&#8221; is also only one line.</p><p>NOTE: The above assumes you are using Dovecot as your IMAP server.</p><p>The last line of the above should give you a hint as to what is next. Yes, you have to create a file, <strong>sasl_passwd</strong>, for Postfix to use as a password file. This file will be located in <strong>/etc/postfix/sasl/</strong> and will look like the following:</p><p>address.for.relaying   username:password</p><p>Where<em>:</em></p><ul><li><em>address.for.relaying </em>is the actual mail server you will use for relaying.</li><li><em>username</em> is the username for authentication on the relaying mail server.</li><li><em>password</em> is the password for authentication on the relaying mail server.</li></ul><p>The next step is to create the the sasl_passwd DB file so that Postfix has something it can read. To do this, issue the command:</p><p><em>sudo postmap hash:/etc/postfix/sasl/sasl_passwd</em></p><p>You should now see a new file in the <strong>/etc/postfix/sasl </strong>directory called <strong>sasl_passwd.db.</strong></p><p>One file step before restarting Postfix. Because the password file is plaintext it should be secured so that it can not be read by just any user. Say, for instance, you want Postfix to only be read by the root user. For this issue the command:</p><p><em>sudo chown root:root /etc/postfix/sasl/sasl_passwd &amp;&amp; chmod 600 /etc/postfix/sasl/sasl_passwd</em></p><p>Do the same thing with the <strong>sasl_passwd.db </strong>file like so:</p><p><em>sudo chown root:root /etc/postfix/sasl/sasl_passwd.db &amp;&amp; chmod 600 /etc/postfix/sasl/sasl_passwd.db</em></p><p>NOTE: If you have need for a different user, you can chown the file to whatever user you want&#8230;just make sure it is a secure user.</p><p>You&#8217;re finished. All that is left is to restart Postfix with the command:</p><p><em>sudo /etc/init.d/postfix restart</em></p><p>Open up your mail client and text to see if relaying is now working for you.</p><p><strong>Final thoughts</strong></p><p>Gone are the days of the overly complicated (and insecure) Sendmail configurations. Setting up relaying is simple when you are using Postfix.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 6/13 queries in 0.004 seconds using disk

Served from: www.ghacks.net @ 2010-03-19 01:04:21 -->