procmail
[Top] [All Lists]

Rename attachment and add a message.

2001-09-10 08:29:37
Hello,
I use sendmail as MTA and procmail as MDA.

I would like all messages that come with a attachmemt .vbs or .exe
to be rename with the extension .vbs.potentialvirus and .exe.potentialvirus and sent to the receiver.

I would like also to add a message saying for example:

"Attention, you received a mail with an attachment, this attachmemt has been renamed .......................................
...... for information you can contact service 5454........."

To rename the atachmemts, I use this recipe:

#Renomme le fichier attache
:0
*^Content-type: (multipart/mixed|application/octet-stream|application/mixed)
{
   :0 B
       *^Content-Disposition: (attachment|inline);
       *filename=".*\.(exe|vbs)"
       {
       :0 fbw
       /bin/sed-e's/\([nN][aA][mM][eE]=".*\.\([eE][xX][eE]\
       |[vV][bB][sS]\)\)"/\1.potentialvirus"/I'
       }
}
It works, but when I try to add a message, the message does not appear.
It tried to add a message with this recipe:

#ajoute un texte
NL="
   "
   :0 HBhbfwi
   * ^Content-Disposition: .*name=.*\.\/(exe|vbs)
| sed '/^-Attention, you received a mail with an attachment...- $/,$c\'"$NL"'-. for information you can contact ..- \'"$NL"'sed: .Message ajoute'

And in the log I have no error reported:

procmail: Assigning "NL=
   "
procmail: Assigning "MATCH="
procmail: Matched "vbs"
procmail: Match on "^Content-Disposition: .*name=.*\.\/(exe|vbs)"
procmail: Executing "sed,/^-Attention, you received a mail with an attachment...- $/,$c\
   -. for information you can contact ..- \
   sed: .Message ajoute"

Perhaps that this recipe is not the solution to add a message.Is there another way to do this ?
Thank you for your help.

Pascal Boisson.




_________________________________________________________________
Téléchargez MSN Explorer gratuitement à l'adresse http://explorer.msn.fr/intl.asp

_______________________________________________
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>