<?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>unixwiz &#187; exim</title>
	<atom:link href="http://blogs.sungeek.net/unixwiz/tag/exim/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.sungeek.net/unixwiz</link>
	<description>anything dealing with *NIX or what ever I want to write about</description>
	<lastBuildDate>Wed, 04 Aug 2010 03:04:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Spam filtering with EXIM/SpamAssassin and Procmail</title>
		<link>http://blogs.sungeek.net/unixwiz/2006/07/26/spam-filtering-with-eximspamassassin-and-procmail/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2006/07/26/spam-filtering-with-eximspamassassin-and-procmail/#comments</comments>
		<pubDate>Thu, 27 Jul 2006 03:59:33 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Spam Fighting]]></category>
		<category><![CDATA[exim]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=621</guid>
		<description><![CDATA[For others who may be intersted. (Note this is what I did on a Solaris 10 machine) I also already had EXIM configured with SpamAssassin to put [SPAM] in the subject if the message was &#8220;spam&#8221;. This also assumes that the IMAP mailbox directory is the mail directory in the users home directory. Here is [...]]]></description>
			<content:encoded><![CDATA[<p>For others who may be intersted. (Note this is what I did on a Solaris 10 machine) I also already had EXIM configured with SpamAssassin to put [SPAM] in the subject if the message was &#8220;spam&#8221;. This also assumes that the IMAP mailbox directory is the mail directory in the users home directory.</p>
<p>Here is what you need to do:</p>
<p>1. Install procmail,  (I get it from blastwave, as I did exim,spamassassin, and clamav):</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">su</span> &#8211; root<br />
<span class="kw3">cd</span> /opt/csw/bin<br />
./pkg-get -i <span class="kw2">procmail</span></div>
</div>
<p>2. Configure exim to handle procmail pipes.<br />
a. make a backup copy of /opt/csw/etc/exim/exim.conf<br />
b. In the &#8220;routers&#8221; sections of the exim.conf, right above the localuser:  line add the following:</p>
<div class="codesnip-container" >
<pre>
procmail:
 debug_print = "R: procmail for $local_part@$domain"
 driver = accept
 domains = +local_domains
 check_local_user
 transport = procmail_pipe
 require_files = ${local_part}: \\
               ${if exists{/etc/procmailrc}\\
                 { /etc/procmailrc}{${home}/.procmailrc}}:\\
               +/opt/csw/bin/procmail
 no_verify
 no_expn
</pre>
</div>
<p>exactly how I have it above</p>
<p>c. In the transports section right below the 2 lines that say:</p>
<div class="codesnip-container" >remote_smtp:<br />
 driver = smtp</div>
<p>add in this :</p>
<div class="codesnip-container" >
<pre>
procmail_pipe:
 debug_print = "T: procmail_pipe for $local_part@$domain"
 driver = pipe
 path = "/opt/csw/bin:/bin:/usr/bin"
 command = "/opt/csw/bin/procmail"
 return_path_add
 delivery_date_add
 envelope_to_add
</pre>
</div>
<p>e. Now restart exim:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">/etc/init.d/cswexim stop; /etc/init.d/cswexim start</div>
</div>
<p>3. Setup a .procmailrc in the users home directory and make sure it is owned by the user, this is what I had in my test user&#8217;s .procmailrc file:</p>
<div class="codesnip-container" >VERBOSE=no<br />
MAILDIR=/home/testuser/mail</p>
<p>#:0:    #Delete spam messages<br />
#* ^Subject: \[SPAM]<br />
#/dev/null<br />
:0:     #Delete spam messages<br />
* ^Subject: \[SPAM]<br />
Spam</p></div>
<p>the first set will just delete the messages if they contain [SPAM] in the subject, and they are commented out. The second set will put the messages in the Spam folder. You can replace the Spam with Junk if you want. Make sure the mail directory exists in the home directory and it owned by the user. The Junk/Spam folder will automatically be created if it does not exist the first time a spam message comes in..</p>
<p>Should be it. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2006/07/26/spam-filtering-with-eximspamassassin-and-procmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>exim + TLS + solaris 10</title>
		<link>http://blogs.sungeek.net/unixwiz/2005/11/29/exim-tls-solaris-10/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2005/11/29/exim-tls-solaris-10/#comments</comments>
		<pubDate>Wed, 30 Nov 2005 04:32:24 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[exim]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=453</guid>
		<description><![CDATA[Not long ago I decided to set up an authenicated email server so people off campus could send email through campus servers. The old way would have been an open relay, which is very bad. So I decided to start looking at TLS authenication. Well the default Sendmail that comes with Solaris 10 does not [...]]]></description>
			<content:encoded><![CDATA[<p>Not long ago I decided to set up an authenicated email server so people off campus could send email through campus servers. The old way would have been an open relay, which is very bad. So I decided to start looking at TLS authenication. Well the default Sendmail that comes with Solaris 10 does not have TLS authenication. So I decided to disable sendmail and install exim..</p>
<p>To disable sendmail on Solaris 10:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">svcadm disable sendmail</div>
</div>
<p>Then I installed Exim from the <a href="http://www.blastwave.org">Blastwave Software library</a> which is really as easy as :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">/opt/csw/bin/pkg-get -i exim</div>
</div>
<p> (of course this assumes that you have the pkg-get package installed if not, download and install it. The wonders of pkg-get is that it will download all the dependencies as well.</p>
<p>The changes I made are as follows:</p>
<p>Under the Main Configuration block, I added:</p>
<div class="codesnip-container" >tls_on_connect_ports = 465<br />
daemon_smtp_ports = 25:465</div>
<p>Which allows exim to listen on both port 25 and port 465.</p>
<p>I then changed the
<div class="codesnip-container" >rfc1413_query_timeout = 30s</div>
<p> to
<div class="codesnip-container" >rfc1413_query_timeout = 0s</div>
<p> which disables ident lookups, (we don&#8217;t allow them).</p>
<p>The last change to the main config section is :</p>
<div class="codesnip-container" >#SSL stuff<br />
tls_certificate = /opt/csw/etc/exim/exim.cert<br />
tls_privatekey = /opt/csw/etc/exim/exim.key<br />
tls_advertise_hosts = *<br />
auth_advertise_hosts = ${if eq{$tls_cipher}{}{}{*}}</div>
<p>Which defines the SSL cert/key and that it should always advertise auth/tls..</p>
<p>Next up is the ACL Configuration, I added this under the &#8220;begin acl&#8221;</p>
<div class="codesnip-container" >acl_check_auth:<br />
        accept encrypted = *<br />
        accept condition = ${if($tls_cipher)}<br />
        deny message = TLS encryption ONLY</div>
<p>Which makes it so only encrypted authenicated connections will work.</p>
<p>The next change was in the routers section. I wanted the exim server to pass all mail to our spam/virus scanner and not to talk to any other mail server so I added this:</p>
<div class="codesnip-container" >send_to_gateway:<br />
  driver = manualroute<br />
  transport = remote_smtp<br />
  route_list = * SMTP.somehost.edu</div>
<p>The next change I did was comment out the following:</p>
<div class="codesnip-container" >#local_delivery:<br />
  #driver = appendfile<br />
  #file = /var/mail/$local_part<br />
  #delivery_date_add<br />
  #envelope_to_add<br />
  #return_path_add<br />
# group = mail<br />
# mode = 0660</p>
<p>#address_pipe:<br />
  #driver = pipe<br />
  #return_output</p>
<p>#address_file:<br />
  #driver = appendfile<br />
  #delivery_date_add<br />
  #envelope_to_add<br />
  #return_path_add</p>
<p>#address_reply:<br />
  #driver = autoreply</p></div>
<p>The final change I made was to use ldap authenication. So I added this to the Authenication Configuration section:</p>
<div class="codesnip-container" >begin authenticators</p>
<p>BASEDN=ou=people,dc=someplace,dc=edu</p>
<p>login:<br />
  driver = plaintext<br />
  public_name = LOGIN<br />
  server_prompts = &#8220;Username:: : Password::&#8221;<br />
  server_condition = &#8220;${lookup ldap{user=uid=$1,BASEDN pass=$2 ldap://ldap.server.edu/BASEDN?uid?sub?(uid=$1)}{yes}fail}&#8221;<br />
  server_set_id = $1</p></div>
<p>One <strong>important note</strong> Make sure you leave Username:: : Password:: as that and that you do not change it. It seems that Microsoft has hardcoded those values in as the prompts for username and password in Microsoft Outlook and Outlook Express. So if you make those anything other than Username: and Password: those two clients will NOT work, and you will get some weird base64 error codes back. It took me a couple of hours to figure out why Thunderbird worked and Outbreak didn&#8217;t. That was it. What you have now is a SMTP server that only accepts mail from authenicated clients and which  forwards all mail to a central hub. Hope this helps other people, it took me a while to get it setup. Another side note, if you use Symantec Antivirus on MS Windows (probably on OSX as well) and have the Email Auto-Protect enabled, you will never be able to send mail out on port 25 if it is encrypted (in this case it is) as Symantec blocks all encrypted mail as it can&#8217;t &#8220;scan&#8221; it.</p>
<p>One final note, to provide some &#8220;HA&#8221; to this setup I have two identical setups of Exim in 2 different buildings on 2 different networks. They both use the same SSL Cert/Key and are setup in a DNS RR to answer up to the same hostname.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Solaris" rel="tag">Solaris</a>, <a href="http://technorati.com/tag/Exim" rel="tag"> Exim</a>, <a href="http://technorati.com/tag/TLS" rel="tag"> TLS</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2005/11/29/exim-tls-solaris-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
