|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Jason Kohles (email
jasonkohles.com)Date: Sat Oct 06 2001 - 20:56:09 CDT
On Wed, Oct 03, 2001 at 12:41:14PM -0400, Peter H. Lemieux wrote:
> Earlier I wrote:
>
> > I don't believe that procmail has the ability to determine the To:
> > address and use it in recipes (though I'd like to be proven wrong, as I,
> > too, have tried to implement what Luis suggests.)
>
> OK, I did a little more digging in "man procmailrc" and realized you can
> use a couple of neat procmail thingies to identify who the message is
> addressed to.
>
[snip]
The problem with this filter is that it assumes the addressee will be listed
in the To: line, and will cause such nasty side effects as resending mailing
list mail, a much better way to do this is to have procmail alter the subject
as the message continues on to wherever it was intended, rather than remailing
it.
:0
* ^Content-Type:.*multipart
{
# Nimda
:0 B
* filename=readme\.exe
{
:0 f
| formail -I 'Subject: VIRUS ALERT[Nimda]: Evil message attached'
}
}
BTW, if you like the procmailrc man page, check out procmailex...
> :0
> * ^Content-Type.*multipart
> {
> # Nimda
> :0 B
> * filename=readme\.exe
> {
> :0
> * To:.\/.*
> | mail -s 'VIRUS ALERT[Nimda]: Evil message attached' $MATCH
> }
> }
>
> Alternatively, you could send a standard message like "someone sent you
> a message with a virus" to $MATCH with an action line like:
>
> | mail -s 'VIRUS ALERT' $MATCH < /root/warningmsg
>
> with your alert message stored in /root/warningmsg. Of course, this
> would only send the warning; the actual message would be discarded.
>
> Peter
-- Jason S Kohles emailjasonkohles.com http://www.jasonkohles.com/
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]