procmail
[Top] [All Lists]

Re: puzzled about a regexp

2003-01-12 15:41:41

Well, although you state that with a smiley and as an aside, it is
actually
an important point: much better not to let a train of almost
indeciperhable
scrawlings overpower the design and comprehensibility of what you're
doing.

I want to urge people to start compartmentalizing what they're doing,
by way of variables and other tools to render the expressions more
self-documenting and reduce the likelihood of avoidable error.  I don't
claim
to be perfect at practicing what I preach.  But I'm trying.


couldn't agree more.. I always hated not documented code.. in any prog
language..
two facts though.. I am now learning regexps.. (its been only some hours in
a ten day period that I have to spare for that). Never said I master them
and don't know if I ever will. But I'm trying.

Here's an example from my paltry two virus snaggers.  here's how one looks
in my rc:

 :0  # 030105 () based on original from Philip Guenther, procmail's
maintainer
  * $   $GO^0         ^Content-[-a-z0-9_]+:.*=\"?[^\"]*\.$NASTYEXT
  * $ $STOP^0       !  CTYPE ?? ^^multipart
.......................

yes understandable.. but generic. I don't know if you had reviewed the av
whole recipe (from a previous post of mine). I 'm not trying to be generic
about viruses. On the contrary..
I am more interested in the virus part of the recipe and that is why it is
mostly build on their specific behaviour


"$NASTYEXT" I keep in $HOME/.procmail/vars/spamvars, which gets called as
an INCLUDERC.  It's not nearly as nasty as yours.

 NASTYEXT   = (hta|pif|scr|shs|vb[se]|ws[fh]|(doc|txt|xls)\\.)


you're trying to catch double extensions here right? ending with an actual
dot. while I'm not.. I want any single or double ext in my really nasty
regexp that end with quotes or space/tab or end-of-line
It wasn't that nasty before I had to change it because I noticed that only
some ".com/" strings passed through :-(

another thing.. I intend the usage of the av-recipe as an external file
already called by an includerc. Don't want to split it up in more files
(yet)


(I also
added an "abort" action so that body greps are not necessary if no
multipart
Content-Type: header was expressed.


xmmm.. I'll think about that.. but when it comes to viruses well.. so many
things change. I admit you have a really good point.

Thanks for all the advise!
(I stiil feel dumb cause my puzzlement remains on what exactly I did wrong)




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