procmail
[Top] [All Lists]

Re: Conditions

2000-10-09 09:55:42
At 15:49 2000-10-09 +0200, Grzegorz Jaskiewicz wrote:
How use few conditions in parallel?

I would recommend a more thorough reading of the man pages. Yea, I caught the comment at the end of your message, but these are pretty basic constructs.

like this? :
:0c
(* Subject:.*sms & *<1000)

Besides the following comments, it should be noted that even in OR conditions, the asterisk wouldn't be inside the parens, and I rather doubt (but can't say for sure, since I don't even use it) that the size construct may not work as an OR condition on another line - it is a bit of a special case.

:0c
* ^Subject:.*sms
* < 1000

flags: clone/copy
match subject (that caret is _important_ - it anchors it to the beginning of the line)
message size smaller than 1000 bytes.

The pipe symbol | what does it mean?
how message is going throught all conditions, programs in proc mail?

Depends on where it is used.

If within a condition, it is a standard OR operator (in which case you'd put the multiple conditions being OR'd on the same line, in proper REGEXP syntax).

If at the beginning of the delivery block, procmail pipes the message into the indicated program. If within the commandline of the invoked programs, it pipes the results of that program into the next. If it is ESCAPED (\|) in the delivery rule, it could be interpreted by the called program (most likely, as part of a regexp there, but it depends on the app).

:0
*

incorrect syntax - if you have nothing to match, there's no need for a condition operator (*) - just omit the line.

{
| formail -some
!ble(_at_)ble(_dot_)com(_dot_)rs
}

invalid - cannot do TWO deliveries on one message. Use copy instead. I have no idea what "-some" is on the formail - I'll assume you mean it to be _whatever_, rather than something specific. If you mean to forward the RESULTS of the formail operation, you'll need to PIPE it to sendmail with the appropriate arguments. If not, and these are supposed to be two separate deliveries, use the c flag.

:0
*

Still incorrect to have the star with no condition - FINE to have no condition, but don't include the star.

{
:0hf

headers only, consider this as a FILTER, rather than a delivery. Filter means just that - the message passes THROUGH this (like a filter on a camera lens), while delivery means the message is dropped into it's final destination (be it |piped to an app, !forwarded, stored in a mailbox, or thrown out to /dev/null)

| formail -some
:0
!ble(_at_)ble(_dot_)com(_dot_)cz
}

The second rule here will be invoked after the formail process does something. Typically, formail will be used like this to add, remove, or change some headers -- it is not uncommon on a forward to add an X-Loop header (which you would of course CHECK for before forwarding).

---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395


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