procmail
[Top] [All Lists]

Re: Under zealous subject & to filter

2001-06-26 15:50:50
   > * ^SUBJECT(.*MedPulse|\
   >         .*CO-CURE|\
   >         .*CFS-Owners)

   That should probably be

   * ^Subject:.*(MedPulse|CO-CURE|CFS-Owners)

Okay, it's time for me to do some serious searching for what the difference
is between (.* and .*(

Nothing magic there.  Cyndi had effectively:

  ^A(.*b|.*c|.*d)

and Andrew offered

 ^A.*(b|c|d)

they do the same thing, but Andrew's version is shorter, more efficient
and - to many people - easier to read.

Not to mention the colon you added.

The colon is nothing magic either.  It just matches a colon.  The
expression:

  ^SUBJECT.*

matches against any line starting with 'subject'.  If some insane mail
agent adds the header

  Subject-is-not: [CO-CURE] Something or other

then Cyndi's recipe will still match it.  A recipe starting with

  ^Subject:.*

will only match a header starting with 'Subject:'.  Since no sane mailer
is going to create a 'Subject-is-not:' mailer, you might say "what's the
point?"

But it is a good habit to get into.

Not that I don't believe you but I have seen (and used) subject, from, and
others all the time.  They do work...so what does it mean that they aren't
"procmail macros?"

  ^SUBJECT
for example, will match against the letters s-u-b-j-e-c-t at the start
of the line.  However

  ^TO
and
  ^TO_
and
  ^FROM_DAEMON
and
  ^FROM_MAILER

*are* magic.  They will match many things other than the literal
letters.  Look in the procmailrc man pages for the details.

   What does your log say?

It's not particularly useful.  Here's an example:

It will be *much* more useful if you put

  VERBOSE=1

near the start of your .procmailrc file.

  Folder: /home/cnorman/inbox                                             3125

I don't know what that final # means.

It's the number of bytes in the message delivered to the mailbox.

Hope that helps,
Martin
-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
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>