<?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>Security Viewpoints &#187; Email security</title>
	<atom:link href="http://advosys.ca/viewpoints/category/email-security/feed/" rel="self" type="application/rss+xml" />
	<link>http://advosys.ca/viewpoints</link>
	<description>Security, operating systems and the IT industry</description>
	<lastBuildDate>Wed, 30 Jun 2010 14:18:17 +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>SpamAssassin p0f plugin catches bot spam</title>
		<link>http://advosys.ca/viewpoints/2007/07/spamassassin-p0f-plugin-catches-bot-spam/</link>
		<comments>http://advosys.ca/viewpoints/2007/07/spamassassin-p0f-plugin-catches-bot-spam/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 01:20:12 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Email security]]></category>
		<category><![CDATA[os fingerprinting]]></category>
		<category><![CDATA[p0f]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/2007/07/spamassassin-p0f-plugin-catches-bot-spam/</guid>
		<description><![CDATA[
   Most spam right now originates from compromised Windows desktop systems. Bot herders are more than happy to sell or rent a few thousand infected Windows home computers to spammers.


   If only there was a way for a mail server to detect when a Windows XP box is the source of [...]]]></description>
			<content:encoded><![CDATA[<p>
   Most spam right now originates from compromised Windows desktop systems. Bot herders are more than happy to sell or rent a few thousand infected Windows home computers to spammers.
</p>
<p>
   If only there was a way for a mail server to detect when a Windows XP box is the source of email.
</p>
<p>
   Well, of course there is. Michael Zalewski&#8217;s passive fingerprinting tool <a href="http://lcamtuf.coredump.cx/p0f.shtml" title="the new p0f - passive OS fingerprinting">p0f</a> can detect various operating systems with reasonable accuracy. Unlike active tools like <a href="http://insecure.org/nmap/" title="NMap security scanner">NMap</a> that spray a host with packets to determine open ports and what OS it&#8217;s running, passive fingerprinters just sniff network traffic as it goes by. Tell p0f to listen to TCP port 25 on your inbound mail server and you&#8217;ll get a real-time guess of which OS is being used on systems as they connect to you.
</p>
<p>
   A few months ago I set up a p0f daemon to collect OS information on a client&#8217;s mail servers, then matched that with email identified as spam with SpamAssassin. It turned out that around 70% of spam that made it though the blacklists and other spam defences was being blasted from Windows XP home computers. I was going to try writing a SpamAssassin plugin to use that info, but fortunately someone beat me to it.<span id="more-157"></span>
</p>
<p>
   The <a href="http://bl0g.blogdns.com/spamassassin/" title="SpamAssassin p0f plugin">SpamAssassin P0f plugin</a>  created by Mingchun (Vincent) Li uses p0f to add OS detection and scoring to <a href="http://spamassassin.apache.org/">SpamAssassin</a> . It&#8217;s easy to set up and has SpamAssassin rules for increasing the score of mail originating from Windows boxes, and also decreasing the score for mail from Linux and Unix.
</p>
<p>
  The plugin has three components:
</p>
<ol>
<li>A perl daemon that runs p0F and sends OS guesses out a UDP port on localhost</li>
<li>A SpamAssassin plugin that gathers the guess and increases or decreases the SpamAssassin score of the corresponding message.</li>
<li>A configuration file containing system parameters, rules and scores.</li>
</ol>
<h4>Installing on Ubuntu or Debian</h4>
<p>
   As far as I know, there is no packaged version of this plugin for Ubuntu or Debian. There is a packaged version of p0f in Ubuntu Feisty and older releases, but it seems to be version 2.0.5. You can use that but for greatest accuracy you might want to install p0f from source.
</p>
<p>
   Before compiling p0f, you&#8217;ll need <a href="http://packages.ubuntu.com/feisty/libs/libpcap0.8">libpcap</a>  and <a href="http://packages.ubuntu.com/feisty/libdevel/libpcap0.8-dev">libpcap-dev</a>  packages installed. After that compiling p0f is as simple extracting the tarball to a temporary directory then doing the usual &#8220;make; make install&#8221;. The p0f binary will be placed in directory /usr/local/sbin.
</p>
<p>
   To install the SpamAssassin p0f plugin, follow the instructions in <a href="http://bl0g.blogdns.com/spamassassin/INSTALL">the INSTALL file</a>. For no particularly good reason I used the UDP method rather than the Unix socket method:
</p>
<ol>
<li>Download file <a href="http://bl0g.blogdns.com/spamassassin/p0f-analyzer.pl">p0f-analyzer.pl</a>  to directory /usr/local/bin or /usr/local/sbin and make it executable.</li>
<li>Download files <a href="http://bl0g.blogdns.com/spamassassin/p0f-analyzer.pm">p0f-analyzer.pm</a>  and <a href="http://bl0g.blogdns.com/spamassassin/p0f-analyzer.cf">p0f-analyzer.cf</a>  to directory /etc/mail/spamassassin and make sure they are readable.</li>
<li>Start p0f-analyzer.pl running with &#8220;/path/to/script/p0f-analyzer.pl 2345&#8243;</li>
<li>Restart spamd. You might want to start spamd in debug mode with the &#8220;-D&#8221; parameter just to make sure the plugin loaded and is working.</li>
</ol>
<p>
     If you want to use this plugin permanently, you&#8217;ll need to create an init script to run p0f-analyzer.pl at system startup.
</p>
<h4>Scoring</h4>
<p>
     By default the plugin increases the SpamAssassin score of messages originating from a Windows XP box by 1.0. Other Windows versions increase the score by 0.1, and unrecognized OSs increase the score by 0.8. Mail from Unix systems ( *BSD, Solaris, HP/UX and Tru64) <em>decrease</em> the SpamAssassin score by 1.0.
</p>
<p>
     There is no score for Linux servers in the default scoring, so on our installation we modified file p0f-analyser.cf to add Linux to the regexp for Unix systems:
</p>
<pre>
header L_P0F_Unix  X-P0f-OS-Fingerprint =~ /^((Free|Open|Net)BSD)|Linux|Solaris|HP-UX|Tru64/
</pre>
<h4>Security</h4>
<p>
       One additional change we made was to force p0f drop root privileges and chroot itself. Protocol analyzers (e.g. Ethereal / Wireshark) have a history of buffer overflows that have allowed attackers to send malformed packets to gain root on the host system. I haven&#8217;t seen any published vulnerabilities for p0f, but it&#8217;s always a good idea to run all network software with limited privileges.
</p>
<p>
     The file p0f-analyzer.pl also trusts the system PATH to find the p0f binary. That&#8217;s not so bad since the script does the right thing by running in Perl taint mode and explicitly setting the PATH, but it always makes me less nervous to use full paths in scripts run by root.
</p>
<p>
       To change file p0f-analyzer.pl to use a full path and run p0f as an unprivileged user, change the statement around line 104 to read:
</p>
<pre>
open($p0f, "/usr/sbin/p0f -u <em>username</em> -l 'tcp dst port 25' 2&gt;&amp;1 | ") or die "Can't fork: $!";
</pre>
<p>
     &#8230;where &#8220;username&#8221; is an unprivileged user ID on your system, ideally one dedicated for use by p0f that has no login shell and a locked password.
</p>
<h4>Accuracy</h4>
<p>
     OS fingerprinting is never completely accurate, but p0f seems to do well identifying most Windows XP systems. NAT routers and certain firewalls can make some systems unidentifiable, however. Also, spam originating from a Windows bot but sent through an open SMTP relay would of course take on the TCP/IP characteristics of the relay, but bot herders don&#8217;t usually go to that trouble.
</p>
<p>
A really determined spammer could change the characteristics of the TCP stack similar to what <a href="http://ippersonality.sourceforge.net/">IP Personality</a>  does in Linux&#8230; but it&#8217;s highly unlikely any bot herder would bother. Of course if enough mail servers and firewalls start using OS detection to thwart bots, they may start doing that someday.
</p>
<p>
    We&#8217;ve only just started using the SpamAssassin p0f plugin on one of our mailers as a test so it&#8217;s too soon to say how effective this approach really is. The idea is extremely cool though&#8230; hats off to the author for developing the plugin. I&#8217;ll keep an eye on our spam stats and report back when there&#8217;s enough real-world data.</p>
Copyright &copy; 2010 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2006/09/blocking-image-spam-with-fuzzyocr/' rel='bookmark' title='Permanent Link: Blocking image spam with FuzzyOCR'>Blocking image spam with FuzzyOCR</a></li>
<li><a href='http://advosys.ca/viewpoints/2007/05/spam-more-profitable-than-extortion/' rel='bookmark' title='Permanent Link: Spam more profitable than extortion?'>Spam more profitable than extortion?</a></li>
<li><a href='http://advosys.ca/viewpoints/2006/04/address-extensions/' rel='bookmark' title='Permanent Link: A simple tool to track and control spammers'>A simple tool to track and control spammers</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2007/07/spamassassin-p0f-plugin-catches-bot-spam/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Nasty little bug in Gnu Privacy Guard (GPG)</title>
		<link>http://advosys.ca/viewpoints/2007/03/nasty-bug-in-gpg/</link>
		<comments>http://advosys.ca/viewpoints/2007/03/nasty-bug-in-gpg/#comments</comments>
		<pubDate>Fri, 09 Mar 2007 03:05:24 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Email security]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[gpg]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/2007/03/nasty-bug-in-gpg/</guid>
		<description><![CDATA[
Time to upgrade if you use Gnu Privacy Guard to encrypt or sign email or files.


It turns out that if you prepend unencrypted text to a GPG-signed (or signed and encrypted) file, when the file is decrypted by GPG the prepended text is spit out immediately followed by the decrypted plaintext. There is with no [...]]]></description>
			<content:encoded><![CDATA[<p>
Time to upgrade if you use <a href="http://www.gnupg.org/" title="Gnu Privacy Guard (GPG)">Gnu Privacy Guard</a> to encrypt or sign email or files.
</p>
<p>
It turns out that if you prepend unencrypted text to a GPG-signed (or signed and encrypted) file, when the file is decrypted by GPG the prepended text is spit out immediately followed by the decrypted plaintext. There is with no visual indication where one block of text ends and the other begins. An attacker who can modify a GPG-encrypted file (such as an email message or file on disk) can exploit this behavior to turn a signed message like
</p>
<blockquote>
<p>
	Purchase 40 shares of Acme Widgets
	</p>
</blockquote>
<p>
into a message that reads
</p>
<blockquote>
<p>
	Please sell all my shares and deposit the proceeds into account 123456 of Offshore Criminals Savings and Loan. Later this week I will then<br />
	Purchase 40 shares of Acme Widgets
	</p>
</blockquote>
<p>
This flaw is most likely to be a problem with email clients that use GnuPG, such as <a href="http://www.mozilla.com/en-US/thunderbird/">Mozilla Thunderbird</a> with the <a href="http://enigmail.mozdev.org/" title="Enigmail GPG extension for Thunderbird">Enigmail </a>extension. The problem isn&#8217;t in the cryptography&#8230; it&#8217;s that by default GPG displays no separation between extraneous output and decrypted plaintext. Read the <a href="http://lists.gnupg.org/pipermail/gnupg-announce/2007q1/000251.html" title="Multiple Messages Problem in GnuPG and GPGME">full announcement</a> for complete details.
</p>
<p>
Yet another example of how the strongest cryptography algorithms in the world can be defeated by unanticipated real world implementation flaws.</p>
Copyright &copy; 2010 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2006/07/pgp-symmetric-encryption/' rel='bookmark' title='Permanent Link: Little known features: Symmetric encryption with PGP/GPG'>Little known features: Symmetric encryption with PGP/GPG</a></li>
<li><a href='http://advosys.ca/viewpoints/2007/09/developers-sign-your-code/' rel='bookmark' title='Permanent Link: Dear developers: sign your code!'>Dear developers: sign your code!</a></li>
<li><a href='http://advosys.ca/viewpoints/2009/03/the-state-of-code-signing-in-open-source/' rel='bookmark' title='Permanent Link: The state of code signing in Open Source'>The state of code signing in Open Source</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2007/03/nasty-bug-in-gpg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blocking image spam with FuzzyOCR</title>
		<link>http://advosys.ca/viewpoints/2006/09/blocking-image-spam-with-fuzzyocr/</link>
		<comments>http://advosys.ca/viewpoints/2006/09/blocking-image-spam-with-fuzzyocr/#comments</comments>
		<pubDate>Sun, 10 Sep 2006 15:35:07 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Email security]]></category>
		<category><![CDATA[image spam]]></category>
		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/2006/09/blocking-image-spam-with-fuzzyocr/</guid>
		<description><![CDATA[Image spam has been growing lately. Spam where the scumbags hide their advertising for bogus products and scams inside an image file is nothing new, but it&#8217;s been steadily rising for the past several months, especially for pump-and-dump stock scams.
To reduce it for one of our clients, we added the FuzzyOCR plugin to SpamAssassin on [...]]]></description>
			<content:encoded><![CDATA[<p>Image spam has been growing lately. Spam where the scumbags hide their advertising for bogus products and scams inside an image file is nothing new, but it&#8217;s been steadily rising for the past several months, especially for pump-and-dump stock scams.</p>
<p>To reduce it for one of our clients, we added the <a title="FuzzyOCR image spam plugin for SpamAssassin" href="http://wiki.apache.org/spamassassin/FuzzyOcrPlugin">FuzzyOCR</a> plugin to <a title="SpamAssassin open-source spam filter" href="http://spamassassin.apache.org/">SpamAssassin</a> on their mail servers. The servers were already well defended against spam using the usual mix of SMTP sanity checks, blocklists and SpamAssassin rules, but too much image spam was still getting in.</p>
<p>When a message contains just an image file, the FuzzyOCR plugin runs the image through the open source <a title="GOCR Optical Character Recognition program" href="http://jocr.sourceforge.net/">GoCR</a> optical character recognition utility, then uses fuzzy string matching techniques on any words that pop out. </p>
<p><span id="more-49"></span></p>
<p>Although legitimate mail will occasionally contain only images (such as when someone emails photos), it&#8217;s rare for those images to contain lots of text. When the words are &quot;mortgage&quot;, &quot;invest&quot;, and &quot;enhancement&quot;, it&#8217;s likely that it&#8217;s spam.</p>
<p>GoCR is an impressive open-source project but isn&#8217;t the world&#8217;s most accurate OCR. The words it finds usually come out mangled to a certain degree. Spammers also purposely obfuscate words. Fuzzy string algorithms attempt to take care of that so for example what comes out as &quot;en-hnEmnt&quot; still has a chance of matching spam keyword &quot;enhancement&quot;.</p>
<p>The FuzzyOCR plugin adds new scores to messages based on whether words in images match a list of common spam words. Here&#8217;s an <a href="/images/blog/image-spam1.gif">original spam image</a> and here are the results from the plugin:</p>
<p><code> &nbsp;&nbsp;*&nbsp;&nbsp;6.0 FUZZY_OCR BODY: Mail contains an image with common spam text inside<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;Words found:<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;news&quot; in 7 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;breaking&quot; in 1 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;symbol&quot; in 1 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;investor&quot; in 1 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;company&quot; in 2 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;money&quot; in 1 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;thousand&quot; in 1 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;buy&quot; in 1 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;trade&quot; in 1 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;target&quot; in 1 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&quot;banking&quot; in 1 lines<br /> &nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;(18 word occurrences found)<br /></code></p>
<p>Most of the words in the above are present in the image spam, though a few like &quot;money&quot; and &quot;thousand&quot; are not. For this particular message, FuzzyOCR added 6.0 to the overall spam score while other SpamAssassin rules only gave it a score 3.6. The mail server&nbsp; is configured using our &quot;<a href="http://advosys.ca/papers/postfix-filtering.html" title="Fighting malware and spam with Postfix">Fighting malware and spam with Postfix</a>&quot; setup with the <a href="http://advosys.ca/papers/filter-misc/sideline.sh" title="sideline spam filter script for Postfix">sideline filter script</a>&#8230; it labels but delivers messages when total score is 4.0 or higher, and quarantines messages scoring 6.0 or higher. So in this case the additional scoring provided by FuzzyOCR successfully prevented the end-users from receiving the spam.</p>
<p>Taking a quick look at the quarantine on the server, we find that 28% of the image spam received exceeded the quarantine limit just from the normal SpamAssassin rules alone, and 72% were quarantined because of the additional scoring from FuzzyOCR. There were no false positive image spams at all in the quarantine.<br />Very good results so far.</p>
<p>Of course, spam defense is an arms race&#8230; every countermeasure is attacked immediately by those diligent little scumbag spammers. In the spam image above the spammer has added noise to the image and anti-aliased some words to reduce the accuracy of OCR. Others use animated GIFs to further confuse OCR software. Two messages received were in PNG format, which seems to be a new tactic. The effectiveness of OCR will decrease, but for right now it seems to be worth having. </p>
<p>Recently Google released <a href="http://google-code-updates.blogspot.com/2006/08/announcing-tesseract-ocr.html">Tesseract OCR</a> as open source. Originally developed as a commercial product by Hewlett-Packard, a decade ago it was considered one of the most accurate OCR products. If it&#8217;s better than GoCR, hopefully soon it can be used as an alternative OCR engine for SpamAssassin plugins and boost accuracy for obfuscated image spam even more.</p>
<p>Keeping up with spammer tactics is a never-ending chore. OCR is just one of many identification techniques. Interestingly, while every single image-based pump-and-dump spam has been caught by this new filter, traditional misspelled character spam have been scoring low enough to get through. Oh well&#8230; time to adjust the SpamAssassin scores again.</p>
Copyright &copy; 2010 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2007/07/spamassassin-p0f-plugin-catches-bot-spam/' rel='bookmark' title='Permanent Link: SpamAssassin p0f plugin catches bot spam'>SpamAssassin p0f plugin catches bot spam</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2006/09/blocking-image-spam-with-fuzzyocr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix now supports milter</title>
		<link>http://advosys.ca/viewpoints/2006/08/postfix-supports-milter/</link>
		<comments>http://advosys.ca/viewpoints/2006/08/postfix-supports-milter/#comments</comments>
		<pubDate>Fri, 18 Aug 2006 00:15:00 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Email security]]></category>
		<category><![CDATA[milter]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[sendmail]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/2006/08/postfix-now-supports-milter-2/</guid>
		<description><![CDATA[This is not quite breaking news, but I thought it worth noting that the latest production version of the Postfix mailer now officially supports the Sendmail &#34;milter&#34; API. This opens the world&#8217;s best mailer to a world of added functionality that previously was restricted to the Sendmail MTA.
Personally I&#8217;m conflicted about this. On the positive [...]]]></description>
			<content:encoded><![CDATA[<p>This is not quite breaking news, but I thought it worth noting that the latest production version of the <a href="http://www.postfix.org/" title="Postfix secure mail transport agent">Postfix</a> mailer now officially supports the <a href="http://www.sendmail.com/" title="Sendmail MTA">Sendmail</a> &quot;milter&quot; API. This opens the world&#8217;s best mailer to a world of added functionality that previously was restricted to the Sendmail MTA.</p>
<p>Personally I&#8217;m conflicted about this. On the positive side, many email security add-ons that only worked with Sendmail can now also be used by Postfix. On the negative, there&#8217;s now further incentive for developers to keep writing for the milter API, keeping the crawling horror that is Sendmail alive for even more years.</p>
<p>We replaced Sendmail with Postfix on our mail servers and started installing it for clients back in 2001, and what a joy the past five years have been. Finally&#8230; a mailer with a secure architecture that&#8217;s fast and easy to configure. No more of the intentionally obtuse &quot;explosion in a punctuation factory&quot; syntax that Sendmail forces admins to endure and with an <a href="http://www.postfix.org/security.html" title="Postfix internal architecture">outstanding architecture</a>, far less chance of root compromise than with Sendmail&#8217;s monolithic &quot;runs as root&quot; design.</p>
<p><span id="more-29"></span>As a bonus, Postfix  is sponsored by IBM, making it easier to sell to management types, and it&#8217;s written by security pioneer Weitse Venema, author of TCP wrappers and co-author of <a href="http://www.porcupine.org/forensics/tct.html" title="The Coroner's Toolkit computer forensics tool">The Coroner&#8217;s Toolkit</a> (forensics tool) and <a href="http://www.porcupine.org/satan/" title="SATAN vulnerability scanner">SATAN</a> (one of the first vulnerability scanners).</p>
<p>One small problem with ditching Sendmail was giving up add-ons like <a href="http://www.mimedefang.org/" title="MIMEDefang email filter">MIMEDefang</a> that use the Sendmail-only &quot;milter&quot; API. <a href="http://mailtools.anomy.net/" title="Anomy Sanitizer">Alternatives</a> existed, and of course it was always an option to run Sendmail behind the protection of Postfix as a sort of massively clunky inline filter, but when you&#8217;re building email firewalls no one wants software with the security history of Sendmail anywhere near it.</p>
<p>As you might expect, the milter feature of Postfix comes with a <a href="http://www.postfix.org/MILTER_README.html">list of caveats and gotchas</a>. Not every milter in the world will work (including, I suspect, MIMEDefang). Still, popular ones like <a href="http://sourceforge.net/projects/dk-milter/">domainkeys-milter</a> which adds Yahoo&#8217;s <a href="http://antispam.yahoo.com/domainkeys">DomainKeys</a> anti-spam capabilities apparently work. Some developers like <a href="http://www.snertsoft.com/">Snertsoft</a> have even starting writing milters <a href="http://www.milter.org/archives/001793.php">with Postfix compatibility in mind</a>.</p>
<p>Perhaps rather than extend the life of Sendmail, this new feature will have the opposite effect and make it easier for admins to finally upgrade to Postfix. If all that&#8217;s stopping them are things like lack of DomainKeys support, maybe someday  the need to absorb <a href="http://www.oreilly.com/catalog/sendmail3/" title="O'Reilly Sendmail reference">1232-page books</a> to figure out syntax like &quot;R$* &lt; @ $* .$m. &gt; $*&quot; just to get email working will become a thing of the past.</p>
Copyright &copy; 2010 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2006/04/address-extensions/' rel='bookmark' title='Permanent Link: A simple tool to track and control spammers'>A simple tool to track and control spammers</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2006/08/postfix-supports-milter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A simple tool to track and control spammers</title>
		<link>http://advosys.ca/viewpoints/2006/04/address-extensions/</link>
		<comments>http://advosys.ca/viewpoints/2006/04/address-extensions/#comments</comments>
		<pubDate>Fri, 21 Apr 2006 15:05:40 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Email security]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/2006/04/address-extensions/</guid>
		<description><![CDATA[You trustingly sign up on a web site using your valuable main e-mail address, get what you need then forget about it.

Weeks later, spam starts arriving with details you provided in that registration. The web site lied! They did sell your registration info to some scumbag or are spamming you themselves.

There is a feature supported by almost all mail servers that lets you give out a unique e-mail address to anyone who asks, yet have messages all wind up in your regular e-mail box. No more checking web mail accounts! Further, if your mail administrator allows blocking, if the address is abused you can forever reject mail to that address before it gets in.]]></description>
			<content:encoded><![CDATA[<p>
You&#8217;ve probably experienced the scenario: you want to access a web page or download a file on a site that requires &#8220;free registration&#8221;. The site promises to never use the e-mail address you provide for spam, or to sell it to spammers.
</p>
<p>
You trustingly sign up using your valuable main e-mail address, get what you need then forget about it.
</p>
<p>
Weeks later, spam starts arriving with details you provided in that registration. The web site lied! They <em>did</em> sell your registration info to some scumbag or are spamming you themselves.
</p>
<p>
With the damage done, your main e-mail address that once got very little spam is suddenly inundated with wonderful opportunities for mortgage refinancing, genital enhancement and vacation specials. Once your personal e-mail address starts circulating, it&#8217;s impossible to put the genie back in the bottle.
</p>
<p>
<span id="more-7"></span>Some people in this situation abandon their once private e-mail address for a new one, then a year later ditch that one when it winds up on spam lists. Others never reveal their &#8220;real&#8221; e-mail address in favor of using throw-away addresses such as free web mail accounts like Yahoo or  disposable mail services like <a href="http://mailinator.com/" target="_blank">Mailinator</a>.
</p>
<p>
It&#8217;s impossible to tell which web sites can be trusted to keep your information private. Some will never abuse your e-mail address, but for many the demands from the marketing division or temptation to make a quick buck selling the data to &#8220;opt-in marketers&#8221; is overwhelming.
</p>
<p>
Further, in some jurisdictions including the U.S., customer lists including e-mail addresses are  considered corporate assets. Shareholders can demand selling the lists if a profit can be made. Insolvent companies have also been forced to sell their lists despite privacy policies and their own wishes to protect customers, such as during the infamous <a href="http://www.eweek.com/article2/0,1895,1242583,00.asp" target="_blank">eToys debacle of 2001</a>.
</p>
<p>
Also, it&#8217;s often impossible to conclusively prove a specific organization has violated your trust. Anyone you&#8217;ve given your one e-mail address to could be guilty.
</p>
<p>
There is a feature supported by almost all mail servers that lets you give out a unique e-mail address to anyone who asks, yet have messages all wind up in your regular e-mail box. No more checking web mail accounts! Further, if your mail administrator allows blocking, if the address is abused you can forever reject mail to that address before it gets in.
</p>
<p>
The feature is called &#8220;address extensions&#8221; and has been available in Sendmail, Postfix and almost every other mail server for years.
</p>
<p>
A typical address extension looks like this:
</p>
<div align="center">
username+extension@example.com
</div>
<p>
A symbol, usually a plus sign, separates your regular e-mail name from a throwaway portion. The throwaway portion is ignored by the mailer when delivering the message&#8230; all mail is delivered as if the extension was not there. However, with most mailers the full address with extension still shows up in your mail client, and can be rejected at the mail server.
</p>
<p>
You can test your own mail server now to see if it accepts this form of addressing. Send an extended address message to yourself using a web mail service or other external mail system and see if it shows up in your inbox.
</p>
<p>
We&#8217;ve been using mail extensions for years to provide unique e-mail addresses to questionable organizations, web site registration forms and the like. For example, when registering on the New York Times to be able to read an article, we might provide the address &#8220;jsmith+nytimes@advosys.ca&#8221;. If that venerable institution starts spamming the address, we can block it at the mail server. We also have proof who it was who abused our trust and can take action.
</p>
<p>
Blocking at the mail server is best. If the mail server rejects the message during the SMTP &#8220;envelope&#8221; phase (i.e. the &#8220;RCPT TO:&#8221; command), the spam is rejected before the message body is even sent. The sender gets a delivery failure error, even if they&#8217;ve forged the sender address (like almost all spammers do).
</p>
<p>
If you can&#8217;t block at the mail server, most mail clients allow creation of rules to automatically delete messages containing specific  headers. This prevents you from seeing the spam, but your mail server and network resources are still abused. Also, the spammer will not see a rejection message and will keep sending.
</p>
<p>
Note that hardcore spam operations get paid per message accepted by the destination, so deleting spam in your mail client may result in rewarding the spammer with money. Blocking at the mail server is preferable.
</p>
<p>
Spammers are unethical scum, but they are very devoted to circumventing spam blocks. Some spammers are aware of the &#8220;plus sign&#8221; form of address extension and strip that portion from addresses they collect.
</p>
<p>
You can reduce the chance of that by using a less common character. For example, many organizations use periods, dashes or underscores in e-mail addresses (&#8220;john.smith@example.com&#8221;, &#8220;smith_j@example.org&#8221;). If possible, change your mail server to use one of those characters for address extensions instead of the plus sign. Since so many legitimate e-mail addresses use those characters, spammers are far less likely to filter them from their spam lists.
</p>
<p>
In the <a href="http://www.postfix.org/" target="_blank" title="Postfix - a secure and easy to use mailer">Postfix MTA</a>, the extension character can be specified using the <a href="http://www.postfix.org/postconf.5.html#recipient_delimiter" target="_blank">recipient_delimiter</a> setting in the main.cf file. Similar settings are available in Qmail and other popular SMTP servers, though apparently in Sendmail the plus character is hard coded.
</p>
<p>
<strong>Downside</strong>
</p>
<p>
One potential downside to address extensions is it could open your mailer to certain forms of abuse. If a spammer determines you are using extensions they  may abuse the feature to send you huge volumes of mail. Some spam reduction filters block senders automatically when they exceed a threshold of messages to the same address. Unless such a filter is also aware of the extensions, it may allow allow the spammer to use random extension addresses to flood recipients.
</p>
<p>
However, most mail filters block senders that exceed a threshold regardless of recipient address. Also, spammers rarely craft exploits targeted at specific organizations, except for obvious huge targets such as Hotmail and AOL. Unless your organization has millions of e-mail users or a spammer has a vendetta specifically against you, a targeted attack is unlikely.
</p>
<p>
Regardless, it&#8217;s wise to test the behaviour of your specific mailer&#8217;s filtering functions before implementing address extensions, just in case.
</p>
<h4>Summary</h4>
<p>
Using addresses extensions to provide unique e-mail addresses can help identify who abused the address provided and block the address once it starts to be spammed.
</p>
<p>
Almost all mailers support address extensions, usually using the form &#8220;username+extension@domain.com&#8221;
</p>
<p>
Blocking an abused address is best done at the server by rejecting the  message during the SMTP conversation. If that&#8217;s not possible, most email client software have filters that can delete mail containing specific headers on arrival.
</p>
<p>
Since spammers know about address extensions using the plus sign, your mailer should be configured to use something common in other organization&#8217;s e-mail addresses, such as a dash, underscore or period.
</p>
<h4>Conclusion</h4>
<p>
This technique is a simple and widely available way to give out unique aliases for your regular email address that you can track and block if abused. It&#8217;s more convenient than setting up disposable web mail accounts, and more permanent that using disposable e-mail services such as Mailinator.
</p>
<p>
Used in conjunction with other spam reduction techniques, address extensions can significantly reduce the spam you receive. It gives you the recipient more control over your inbox and an ability to determine for certain who has abused your private information.</p>
Copyright &copy; 2010 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2006/10/icann-comments-on-spamhaus/' rel='bookmark' title='Permanent Link: ICANN speaks up on Spamhaus litigation'>ICANN speaks up on Spamhaus litigation</a></li>
<li><a href='http://advosys.ca/viewpoints/2007/07/spamassassin-p0f-plugin-catches-bot-spam/' rel='bookmark' title='Permanent Link: SpamAssassin p0f plugin catches bot spam'>SpamAssassin p0f plugin catches bot spam</a></li>
<li><a href='http://advosys.ca/viewpoints/2006/10/spamhaus-saved/' rel='bookmark' title='Permanent Link: Court declines to suspend Spamhaus domain'>Court declines to suspend Spamhaus domain</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2006/04/address-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
