Penguin
Diff: EximMailFilter
EditPageHistoryDiffInfoLikePages

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

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

Newer page: version 12 Last edited on Sunday, April 17, 2005 4:25:10 pm by JohnMcPherson Revert
Older page: version 7 Last edited on Sunday, February 6, 2005 1:05:14 am by PeteSimmons Revert
@@ -116,9 +116,9 @@
 In a corporate mail filter I don't want to send users any spam - there is a body that exists to filter what little spam is left after the above rule, but we need to get it to another mailbox. We do this by adding an X- header to any messages that are over the spam level as defined in spamassassin's local.cf (if you don't set it there, it defaults to 5), and use a router to rewrite them to that address. 
  
 Drop a file called 050_exim4-config_spam_redirect in /etc/exim4/conf.d/router, containing something very much like this: 
  
-<pre
+<verbatim
 # itp: Spam redirection router 
 # Modified from http://duncanthrax.net/exiscan-acl/exiscan-acl-examples.txt, 
 # this router takes any message with X-Redirect-To and redirects it to that 
 # user. 
@@ -130,15 +130,29 @@
  headers_add = X-Original-Recipient: $local_part@$domain 
  data = $h_X-Redirect-To: 
  headers_remove = X-Redirect-To 
  redirect_router = hubbed_hosts 
-</pre
+  
+#[rj]  
+# I would suggest using variable instead of a header.  
+# Adding X-Redirect-To: header by original sender will allow  
+# sending mail through your server without authentication  
+#  
+#spam_redirect:  
+# debug_print = "R: scan_redirect for $domain"  
+# driver = redirect  
+# condition = ${if def:acl_m1 {1}{}}  
+# headers_add = X-Original-Recipient: $local_part@$domain  
+# data = $acl_m1  
+# redirect_router = hubbed_hosts  
+#[rj]  
+ </verbatim
  
 This sits just before the hubbed_hosts router, which was previously the first router in the queue. Set the redirect router to whichever router you want to process your message next. 
  
 Now, to have the redirect headers written on your messages, in our acl/40_exim4-config_check_data.rul: 
  
-<pre
+<verbatim
  # itp: put a spam warning on all messages 
  # and redirect messages over the SA threshold to quarantine 
  warn message = X-Spam-Score: $spam_score {$spam_bar} 
  condition = ${if <{$message_size}{100k}{1}{0}} 
@@ -149,9 +163,19 @@
  spam = nobody:true 
  
  warn message = X-Redirect-To: quarantine@itpartners.co.nz 
  spam = nobody 
-</pre
+  
+#[rj] I would suggest putting something like that instead  
+# accept  
+# condition = ${if <{$message_size}{100k}{1}{}}  
+# spam = nobody  
+# set acl_m1 = "postmaster@itpartners.co.nz"  
+# #delay = 60s  
+# #control = fakereject /This message scored $spam_score spam points. Please contact postmaster  
+# #logwrite = :main,reject: This message scored $spam_score spam points. Please contact postmaster  
+#[rj]  
+</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). 
  
 In order to get a small sensible spam report instead of the huge default SpamAssassin one, put this in your /etc/spamassassin/local.cf: