{{{ # Exim filter <<== do not edit or remove this line! # # See the Exim filter document (http://www.exim.org/docs/filter.html) # for details of the Exim filter language used here. # # # 1. Logging. You can arrange for exim to log messages to a # log file in order to help you debug subtle .forward problems. # # Log to this file: # logfile $home/.exim_filter_log 0644 # # Now, add log write commands like the following line (currently # commented out) wherever you like in this file, either unconditionally # to log everything, or conditionally in an "if". # #logwrite "$tod_log msgid: $message_id, from: $header_from:, subject: $header_subject:" # # 2. Pre-Spam exceptions: # # If you regularly receive emails that are mistakenly categorised as # spam, put a "deliver this kind of message normally" rule here. eg: # if $h_From: contains "wibble@wobble" then unseen finish endif' # # # 3. Spam filtering: # # divert to spam folder if BrightMail thinks it's definitely spam, # from a blocked IP address, or maybe spam. BrightMail also marks # it in the old spamassassin style, so you can simply use: # if $h_X-Spam-Flag: is "YES" then save IMAP/Spam finish endif # # Alternatively, you might prefer to separate Spam/Blocked/Maybe messages # into 3 different IMAP folders. i.e. you might want: # - divert to brightmail-spam folder if definitely spam. # - divert to brightmail-blocked folder if from blocked ip. # - divert to brightmail-maybe folder if may be spam. # To do this, simply comment out the above "if Spam-Flag ... endif" rule # and uncomment the following alternative rule: # #if $h_X-BrightMail-Spam-Flag: is "YES" then # save IMAP/brightmail-spam # finish #elif $h_X-BrightMail-Spam-Blocked: is "YES" then # save IMAP/brightmail-blocked # finish #elif $h_X-BrightMail-Spam-Maybe: is "YES" then # save IMAP/brightmail-maybe # finish #endif # # 4. Post-Spam, Pre-Error exceptions: # # In (5) we'll handle Error Messages, i.e. mail delivery failure messages # bounced back to you when you mistype an email address. These are # defined in the RFCs as messages with Return-Path: <>. Sometimes you # need exceptions however: For example, some Imperial distribution lists # have null return paths, so we should force them to deliver normally. if $header_to: contains "-dl@imperial.ac.uk" or $header_cc: contains "-dl@imperial.ac.uk" then unseen finish endif # # 5. Error Message handling: # # Deliver all marked email error messages direct to your inbox. # # This used to be the very first rule but spammers are now sending # spam error messages to take advantage of this, so we recommend it # here, much later: after spam detection. # if error_message then unseen finish endif # # 6. Post-spam, post-error processing: # # place any additional rules you like here. # # # 7. When going on vacation: # # Setup .vacation.msg; delete and then touch the vacation database, # i.e. rm ~/.vacation.{dir,pag}; touch ~/.vacation.{dir,pag} # and then uncomment the following line, changing my_mailname to your # long form mail name (eg. joe.bloggs08) # #unseen pipe "/usr/bin/vacation -a my_mailname $local_part" }}}