If Attachment THEN AutoRespond
Is it possible to send an auto reply to senders who send in email attachments, even if this is a cron job?
-Stephen
-
I can't see how you would do this with an auto responder, so I looked at filters, but i'm not sure you could do it with a filter either. A filter would only respond with a fail message. 0 -
Actually this might be possible with some work - you may be able to use the exim system filter to do this and you might be able to sample the code for filtering dangerous attachments. To customize the exim system filter we have the following documentation: +\\\\.(?:ad[ep]|ba[st]|chm|cmd|com|cpl|crt|eml|exe|hlp|hta|in[fs]|isp|jse?|lnk|md[be]|ms[cipt]|pcd|pif|reg|scr|sct|shs|url|vb[se]|ws[fhc])\")" then fail text "This message has been rejected because it has\n\ potentially executable content $1\n\ This form of attachment has been used by\n\ recent viruses or other malware.\n\ If you meant to send this file then please\n\ package it up as a zip file and resend it." seen finish endif # same again using unquoted filename [content_type_unquoted_fn_match] if $header_content-type: matches "(?:file)?name=(\\\\S+\\\\.(?:ad[ep]|ba[st]|chm|cmd|com|cpl|crt|eml|exe|hlp|hta|in[fs]|isp|jse?|lnk|md[be]|ms[cipt]|pcd|pif|reg|scr|sct|shs|url|vb[se]|ws[fhc]))([\\\\s;]|\\$)" then fail text "This message has been rejected because it has\n\ potentially executable content $1\n\ This form of attachment has been used by\n\ recent viruses or other malware.\n\ If you meant to send this file then please\n\ package it up as a zip file and resend it." seen finish endif
You'd have to modify the regex in header_content-type to match the types of attachments you'd want to filter then instead of fail you'd want to autorespond so you'd need to decide if you're delivering to the original intended recipient or failing0
Please sign in to leave a comment.
Comments
2 comments