<?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>Drew&#039;s Blog &#187; Mail</title>
	<atom:link href="http://drewdahl.com/category/howto/mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://drewdahl.com</link>
	<description>A Barrage of Liquid Awesome in Geek Form</description>
	<lastBuildDate>Thu, 26 May 2011 08:43:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>HowTo Setup Authenticated Postfix</title>
		<link>http://drewdahl.com/2010/05/15/howto-setup-authenticated-postfix/</link>
		<comments>http://drewdahl.com/2010/05/15/howto-setup-authenticated-postfix/#comments</comments>
		<pubDate>Sun, 16 May 2010 00:54:01 +0000</pubDate>
		<dc:creator>Drew Dahl</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Fedora 12]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://drewdahl.com/?p=478</guid>
		<description><![CDATA[I recently had the experience of setting up Postfix. It works really well, in my opinion; however, setting it up wasn&#8217;t the simplest for what I wanted. But, at least it was simpler than sendmail Reading through several articles on the Internet, everyone was giving steps on how to setup postfix to handle e-mail for [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had the experience of setting up Postfix.  It works really well, in my opinion; however, setting it up wasn&#8217;t the simplest for what I wanted.  But, at least it was simpler than sendmail <img src='http://drewdahl.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Reading through several articles on the Internet, everyone was giving steps on how to setup postfix to handle e-mail for any FQDN (Fully-Qualified Domain Name).  Well, we don&#8217;t want to be handling someone else&#8217;s e-mail, so we decided to set it up with authentication.  All of the guides on setting up Postfix with SASL authentication are great and all; however, they don&#8217;t address the issue of, what if you want to receive mail as well.  That&#8217;s a simple fix, but moreover, what if you have a service like mailman running?  Mailman isn&#8217;t easily configured to authenticate against the SMTP server to send mail.  So, the following are the configurations that I&#8217;ve come up with to solve all of these problems:</p>
<p>For the file /etc/postfix/main.cf</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:700px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;strong&gt;queue_directory = /var/spool/postfix<br />
command_directory = /usr/sbin<br />
daemon_directory = /usr/libexec/postfix<br />
data_directory = /var/lib/postfix<br />
mail_owner = postfix<br />
myhostname = hostname.domain.tld<br />
mydomain = domain.tld<br />
myorigin = $mydomain<br />
inet_interfaces = all<br />
inet_protocols = all<br />
mydestination = $myhostname, localhost.$mydomain, localhost, localhost.localdomain, $mydomain<br />
unknown_local_recipient_reject_code = 550<br />
mynetworks = 192.168.0.0/24, 127.0.0.1/32<br />
relay_domains = $mydestination<br />
smtpd_sasl_auth_enable = yes<br />
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination<br />
broken_sasl_auth_clients = yes<br />
alias_maps = hash:/etc/aliases, hash:/etc/mailman/aliases<br />
alias_database = hash:/etc/aliases<br />
recipient_delimiter = +<br />
debug_peer_level = 2<br />
debugger_command =<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ddd $daemon_directory/$process_name $process_id &amp; sleep 5<br />
sendmail_path = /usr/sbin/sendmail.postfix<br />
newaliases_path = /usr/bin/newaliases.postfix<br />
mailq_path = /usr/bin/mailq.postfix<br />
setgid_group = postdrop<br />
html_directory = no<br />
manpage_directory = /usr/share/man<br />
sample_directory = /usr/share/doc/postfix-2.6.5/samples<br />
readme_directory = /usr/share/doc/postfix-2.6.5/README_FILES&lt;/strong&gt;</div></div>
<p>Now keep in mind, your values for some of the above WILL be different.  This configuration is on a machine that&#8217;s running mailman as well (thus the /etc/mailman/aliases file).  </p>
<p>And lastly, for SASL auth, edit the file: /usr/lib64/sasl2/smtpd.conf</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;strong&gt;pwcheck_method: saslauthd<br />
mech_list: plain login&lt;/strong&gt;</div></div>
<p>Your lib64 directory may just be lib, depending on the architecture of your box.  All of these edits were made a 64-bit Fedora 12 machine, but they should work for every machine.  </p>
<p>And last note.  After all of the edits have been made, make sure to restart postfix and restart saslauthd with the following:</p>
<p><strong>/etc/init.d/postfix restart<br />
/etc/init.d/saslauthd restart</strong></p>
<p>For questions on what some of the postfix settings mean, you can check out one of the following:</p>
<p>postconf man-page by running &#8220;<strong>man postconf</strong>&#8221; or visit <a href="http://www.postfix.org/postconf.5.html">http://www.postfix.org/postconf.5.html</a></p>
<p>Postfix Documentation at: <a href="http://www.postfix.org/documentation.html">http://www.postfix.org/documentation.html</a></p>
<p>Postfix HowTo&#8217;s at:<a href="http://www.postfix.org/docs.html"> http://www.postfix.org/docs.html</a></p>
<p>Postfix is definition the easiest MTA I&#8217;ve ever had the pleasure of working with, as far as configuration goes.  I hope this helps <img src='http://drewdahl.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://drewdahl.com/2010/05/15/howto-setup-authenticated-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup sendmail to use Gmail&#8217;s SMTP server</title>
		<link>http://drewdahl.com/2010/02/18/setup-sendmail-to-use-gmails-smtp-server/</link>
		<comments>http://drewdahl.com/2010/02/18/setup-sendmail-to-use-gmails-smtp-server/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 09:14:12 +0000</pubDate>
		<dc:creator>Drew Dahl</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[Sendmail]]></category>

		<guid isPermaLink="false">http://drewdahl.com/?p=341</guid>
		<description><![CDATA[Well, I did this on Fedora 12, so I&#8217;ll be basing everything off of Fedora packages and yum; however, this should work on any distro. Things you&#8217;ll need: sendmail, sendmail-cf, cyrus-sasl Might need something more, but if so, I&#8217;ve overlooked it&#8230; The first thing we&#8217;re going to do is setup our authinfo. Do the following: [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I did this on Fedora 12, so I&#8217;ll be basing everything off of Fedora packages and yum; however, this should work on any distro.</p>
<p>Things you&#8217;ll need: sendmail, sendmail-cf, cyrus-sasl</p>
<p>Might need something more, but if so, I&#8217;ve overlooked it&#8230;</p>
<p>The first thing we&#8217;re going to do is setup our authinfo.  Do the following:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkdir /etc/mail/auth/<br />
cd /etc/mail/auth/<br />
vim client-info</div></div>
<p>In the client-info file you&#8217;ve open in your text editor, insert the following line:</p>
<p><strong>    AuthInfo:smtp.gmail.com “U:root” “I:username@gmail.com” “P:password” “M:PLAIN”<br />
    AuthInfo:smtp.gmail.com:587 “U:root” “I:username@gmail.com” “P:password” “M:PLAIN”</strong></p>
<p>Now, save it, quit your editor, and run the following in the same directory.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">makemap -r hash client-info.db &lt; client-info<br />
chmod 600 *<br />
cd ../<br />
chmod 700 auth</div></div>
<p>Now, let&#8217;s move on to making our certs.  Do the following:</p>
<p></code></p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkdir /etc/mail/certs/<br />
cd /etc/mail/certs/<br />
openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 3650<br />
openssl req -nodes -new -x509 -keyout sendmail.pem -out sendmail.pem -days 3650<br />
cp &nbsp;/etc/pki/tls/certs/ca-bundle.crt /etc/mail/certs</div></div>
<p>And finally, let's edit our sendmail.mc.  Do the following:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cd /etc/mail/<br />
vim sendmail.mc</div></div>
<p>And, add the following to sendmail.mc:</p>
<p><strong>FEATURE(`authinfo’,`hash /etc/mail/auth/client-info.db’)dnl<br />
define(`SMART_HOST’,`smtp.gmail.com’)dnl<br />
define(`RELAY_MAILER_ARGS’, `TCP $h 587′)<br />
define(`ESMTP_MAILER_ARGS’, `TCP $h 587′)<br />
define(`CERT_DIR’, `/etc/mail/certs’)<br />
define(`confCACERT_PATH’, `CERT_DIR’)<br />
define(`confCACERT’, `CERT_DIR/ca-bundle.crt’)<br />
define(`confCRL’, `CERT_DIR/ca-bundle.crt’)<br />
define(`confSERVER_CERT’, `CERT_DIR/sendmail.pem’)<br />
define(`confSERVER_KEY’, `CERT_DIR/sendmail.pem’)<br />
define(`confCLIENT_CERT’, `CERT_DIR/sendmail.pem’)<br />
define(`confCLIENT_KEY’, `CERT_DIR/sendmail.pem’)<br />
define(`confAUTH_MECHANISMS’, `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)<br />
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)</strong></p>
<p>Now run:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">m4 sendmail.mc &gt; sendmail.cf<br />
/etc/init.d/sendmail restart</div></div>
<p>I think it's all self explanatory for the most part.  Happy mailing <img src='http://drewdahl.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>-=EDIT=-06/02/2010</strong></p>
<p>In the above configuration files, a user reported having issues while copying the above information into their config files.  The issue was regarding the quotes around various options. So, if you experience any trouble, please try replacing the quotes.  (e.g. delete the ones that are there and add them back within your text editor)</p>
]]></content:encoded>
			<wfw:commentRss>http://drewdahl.com/2010/02/18/setup-sendmail-to-use-gmails-smtp-server/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: drewdahl.com @ 2012-02-06 22:47:44 by W3 Total Cache -->
