procmail
[Top] [All Lists]

Re: How to make logical and?

2004-09-27 12:05:29
Toen wij Eriberto kietelden, kwam er dit uit:

- user1, user2 and user3 can send mail to anybody.
- anybody can send mail to user1, user2 and user3 only.

:0
* ! From:*.user1
* ! From:*.user2
* ! From:*.user3
* ! To:*.user1
* ! To:*.user2
* ! To:*.user3
{ [deny] }

However, user5 cannot send mail to user2. Why?


Main problem:
You must change all the '*.' to '.*' (see: man 7 regex).

You should put ^-anchors in the regexes, like in '^From:'.

I think you already know that all condition-lines are AND-ed. 

Because of the '*.', the first condition-line says: try to 
match 'From', followed by 0, 1 or more ':', followed by any 
character, followed by 'user1'; if a match is possible then 
the condition-line returns False (because the exclamation-
mark inverts the result), else it returns True.

For example 'From user1' matches, so the condition returns 
False. 'From user5...' and 'From: <user5...>' don't match, 
of course.

Although 'To: user2...' matches, 'To: <user2...>' does not 
match (your original conditions), and neither does 
'To: "user2" <user2...>'.

-- 
Grtz, Ruud

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