procmail
[Top] [All Lists]

Re: yet another newbie question

2002-02-18 15:44:37
At 16:26 2002-02-18 -0400, Charles Tassell wrote:
I'm fairly new to procmail, but for it to check if RELAY is at the *beginning* of the subject, shouldn't it be:

* ^Subject:[  ]RELAY*

Which would be match a line starting with Subject:, possibly followed by a space, then the work RELAY, then anything else.

You don't care about the "anything else" at the end of the line (esp not "zero or more" of anything else, since absolutely nothing would match too, so why specify it?). Besides, as you've written it, the trailing asterisk makes the 'Y' zero or more:

        RELA
        RELAY
        RELAYYYYYYYYYYY

The syntax I gave allows for zero or more leading space or tab characters (the bracket contains a space and tab). Different mail clients might use one or the other, or possibly none at all. If you check the various recipes posted in response to recipe requests on this list, you'll find that many of them do the same thing. The bracketed bit is also explained in my disclaimer page, which you might want to bother reading.

Personally, I'd use a .forward file, but I guess some mailers (like qmail) don't support them out of the box.

A .forward would forward *ALL* messages, which certainly didn't meet the request, nor would it be using procmail to accomplish that task.

[snip - wow, my whole previous post, with list footer and all]

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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