# Exim filter # Version 0.2 # Released to the public domain by Jeremy Malcolm # # Will reject outgoing emails that claim to include attachments, but don't. # Enable this filter by setting its path in system_filter in exim[4].conf. # Be sure to set your sending domain/s at line 18 below! # # Test with /usr/sbin/sendmail -bF fta.filter < test-message # # Requirements: # - Exim 3.2 or higher # - An alias "no-attachment" at your domain pointing to /dev/null # # Limitations: # - Will misfire on an email like this: # > I'm attaching a draft. - Bob # Thanks for that, Bob. - Steve # # Changelog: # - 0.1, 6 September 2010: Initial release # - 0.2, 2 March 2011: No longer misfires on multipart/signed emails. # if error_message or foranyaddress $recipients ($thisaddress is no-attachment@$sender_address_domain) or $sender_address_domain does not match "(yourdomain\.tld|yourotherdomain\.tld)" then finish elif $message_body matches "(((is|find|['|ha]ve) attached)|(([a']m|[a']re) (attaching|forwarding))|((the|an) attachment))" and $h_content-type does not contain multipart/mixed and $message_body does not contain multipart/mixed then fail "<>Please check that you have not forgotten an attachment to this message.\nTo force delivery, BCC \"no-attachment@$sender_address_domain\"." endif