procmail
[Top] [All Lists]

Re: Sending email to receipient and sender

2001-06-27 13:41:53
On Wed, 27 Jun 2001, Tom Warfield wrote:
  Im trying to figure out how get a message be sent to the original sender.
Also i will be sending a message to the receiver, and include the senders
email address and name.  But how do i do that?  Currently i am just sending
a email to a static address when i delete the email message.  Here is my
current setup:
#
:0 BD:

'D' tells procmail to distinguish between upper and lower case...
I don't think that is what you want... Especially since you will have to
add Exe, eXe, exE and every other possible combination...
So remove it...

: tells procmail to lock the file it delivers to... and since you don't
deliver here it is not used at all... Remove it too...

* Content-Disposition..attachment.
* filename=.*\.(exe|EXE).
{
       :0 c
       /dev/null

Since this just forks and drops the mail to /dev/null it is waste of space
(and also a pid)... This doesn't acomplish anything but that the response
actually is truthfully... Remove it.

       :0 h
       | (formail -i"Subject: Executable file received" \
         -A"X-Filter: Executable attachment received and deleted" \
         -i"To:Postmaster(_at_)astcorp(_dot_)com"\
         -i"Content-type: text/plain; charset=\"us-ascii\""; \
         echo "A executable file was received."; \
         echo "Date: `/bin/date`"; \
         echo "Due to possible virus infections the file has been sent to
/dev/
null and deleted";\

Ehh... You've forked it to send it to /dev/null and delete it?
Isn't it better to actually just say that it was blocked or something?

         ) | \
         $SENDMAIL -oi postmaster(_at_)astcorp(_dot_)com
}
#

Perhaps you also want something like this to keep the headers but drop the
body:

:0 wh
| (cat -;echo '';echo 'A executable file was received."; \
   echo "Date: `/bin/date`"; \
   echo "Due to possible virus infections the file has been blocked.";)

That way the body is simply removed... Perhaps you need formail instead of
'cat -' to remove the mime-headers as well... but... that you can figure
out by yourself.

Oh and do i realy need to have both exe and EXE?  it is case sensitive to
the file attachments name right?

If you use 'D' you will have to have exe, EXE and the other six
combinations up there (since extensions isn't case sensitive on windows
and therefor can appear as either).

-- 
Best of all is never to have been born.
Second best is to die soon.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>