Re: [Exim] exiscan - notify recipient if mail is rejected

Top Page
Delete this message
Reply to this message
Author: Nico Erfurth
Date:  
To: Asbjørn Høiland Aarrestad
CC: Exim-users
Subject: Re: [Exim] exiscan - notify recipient if mail is rejected
Asbjørn Høiland Aarrestad wrote:
> hi!
>
> I've just insalled Exim4 and I'm trying to get the setup perfect. Does
> anybody know how I can get exim til send a notification mail to the
> recipient of a rejected mail, so the recipient can be told that "you
> recieved a mail containing a virus from ...." and then just reject the
> incomming mail? Should this be done in the "reject" phase of exiscan or
> during delivery of the mail? Do I need to activate the perl library?


I'm doing this by forwarding the mail to a special account, and using
filters to generate the mail.

exiscan_av_action = redirect virusalert@yourdomain

filter for virtusalert:
if "${if def:h_x-infected:{1}{0}}" is "1" then
   # Generate a mail to the sender
   mail to $h_from
        cc $sender_address
        from "postmaster@yourdomain"
        subject "A mail you send contained a virus"
        text "A mail you send to $h_to contained a virus
($h_x-infected:).\n\
              Please contact postmaster@yourdomain for further informations"
   # Generate a mail for the original recipient
   mail to $h_to
        cc $h_cc
        from "postmaster@yourdomain"
        subject "$h_from ($sender_address) tried to send a virus"
        text "A mail from $h_from ($sender_address) to you\n\
              was infected with the $h_x-infected: virus.\n\
              Please contact postmaster@yourdomain for further
informations."
   save .VirusAlerts/
   finish
endif