<?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>Ants on the Melon &#187; Mail</title>
	<atom:link href="http://www.antsonthemelon.com/category/technology/mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.antsonthemelon.com</link>
	<description>Blackstone to Hampden-Sydney to New Orleans to San Antonio to Houston. And Back</description>
	<lastBuildDate>Mon, 26 Oct 2009 15:06:47 +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>SPF Records for AntiSpam Efforts</title>
		<link>http://www.antsonthemelon.com/2007/03/29/235/</link>
		<comments>http://www.antsonthemelon.com/2007/03/29/235/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 06:11:13 +0000</pubDate>
		<dc:creator>Cory</dc:creator>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://ants.wynand.com/2007/03/29/235/</guid>
		<description><![CDATA[A few days ago my server got joe-jobbed on a domain that I registered and never used.  When it started happening I just changed the MX record for the domain to point to localhost.standblue.net, which is an A record pointing to 127.0.0.1.  After doing this I noticed the bounces slowed down as the [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago my server got <a href="http://en.wikipedia.org/wiki/Joe_job">joe-jobbed</a> on a domain that I registered and never used.  When it started happening I just changed the MX record for the domain to point to localhost.standblue.net, which is an A record pointing to 127.0.0.1.  After doing this I noticed the bounces slowed down as the MTA&#8217;s tried to connect to themselves, rather than to my server.  At that time I also added SPF records to all the domains that I host on my server.</p>
<p>So tonight I figured it was time to configure my mail server to look at <a href="http://www.openspf.org/">SPF</a> records.   While searching around for a SPF implementation that seemed reasonable (ie, not written in Perl), I found <a href="http://www.openspf.org/Software">python-postfix-policyd-spf</a>, which is written in Python (although the code is not Pythonic at all).  </p>
<p>After installing the <a href="http://pydns.sourceforge.net/">PyDNS</a> and <a href="http://cheeseshop.python.org/pypi/pyspf/">PySPF</a> module dependencies, I installed python-postfix-policyd-spf by running &#8216;<code>python setup.py install</code>&#8216; and then things were ready to be configured.</p>
<p>The next step was to configure Postfix, which was actually very easy.  I added the following line to my <code>/etc/postfix/master.cf</code> file:</p>
<pre>
spfpolicy unix  -       n       n       -       -       spawn
        user=nobody argv=/usr/bin/python /usr/bin/policyd-spf
</pre>
<p>And the following to <code>/etc/postfix/main.cf</code>:</p>
<pre>
smtpd_recipient_restrictions =  permit_mynetworks,
                                permit_sasl_authenticated,
                                check_client_access hash:/etc/postfix/pop-before-smtp-relays,
                                check_recipient_maps,
                                reject_unauth_destination,
                                check_recipient_access hash:/etc/postfix/badmailto,
                                check_policy_service inet:127.0.0.1:60000,
                                <b>check_policy_service unix:private/spfpolicy,</b>
                                permit
spfpolicy_time_limit = 3600
</pre>
<p>Be sure to add the <code>check_policy_service unix:private/spfpolicy</code> line <i>after</i> the <code>reject_unauth_destination</code> line, otherwise you&#8217;ll be an open-relay. </p>
<p>Run &#8216;<code>postfix reload</code>&#8216; to get Postfix to acknowledge the changes, and that&#8217;s it.</p>
<p>After setting this up and watching the logs for a while tonight, I noticed a few things.</p>
<p>First, there are a lot more domains using SPF than I thought.  I know it&#8217;s been out for a few years now, but apparently it has really taken off.  The only shame is that most of the domains that have SPF records seem to still be using the <code>~all</code> code, which basically makes it pointless.</p>
<p>The second thing I noticed tonight isn&#8217;t quite as shocking: spammers are really careless and dumb.  The first two messages that were rejected via SPF were because the spammer actually set up SPF records for their spamming domains, but they screwed it up.  The log messages for those two are below:</p>
<pre>
Mar 29 01:07:05 silver policyd-spf[9260]: SPF fail - not authorized:QUEUEID=;
       identity=mailfrom; client-ip=65.254.160.36; helo=mail.meckcom.net;
       envelope-from=colonproblems@jermaynepaganochristianism.com;
       receiver=victim@example.com;
Mar 29 01:19:00 silver policyd-spf[9508]: SPF fail - not authorized:QUEUEID=;
       identity=mailfrom; client-ip=65.254.160.36; helo=mail.meckcom.net;
       envelope-from=mortgagenewsfromlowermybills@trythetips.com;
       receiver=victim@example.com;
</pre>
<p>Investigating the first one, I found this:</p>
<pre>
jermaynepaganochristianism.com. 600 IN  TXT     "v=spf1 a mx ip4:38.98.2.0/24 -all"
</pre>
<p>So the spammer who bought jermaynepaganochristianism.com (which was registered earlier this month) decided to set up a record specifying which hosts could send mail for that domain, and then send the spam through a different server.  Brilliant!</p>
<p>Here is another interesting one:</p>
<pre>
Mar 29 00:58:21 silver policyd-spf[9071]:
       <b>SPF Permanent Error: Invalid IP4 address: ip4:72.11.154.128/25-all:</b>
       QUEUEID=; identity=mailfrom; client-ip=72.11.154.232; helo=mail.anbermedia.com;
       envelope-from=smtp@anbermedia.com; receiver=victim@example.com;
</pre>
<p>In this case the spammer who bought anbermedia.com (which was registered <b>today</b>) set up a SPF record, but screwed it up by not placing a space between <code>/25</code> and <code>-all</code>, thereby making it an invalid record and causing mail to be rejected.  Sweet!</p>
<p>In the 2 hours I have had SPF in place, its blocked 10 messages or so.  That isn&#8217;t a huge amount, but my server doesn&#8217;t move a tremendous amount of mail, especially around midnight.   It will be interesting to see how well this works when the server is busy.</p>
<p>Next I plan to try out <a href="http://antispam.yahoo.com/domainkeys">DomainKeys</a> and see if that helps any.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.antsonthemelon.com/2007/03/29/235/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed Up Apple Mail.app</title>
		<link>http://www.antsonthemelon.com/2007/03/01/230/</link>
		<comments>http://www.antsonthemelon.com/2007/03/01/230/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 02:00:19 +0000</pubDate>
		<dc:creator>Cory</dc:creator>
				<category><![CDATA[Mail]]></category>

		<guid isPermaLink="false">http://ants.wynand.com/2007/03/01/230/</guid>
		<description><![CDATA[I came across this tip today that shows a neat trick to speed up Mail.app.
I&#8217;ve been using Mail.app for about 3 years now and after running the sqlite command to vacuum the index I noticed a pretty significant speedup.
Update: I showed this to Will and he tried vacuuming all the other tables as well.  [...]]]></description>
			<content:encoded><![CDATA[<p>I came across <a href="http://www.hawkwings.net/2007/03/01/a-faster-way-to-speed-up-mailapp/">this tip</a> today that shows a neat trick to speed up Mail.app.</p>
<p>I&#8217;ve been using Mail.app for about 3 years now and after running the sqlite command to vacuum the index I noticed a pretty significant speedup.</p>
<p><b>Update</b>: I showed this to Will and he tried vacuuming all the other tables as well.  I tried it too and it made things even faster!  Here are the steps:</p>
<pre>
cd ~/Library/Mail
sqlite3 Envelope\ Index
sqlite> vacuum;
sqlite> .quit
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.antsonthemelon.com/2007/03/01/230/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
