procmail
[Top] [All Lists]

Re: Catch-all list filter

2008-01-03 22:05:23
N.J. Mann wrote:
In message <477D3AD5(_dot_)80005(_at_)dd-b(_dot_)net>,
      David Dyer-Bennet (dd-b(_at_)dd-b(_dot_)net) wrote: 
  

Either an assignment isn't an action line, in which case ".Auto.$gname/" 
is the first action line in that recipe, or else I've already had *two* 
action lines (the two assignments, both of which worked).   So that 
can't be the explanation.
    

The opening brace is the action.  See the "Recipe action line" section
of the procmailrc(5) manual page.  Assignments don't count and may
appear (almost) anywhere.
  

The man page seems remarkably oblique on the topic, actually.  Reading 
it repeatedly doesn't make anything very clear.   Anyway, the third 
alternative that I hadn't considered is "a brace isn't a block-grouping 
element" in anything like the sense I'm used to.  I think I might 
remember what I can do and not for a little while this time.  (Then I'll 
get this automation working and not have to touch it for 6 months and 
forget everything again.)

Why the "[(_at_)]" rather than just "@" (second two regexps) (or "[.]" in 
the 
first regexp)?  I don't see how a character class that matches only a 
single character differs from that character appearing literally?
    

. (dot) is special in procmail regexps and so needs escaping when you
want to match a real dot.  Here I use the character class delimiters to
escape it - it also makes it standout so that _I_ notice that is what I
will get.  As for the [(_at_)], I could probably just have used an @ on its
own, but, again, it does highlight for me, the human with the poor
memory, what the final character of the match is.
  

I considered that; in my head it was "preferred form for the dot, maybe 
considered more readable", followed by "maybe cut and paste, changed . 
to @".  Okay, fine, that all makes perfect sense.  (I'm now sufficiently 
used to remembering dot is special that I just type \. 
semi-automatically; regexps I spend a LOT of time with.)

I actually expected you to ask why there is a question mark after the <
since RFC2919 states that the angle brackets are mandatory.  However, in
the real world there is mailing list software (possibly misconfigured)
which does not enclose the list-id in angle brackets. :-(
  

That one I knew already, I've encountered it before.

And looking at yours has already told me something about why mine didn't 
match as far in as I had expected it to, so that's useful!

I'm actually going to have to put in explicit recipes to *keep* some 
mailing lists from going into special directories -- a number of 
announce lists I want to show up in my normal email, so I'll read them.  
I find this amusing.
    

You can do that once you have LISTNAME set, but before the delivery
recipe, e.g.

  :0:
  * LISTNAME ?? ^free-pizza-tonight-announce-list$
  $DEFAULT
  

True, and thus only pay the price on list messages.  Of course, list 
messages are better than 90% of what comes through this mailbox, so 
there isn't so much benefit from restricting it to list mail.

  :0
  $LISTNAME/

(My DEFAULT mailbox is the system one which is mbox format, hence
locking is required.)
  

I'm conveniently running Maildirs, so I don't have to worry about that 
at least.

Again I hope the above helps.
  

Very much!  Thanks again.

-- 
David Dyer-Bennet, dd-b(_at_)dd-b(_dot_)net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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