<?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>Blogternals &#187; smtp</title>
	<atom:link href="http://www.blogternals.com/tag/smtp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blogternals.com</link>
	<description>Knowledge Belongs to the World!</description>
	<lastBuildDate>Wed, 11 Aug 2010 12:32:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Postfix Google Apps / Gmail SMTP Relay</title>
		<link>http://www.blogternals.com/2009/04/30/postfix-google-apps-gmail-smtp-relay/</link>
		<comments>http://www.blogternals.com/2009/04/30/postfix-google-apps-gmail-smtp-relay/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 21:07:00 +0000</pubDate>
		<dc:creator>Allen Sanford</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Compiler]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[google apps]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[relat]]></category>
		<category><![CDATA[sasl]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.blogternals.com/?p=340</guid>
		<description><![CDATA[For this to work you will need both SASL and SSL support compiled into postfix. Thank goodness Ubuntu by default does this for me. If you are not so luck them you will need to compile SASL and SSL support into your postfix install. To find out you can run the following command and the output should be similar to that below making note wether sasl and ssl are in the list (really for this that is all that is needed).]]></description>
			<content:encoded><![CDATA[<p>For this to work you will need both SASL and SSL support <a class="zem_slink" href="http://en.wikipedia.org/wiki/Compiler" title="Compiler" rel="wikipedia">compiled</a> into postfix. Thank goodness <a class="zem_slink" href="http://www.ubuntu.com/" title="Ubuntu (operating system)" rel="homepage">Ubuntu</a> by default does this for me. If you are not so luck them you will need to compile SASL and SSL support into your postfix install. To find out you can run the following command and the output should be similar to that below making note wether sasl and ssl are in the list (really for this that is all that is needed).</p>
<p><span id="more-340"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p340code1'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3401"><td class="code" id="p340code1"><pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">ldd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>smtp</pre></td></tr></table></div>

<p>You should see something similar to the following:</p>
<p style="padding-left: 30px;"><a class="zem_slink" href="http://en.wikipedia.org/wiki/Linux" title="Linux" rel="wikipedia">linux</a>-gate.so.1 =&gt;&nbsp; (0xb7f62000)<br />
 libpostfix-master.so.1 =&gt; /usr/lib/libpostfix-master.so.1 (0xb7f54000)<br />
 libpostfix-tls.so.1 =&gt; /usr/lib/libpostfix-tls.so.1 (0xb7f45000)<br />
 libpostfix-dns.so.1 =&gt; /usr/lib/libpostfix-dns.so.1 (0xb7f3f000)<br />
 libpostfix-global.so.1 =&gt; /usr/lib/libpostfix-global.so.1 (0xb7f0e000)<br />
 libpostfix-util.so.1 =&gt; /usr/lib/libpostfix-util.so.1 (0xb7ee1000)<br />
 libssl.so.0.9.8 =&gt; /lib/i686/cmov/libssl.so.0.9.8 (0xb7e9b000)<br />
 libcrypto.so.0.9.8 =&gt; /lib/i686/cmov/libcrypto.so.0.9.8 (0xb7d4f000)<br />
 libsasl2.so.2 =&gt; /usr/lib/libsasl2.so.2 (0xb7d37000)<br />
 libdb-4.7.so =&gt; /usr/lib/libdb-4.7.so (0xb7be2000)<br />
 libnsl.so.1 =&gt; /lib/libnsl.so.1 (0xb7bcb000)<br />
 libresolv.so.2 =&gt; /lib/libresolv.so.2 (0xb7bb6000)<br />
 libc.so.6 =&gt; /lib/libc.so.6 (0xb7a6f000)<br />
 libdl.so.2 =&gt; /lib/libdl.so.2 (0xb7a6b000)<br />
 libz.so.1 =&gt; /lib/libz.so.1 (0xb7a54000)<br />
 libpthread.so.0 =&gt; /lib/libpthread.so.0 (0xb7a3c000)<br />
 /lib/ld-linux.so.2 (0xb7f63000)</p>
<p><strong><span style="text-decoration: underline;">If you dont see libssl and libsasl</span> STOP, </strong>you’ll need to recompile with support before you continue, if you are lucky and do see them in your installation then we are good to go and you can proceed.</p>
<p><br class="spacer_"></p>
<h2>Generate a Self Signed Key for this server</h2>
<p>
First you are going to need an openssl key, even if it is a self signed key, so here is how you slef sign a key. BTY this is the short version if you need a deep explanation go <a href="http://blog.taragana.com/index.php/archive/openssl-how-to-create-self-signed-certificate/">here</a>
</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p340code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3402"><td class="code" id="p340code2"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>certs
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfiix<span style="color: #000000; font-weight: bold;">/</span>certs
openssl genrsa <span style="color: #660033;">-out</span> server.key <span style="color: #000000;">1024</span>
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> server.key <span style="color: #660033;">-out</span> server.csr
openssl req <span style="color: #660033;">-newkey</span> rsa:<span style="color: #000000;">1024</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-infiles</span> server.csr <span style="color: #660033;">-signkey</span> server.key <span style="color: #660033;">-keyout</span> server.pem <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span></pre></td></tr></table></div>

<p><br class="spacer_"></p>
<h2>Modify main.cf</h2>
</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p340code3'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3403"><td class="code" id="p340code3"><pre class="bash" style="font-family:monospace;"> <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>
 <span style="color: #c20cb9; font-weight: bold;">vim</span> main.cf</pre></td></tr></table></div>

<p><span style="font-size: medium;">And now add the following lines:</span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p340code4'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3404"><td class="code" id="p340code4"><pre class="bash" style="font-family:monospace;">    relayhost = <span style="color: #7a0874; font-weight: bold;">&#91;</span>smtp.gmail.com<span style="color: #7a0874; font-weight: bold;">&#93;</span>:<span style="color: #000000;">587</span>
    <span style="color: #666666; font-style: italic;">#auth</span>
    <span style="color: #007800;">smtp_sasl_auth_enable</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
    smtp_sasl_password_maps = <span style="color: #7a0874; font-weight: bold;">hash</span>:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>sasl_passwd
    <span style="color: #666666; font-style: italic;">#tls</span>
    smtp_use_tls = <span style="color: #c20cb9; font-weight: bold;">yes</span>
    smtp_sasl_security_options = noanonymous
    smtp_sasl_tls_security_options = noanonymous
    smtp_tls_note_starttls_offer = <span style="color: #c20cb9; font-weight: bold;">yes</span>
    tls_random_source = dev:<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>urandom
    smtp_tls_scert_verifydepth = <span style="color: #000000;">5</span>
    <span style="color: #007800;">smtp_tls_key_file</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>server.key
    <span style="color: #007800;">smtp_tls_cert_file</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>server.pem
    smtpd_tls_ask_ccert = <span style="color: #c20cb9; font-weight: bold;">yes</span>
    smtpd_tls_req_ccert =no
    smtp_tls_enforce_peername = no</pre></td></tr></table></div>

<p style="padding-left: 60px;">&nbsp;</p>
<p>Create a sasl_passwd file</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p340code5'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3405"><td class="code" id="p340code5"><pre class="bash" style="font-family:monospace;">     <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>sasl_passwd</pre></td></tr></table></div>

<p>Copy the following text and place it in your /etc/postfix/sasl_passwd.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p340code6'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3406"><td class="code" id="p340code6"><pre class="bash" style="font-family:monospace;">    gmail-smtp.l.google.com username<span style="color: #000000; font-weight: bold;">@</span>domain:password
    smtp.gmail.com username<span style="color: #000000; font-weight: bold;">@</span>domain:password</pre></td></tr></table></div>

<p>Don&#8217;t forget to postmap the new sasl_passwd file and then reload postfix and you show be good to go!</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p340code7'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3407"><td class="code" id="p340code7"><pre class="bash" style="font-family:monospace;"> postmap <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>sasl_passwd
 <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>postfix reload</pre></td></tr></table></div>

<p><br class="spacer_"></p>
<p></to></path>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://domainmacher.com/howto-%25e2%2580%2593-setup-mail-server-on-linux-%25e2%2580%2594-postfix-dovecot-squirrelmail/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=howto-%2525e2%252580%252593-setup-mail-server-on-linux-%2525e2%252580%252594-postfix-dovecot-squirrelmail">Howto &#8211; Setup Mail Server on Linux &#8211; Postfix, Dovecot &amp; SquirrelMail</a> (domainmacher.com)</li>
</ul>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=8fdb19db-e536-4834-a9de-6f9be237273f"><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.blogternals.com/2009/04/30/postfix-google-apps-gmail-smtp-relay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
