Penguin
Diff: EximMailFilter
EditPageHistoryDiffInfoLikePages

Differences between current version and predecessor to the previous major change of EximMailFilter.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 24 Last edited on Monday, November 20, 2006 9:27:10 am by CraigBox
Older page: version 22 Last edited on Thursday, November 17, 2005 11:17:41 am by CraigBox Revert
@@ -1,17 +1,19 @@
-!!!How to make your Debian machine an amazing [Exim] 4 mail filter 
+!!!How to make your Debian or Ubuntu machine an amazing [Exim] 4 mail filter 
  
 This is how I've set up a new exim4 installation to do all the filtering I used to do with MailScanner or amavis. It's much less CPU intensive to use the daemon mode of SpamAssassin and have your MTA do all the work instead of a big perl script. 
  
 There are a number of changes that aren't immediately apparent between using exim3 and exim4 on Debian: the configuration system is completely different. You either have a large configuration template file or a number of small files, but either way, the live config isn't updated until you run __update-exim4.conf__. Running an /etc/init.d/exim4 restart will run this command for you. 
  
 !!Get exim4 
  
-!Sarge 
+!Sarge/Dapper  
  
-=apt-get install exim4-daemon-heavy clamav-daemon clamav-freshclam spamassassin= (add more or less as required) 
+=apt-get install exim4-daemon-heavy clamav-daemon clamav-freshclam spamassassin= (add more or less as required.
  
 !Woody 
+  
+You can only go as far as Exim 4.34, so you should really consider moving to Sarge.  
  
 Add these lines to your apt sources.list: 
  
 <pre> 
@@ -166,15 +168,17 @@
  
  accept 
  condition = ${if <{$message_size}{100k}{1}{0}} 
  spam = nobody 
- set acl_m1 = "postmaster@itpartners .co.nz" 
+ set acl_m1 = "postmaster@yoursite .co.nz" 
  #delay = 60s 
  control = fakereject 
  logwrite = :main,reject: This message scored $spam_score spam points. Please contact postmaster 
 </verbatim> 
  
 "nobody:true" matches everyone (the nobody is the user to call SpamAssassin as; as we're always using the same one the result is cached per message). Make sure you always check the message size before calling "spam" else you will end up passing huge messages to SA. 
+  
+Change the acl_m1 to refer to your postmaster. Strangely, [not everyone|http://www.mynetcomng.com/] picks up on this.  
  
 In order to get a small sensible spam report instead of the huge default SpamAssassin one, put this in your /etc/spamassassin/local.cf: 
  
 <pre> 
@@ -183,8 +187,10 @@
  version=_VERSION_" 
 </pre> 
  
 !!MIME errors & file attachments 
+  
+! Pre-Exim 4.50  
  
 Noone wants to receive executable file attachments: in acl/40_exim4-config_check_data.rul 
  
 <pre> 
@@ -202,14 +208,36 @@
  deny message = Serious MIME defect detected ($demime_reason) 
  demime = * 
  condition = ${if >{$demime_errorlevel}{2}{1}{0}} 
 </pre> 
+  
+! Exim 4.50 and higher  
  
 Recent exiscans (including the one included with Exim 4.50) have deprecated demime, instead adding a acl_smtp_mime ACL. This is more powerful than the precvious demime, but as always, is more complex to get the above features. 
  
-See http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20050523/msg00117.html for a thread on this. (there are many typo's in the original post that are fixed below) . Add something like the following: 
+This example was originally built from [an acl_smtp_mime thread on exim-users| http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20050523/msg00117.html], but many typos have been corrected .  
+  
+ Add something like the following:  
+  
+In main/02_exim4-config_options.rul
  
 <pre> 
+# itp: define MIME ACL  
+#  
+.ifndef MAIN_ACL_CHECK_MIME  
+MAIN_ACL_CHECK_MIME = acl_check_mime  
+.endif  
+acl_smtp_mime = MAIN_ACL_CHECK_MIME  
+</pre>  
+  
+Create acl/50_exim4-config_check_mime:  
+  
+<pre>  
+### acl/50_exim4-config_check_mime  
+##################################  
+  
+acl_check_mime:  
+  
  # Decode MIME parts to disk. This will support virus scanners later. 
  deny 
  decode = default 
  condition = ${if > {$mime_anomaly_level}{2} \ 
@@ -225,13 +253,13 @@
  log_message = DENY: MIME Error (Too many MIME parts: $mime_part_count) 
  
  # Excessive line length 
 
- # BEWARE: Exim 4.50 has a bug that means regex's don't work in the MIME ACL. Don't use  
- # in that case ! 
+ # BEWARE: Exim 4.50 has a bug that means regex's don't work in the MIME ACL.  
+ # Don't use in that case! It works fine in Exim 4.60.  
  deny 
- regex = ^.{131071 }  
- message = MIME error: Line length in message or single header exceeds 131071
+ regex = ^.{8000 }  
+ message = MIME error: Line length in message or single header exceeds 8000
  log_message = DENY: MIME Error (Maximum line length exceeded) 
  
  # Partial message 
 
@@ -266,9 +294,7 @@
  # accept otherwise 
  accept 
 </pre> 
  
-Unfortunately because of a bug in exim 4.50 you may see "cannot test regex condition in MIME ACL". This stops you doing the Line Length check. This is described here:  
-  
- http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20050307/msg00131.html 
+Unfortunately, because of [ a bug in Exim 4.50| http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20050307/msg00131.html], you may see "cannot test regex condition in MIME ACL". This stops you doing the Line Length check. Enable that section only for Exim 4.6.  
  
-You can tweak the values for Proposed filename , MIME boundary length and Line Length to work for your users Some mailers conform more strictly to the MIME spec than others. 
+You can tweak the values for Proposed Filename , MIME boundary length and Line Length to work for your users Some mailers conform more strictly to the MIME spec than others.