[Exim] Generic Windows Executable Content Filter

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Denny Fox
Dátum:  
Címzett: exim-users
Tárgy: [Exim] Generic Windows Executable Content Filter
Thanks to the response from Greg Ward, I was able to get the system
filter working the way I wanted to. Discarding the original message,
and giving a descriptive reply avoids a mail loop if the sender's ISP
also rejects messages with executable attachments. The lastest filter
on the web site bounces the message with fail, so the attachment goes
back with the reject message.

There were a couple of other things I needed to do:
1. add message_filter_reply_transport = address_reply to exim.conf
2. remove a number of filename extentions from the last two filters to
comply with the 256 byte length limit on filter strings in exim 3.12.

I changed the way the suggested mail section works a little to combine
the text command with the file boilerplate. That way I can let the
sender know who the message was to, and why it was rejected.

  mail to $return_path
       subject "Mail rejected: Executable attachment $1 not
permitted."
       text "Your message to $h_to: has been rejected because it
has\n\
            potentially executable content $1."
       file /etc/exim/attachment-reject.txt
  seen finish


I hope this list allows attachments, I'm attaching the revised filter,
the lines that need to be added to exim.conf, and the attachment
reject boilerplate file.

Thanks again for all your help.

Denny





Attachments with filename extentions that are executable
such as .com, .exe, .bas, .pif, .lnk, .vbs are not allowed.

These forms of attachments have been used by recent viruses and worms.

If you meant to send this file then please rename
the file to avoid executable file name extentions
or package it up as a zip file and resend it.
# Add a system filter to bounce messages with attachments that are executable
# The filter was gotten from http://www.exim.org then modified for mail
# instead of fail. Place these line at the top of the MAIN CONFIGURATION SETTINGS

         message_filter = /etc/exim/system_filter.exim
         message_body_visible = 5000
         message_filter_reply_transport = address_reply