procmail
[Top] [All Lists]

Re: newbie

2004-07-15 23:26:12
On Thu, Jul 15, 2004 at 11:08:51PM -0400, Paul Chvostek wrote
[in uncharacteristic-for-him top-posting style, which I have
corrected here]:

On Thu, Jul 15, 2004 at 09:07:39PM -0400, Paul C. Easton wrote:

Hi, I'm a Procmail newbie.  I simply trying to set up a receipe that
will search for multiple address in multiple feilds and send them to
an IMAP folder.  Looking at various tutorials and samples, I thought
that the following would work:


:0:
* ^(From|Cc|To).*technolawyer|\
  ^(From|Cc|To).*abajournalereport|\
  ^(From|Cc|To).*foolcs|\
  ^(From|Cc|To).*foolsubs|\
  ^(From|Cc|To)(_dot_)*brsends(_at_)0cgi|\
  ^(From|Cc|To).*ABANET|\
  ^(From|Cc|To).*RWTH-Aachen|\
  ^(From|Cc|To).*eletters|\
  ^(From|Cc|To).*Equifax|\
  ^(From|Cc|To).*Mozdev|\
  ^(From|Cc|To).*lexisnexismail\
@Read


But it doesn't.  I would greatly appreciate it if someone could push
me in the right direction.


Have you read the procmailrc man page?

Look for "TO_".  Look at how conditions are structured.  Remember that
multiple conditions are always ANDed.  If you want to OR them, either
build a regular expression for it, or use scoring.  (This is explained
in some detail in various procmail FAQs.)

Actually, Paul C: What Paul E. tried -- despite its being very ugly
style -- should, indeed, work, save for one tiny syntax error.
He needs an action line.

There are a couple of other problems with the recipe also, such as
that "@Read" would apply only to the very last regex ("lexisnexismail"),
not all of them (or maybe he wanted that?); and that he uses a lockfile
but says in his precatory statement to us that he wants deliver to
IMAP folders, which wouldn't need the lockfile.

I also thought at first glance that the "@Read" was a folder name (i.e.,
action line), but it is not.

So, theoretically, yes, this would work:

   :0
   * ^(From|Cc|To).*foo|\
     ^(From|Cc|To).*bar
   /path/to/maildir/folder/

(I even tested it., though I was already convinced it would work.)

But much better style is this (and btw note the colons):

  :0
  * ^(From|Cc|To):.*(foo|bar)
  /path/to/maildir/folder/


Of course, the admonishment to read the man pages still holds, and
especially "man procmailex" would prove to be useful to Paul E.

-- 
dman

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