<?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>Christopher J. Buckley &#187; postfix</title>
	<atom:link href="http://www.cjbuckley.net/blog/tag/postfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cjbuckley.net/blog</link>
	<description>Free-Software, GNU/Linux, Traffic Management &#38; Thoughts</description>
	<lastBuildDate>Mon, 16 Mar 2009 16:18:28 +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>Postfix: $relayhost and port 587</title>
		<link>http://www.cjbuckley.net/blog/2007/08/23/postfix-relayhost-and-port-587/</link>
		<comments>http://www.cjbuckley.net/blog/2007/08/23/postfix-relayhost-and-port-587/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 15:30:37 +0000</pubDate>
		<dc:creator>Christopher Buckley</dc:creator>
				<category><![CDATA[MailServer]]></category>
		<category><![CDATA[DKIM]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.cjbuckley.net/blog/2007/08/23/postfix-relayhost-and-port-587/</guid>
		<description><![CDATA[This quick article concerns using the relayhost variable to allow postfix to relay into the submission port (587), rather than the smtp port (25).
When using a separated tier network of postfix servers, ie &#8211; a cluster at the front, which receive from a cluster in a segmented network, you will need to use the relayhost [...]]]></description>
			<content:encoded><![CDATA[<p>This quick article concerns using the <tt>relayhost</tt> variable to allow <a href="http://www.postfix.org/">postfix</a> to relay into the <a href="http://www.faqs.org/rfcs/rfc2476.html">submission port</a> (587), rather than the <a href="http://www.faqs.org/rfcs/rfc2821.html">smtp port</a> (25).</p>
<p>When using a separated tier network of postfix servers, ie &#8211; a cluster at the front, which receive from a cluster in a segmented network, you will need to use the <tt>relayhost</tt> variable to daisy link the two clusters together.  Usually, you may be tempted to simply submit on port 25.  This was previously acceptable, but now a concerted drive is being made towards the correct port &#8211; 587.  When using <a href="http://en.wikipedia.org/wiki/DKIM">DKIM</a> implementations such as <a href="http://jason.long.name/dkimproxy/">DKIM proxy </a> mail will not be signed on port 25 without some hackery in master.cf [<u>this is strongly advised against</u>].  As Jason states:</p>
<blockquote><p>
. . .The point is we don&#8217;t want to sign mail from untrusted sources, and that&#8217;s what could happen if you direct that mail through dkimproxy.out.
</p></blockquote>
<p>So how do we ensure our chain of servers signs mail submitted?  Easy!</p>
<pre>
relayhost = [smtp.domain.tld]:587
</pre>
<p>You can now sit back and watch as all your mail is digitally signed by what-ever DKIM implementation you have chosen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cjbuckley.net/blog/2007/08/23/postfix-relayhost-and-port-587/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SpamAssassin: How to protect against current spam attacks</title>
		<link>http://www.cjbuckley.net/blog/2007/08/20/spamassassin-how-to-protect-against-current-spam-attacks/</link>
		<comments>http://www.cjbuckley.net/blog/2007/08/20/spamassassin-how-to-protect-against-current-spam-attacks/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 17:26:44 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[MailServer]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mailscanner]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spamassassin]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.cjbuckley.net/blog/2007/08/20/spamassassin-how-to-protect-against-current-spam-attacks/</guid>
		<description><![CDATA[Currently, there are four major spam attacks postmasters are being faced with.  They include, but are not limited to:

PDF &#038; FDF: usually a blank e-mail with a PDF attachment.
Greeting Card: invitations from an &#8216;old friend&#8217; to go to a website with a numerical http address, usually containing malware.
Image Spam: A gif or png attached [...]]]></description>
			<content:encoded><![CDATA[<p>Currently, there are four major spam attacks postmasters are being faced with.  They include, but are not limited to:</p>
<ul>
<li><strong>PDF &#038; FDF:</strong> usually a blank e-mail with a PDF attachment.</li>
<li><strong>Greeting Card:</strong> invitations from an &#8216;old friend&#8217; to go to a website with a numerical http address, usually containing malware.</li>
<li><strong>Image Spam:</strong> A gif or png attached to a, usually &#8211; though not always, blank e-mail ready to sell the latest software or stock.</li>
<li><strong>Obfuscate Words:</strong> Lines of text take this format, <tt>N o*t o,n-l-y d o-e's t,h+i s f i+r*m h+a'v_e grea_t fundamenta,ls*,</tt>.
</li>
</ul>
<p>I&#8217;m going to show you how using the <a href="http://en.wikipedia.org/wiki/Free_software">free-software</a> package, <a href="http://spamassassin.apache.org/">SpamAssassin</a>, you can successfully neuter these 4 major spam attacks.</p>
<ul>
<li><strong>Greeting Card:</strong> Can be easily defeated using <a href="http://www.impsec.org/~jhardin/antispam/postcards.cf">postcards.cf</a>.</li>
<li><strong>Image Spam:</strong> These quickly become extremely popular, but have now decreased in prevalence after very successful methods were implemented to combat them.  For SA, use the module <a href="http://www.rulesemporium.com/plugins.htm">Imageinfo</a>: <a href="http://www.rulesemporium.com/plugins/ImageInfo.pm">Imageinfo.pm </a> and <a href="http://www.rulesemporium.com/plugins/imageinfo.cf">Imageinfo.cf </a> supplied by <a href="http://www.rulesemporium.com/plugins.htm">SARE Rules Emporium</a>.</li>
<li><strong>PDF &#038; FDF:</strong> Can be successfully discarded by using <a href="http://www.rulesemporium.com/plugins/PDFInfo.pm">PDFInfo.pm</a> and <a href="http://www.rulesemporium.com/plugins/pdfinfo.cf">PDFInfo.cf</a> again supplied by <a href="http://www.rulesemporium.com/plugins.htm">SARE Rules Emporium</a>.</li>
<li><strong>Obfuscate Words:</strong> These have recently hit, and hit hard.  Spammers, seemingly bewildered by their inability to get through current filters using the above popular methods, have now resorted to the old way of securing spam delivery: obfuscation.  The good news is that this, again, is easily defeatable.  The ruleset(s) originally written by <a href="http://www.emtinc.net/spamhammers.htm">Jennifer Wheeler</a> are mirrored locally by this site.
<ol>
<li><a href="/uploads/spam-filters/chickenpox.cf">chickenpox.cf</a>: [words obfuscated by non word characters] <b>Th</b>1<b>s</b>|<b>s</b> <b>a</b> <b>v</b>3<b>ry</b> <b>h</b>4<b>ndy</b> <b>se</b>7 <b>t</b>0 <b>c</b>@<b>tch</b> <b>th</b>!<b>s</b> 50<b>rt</b> 0<b>f</b> (<b>rap</b>.
            </li>
<li><a href="/uploads/spam-filters/backhair.cf">backhair.cf</a>: [words obfuscated by nonsense html tags]&nbsp;<br />
<b>Y</b><font color="#FF00FF">&lt;oivugriub&gt;</font><b>ou</b><b>cou</b><font color="#FF00FF">&lt;iuqgheriugv9h&gt;</font><b>ld</b> <b>rea</b><font color="#FF00FF">&lt;y&gt;</font><b>lly</b><b>u</b><font color="#FF00FF">&lt;owiuer88&gt;</font><b>se</b> <b>this</b>.
           </li>
</ol>
</li>
</ul>
<p>Game on, spammers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cjbuckley.net/blog/2007/08/20/spamassassin-how-to-protect-against-current-spam-attacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RT, Postfix &amp; Virtual Domains: Problems faced and a solution!</title>
		<link>http://www.cjbuckley.net/blog/2007/08/19/rt-postfix/</link>
		<comments>http://www.cjbuckley.net/blog/2007/08/19/rt-postfix/#comments</comments>
		<pubDate>Sun, 19 Aug 2007 04:59:56 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[MailServer]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[Request Tracker]]></category>
		<category><![CDATA[Rewrite]]></category>
		<category><![CDATA[RT]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Virtual Domains]]></category>

		<guid isPermaLink="false">http://www.cjbuckley.net/blog/2007/08/19/rt-postfix/</guid>
		<description><![CDATA[Request Tracker is an enterprise grade ticketing system developed by Best Practical. RT is used by Fortune 100 companies, government agencies, educational institutions, and development organizations worldwide.  Many implementations of RT run behind the Postfix mail-server.
The RT wiki has instructions on setting up your MTA to &#8216;pipe&#8217; the e-mails into RT:
You need to tell [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bestpractical.com/rt/">Request Tracker</a> is an enterprise grade ticketing system developed by Best Practical. RT is used by Fortune 100 companies, government agencies, educational institutions, and development organizations worldwide.  Many implementations of RT run behind the <a href="http://www.postfix.org/">Postfix</a> mail-server.</p>
<p>The <a href="http://wiki.bestpractical.com/view/ManualInstallation">RT wiki</a> has instructions on setting up your MTA to &#8216;pipe&#8217; the e-mails into RT:</p>
<p>You need to tell your Mail Transfer Agent (ex sendmail, postfix, or qmail) how to forward messages to RT&#8217;s mail gateway. To do this, create an aliases in your system&#8217;s mail aliases file. Here&#8217;s an example, which routes mail to the mailbox [=rt@example.com] (and [=rt-comment@example.com]) into new tickets in the RT queue named General. Note that the queue name is case-insensitive.</p>
<p>Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):</p>
<p><tt>rt: "|/opt/rt3/bin/rt-mailgate --queue general --action correspond --url http://localhost/rt"<br />
rt-comment: "|/opt/rt3/bin/rt-mailgate --queue general --action comment --url http://localhost/rt"<br />
</tt><br />
These instructions are accurate, but rely on Postfix not having implemented <a href="http://www.postfix.org/VIRTUAL_README.html">Virtual Domains</a>.  Here&#8217;s an example configurationfrom <tt>main.cf</tt> where virtual domains have been implemented:</p>
<p><tt>virtual_transport = virtual<br />
virtual_uid_maps = static:5000<br />
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf<br />
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf<br />
</tt></p>
<p>This configuration will invoke the <tt><a href="http://www.postfix.org/virtual.8.html">virtual</a></tt> transport within Postfix.  A <tt>virtual</tt> transport is unable to perform the necessary <tt><a href="http://en.wikipedia.org/wiki/Vertical_bar">pipe</a></tt> (&#8220;|&#8221;) to the <tt><a href="http://linux.die.net/man/1/rt-mailgate">rt-mailgate</a></tt> binary.  Only the <tt><a href="http://www.postfix.org/local.8.html">local</a></tt> transport is able to perform a <tt>pipe</tt>. So, the question is: <u>how do we run virtual domain(s), but still invoke the <tt>local</tt> transport delivery method to successfully perform the <tt>pipe</tt> into <tt>rt-mailgate</tt>?</u></p>
<h2>A Virtual to Local Rewrite Solution</h2>
<p>Here&#8217;s a quick walkthrough on what steps you need to put in place to ensure that a mail to the (virtual) domain of  rt-test@domain.tld is successfully piped as per the RT wiki instructions above.  </p>
<ol>
<li>Create an <tt>/etc/postfix/aliases</tt> file.</li>
<li>Within this file add entries that follow this format:
<pre>
rt-test                       rt@rt.domain.tld
support                       support@rt.domain.tld
abuse                         abuse@rt.domain.tld
# and so on...
</pre>
</li>
<li><tt><a href="http://www.postfix.org/postmap.1.html">postmap</a> /etc/postfix/aliases</tt></li>
<li>Within <tt>/etc/aliases</tt> create the pipe aliases referred to in the RT wiki:
<pre>
support: "|/opt/rt3/bin/rt-mailgate --queue 'Support' --action &#92;
correspond --url http://rt.domain.tld/"
rt: "|/opt/bin/rt-mailgate --queue 'General' --action &#92;
correspond --url http://rt.domain.tld/"
abuse: "|/opt/rt3/bin/rt-mailgate --queue 'Abuse'  --action &#92;
correspond --url http://rt.domain.tld/"
# Ensure there are no line breaks..
</pre>
</li>
<li>Run the <tt><a href="http://linux.about.com/library/cmd/blcmdl1_newaliases.htm">newaliases</a></tt> command.</li>
<li>Insert the appropriate configuration amendments to <tt>main.cf</tt>
<pre>
# To ensure <tt>local</tt> delivery, <tt>rt.domain.tld</tt> must be added to
# <tt><a href="http://www.postfix.org/basic.html">$mydestination</a></tt>
mydestination = localhost localhost.localdomain rt.domain.tld
# <tt>/etc/postfix/aliases</tt> is added:
virtual_alias_maps = hash:/etc/postfix/aliases
mysql:/etc/postfix/mysql_virtual_alias_maps.cf
# alias_maps is what is READ by delivery agents etc.
alias_maps = hash:/etc/aliases
# alias_databases is what is WRITTEN by newaliases
alias_database = hash:/etc/aliases
# masquerade as @rt.example.com unless also on this list,never root
masquerade_domains = rt.domain.tld
masquerade_exceptions = root
</pre>
</li>
<li>Save the file, then reload Postfix&#8217;s configuration: <tt>/etc/init.d/postfix reload</tt></li>
<li>Send an e-mail to <tt>support@domain.tld</tt> and observe Postfix working its wonders..<br />
<tt><br />
Aug 19 21:12:18 solo postfix/local[2972]: 2B91710EB92: to=&lt;support @rt.domain.tld&gt;, orig_to=&lt;support@cjbuckley.net&gt;, relay=local, delay=17, delays=17/0.05/0/0.54, dsn=2.0.0, status=sent (delivered to command: /opt/rt3/bin/rt-mailgate --queue 'Support' --action correspond --url http://rt.domain.tld/)</tt></li>
</ol>
<p>I wrote this article mainly because I see the question oft repeated on the <a href="http://archives.neohapsis.com/archives/postfix/">Postfix Users Mailing List</a>.   Any comments and (especially) improvements welcome. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cjbuckley.net/blog/2007/08/19/rt-postfix/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
