procmail
[Top] [All Lists]

Re: A Question. :)

1997-05-25 11:35:00
On Sun, 25 May 1997 10:27:12 -0700 (PDT),
"Lavender Rose, in search of the Eternal Buzz" <lav(_at_)TheRose(_dot_)com> 
wrote:
In this recipe:
:0 :bay-discuss.lock
  * ^From:(_dot_)*bay-discuss(_at_)somedomain(_dot_)com
  bay-discuss.$YEARMONTH
It's a mailing list, so I want all this mail from bay-discuss
to go into its own folder, bay-discuss, automatically.
But I am confused.  The mail is addressed "To" bay discuss, not
"From", as in the example listed above.  I checked *all* my list
mails, and all of it is addresses "To" <listname>.  So.. help?

What's the problem then? 

    * ^To:(_dot_)*bay-discuss(_at_)somedomain\(_dot_)com

You might instead want to match on the From_ line (that is, the word
"From" followed by whitespace instead of a colon) or, well, anything
else that is unique to the list's headers. 
  (I sort all my incoming lists on the From_ line but that means Cc:ed
duplicates seldom end up where I want them. The certainty of matching
on the From_ pseudo-header outweighs the inconvenience IMHO but YMMV.)

Also, alot of the mail I get is "cc" <listname>.  How do I add it
to the same recipe for the same 'To' list..?

Check out the ^TO_ macro (see man procmailrc):

    * ^TO_bay-discuss(_at_)somedomain\(_dot_)com

Note that omitting out the .* wildcard makes sense in this case
(because the ^TO_ macro already does that part, and does it better
than the .* wildcard). 
  If your version of Procmail is older than 3.11pre4 or so, you'll
have to use plain ^TO instead of ^TO_ which is unavailable in older
versions. (I'm unsure if it's in 3.10 but you should probably upgrade
if you have that.)

Hope this helps,

/* era */

PS. Spending another of your five seconds on picking a descriptive
Subject: line saves time for the several hundred readers of this list.
Think about it.

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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