PDA

View Full Version : using nested "if endif" postfix pcre:header_checks


kekahuna
19th August 2007, 06:42
Hi,
Hope there's someone out there that can help on this. I am trying to use pcre header_checks to filter a great deal of email going to one user on my mail server.
I tried reading the man pcre_table 5 docs and the description is a little vague but I came up with this:
if /^X-Original-To:.*user@/
!/^From:.*(friend1@foo1|friend2@foo2|etc...@fooetc.. )/ REJECT You shall not pass
endif

It doesn't seem to work. I know I can do this in the .procmailrc file, but the mail to this specific user is so huge that I would rather reject everyone that is not listed as a friend right up front. Fortunately there aren't too many friends 10 to be accurate with no need to grow the list.
Would appreciate some direction there.

falko
20th August 2007, 19:16
Can you try this?
if /^X-Original-To:.*user@*/

kekahuna
20th August 2007, 19:25
Can you try this?
if /^X-Original-To:.*user@*/
Falko, I'll give it a shot, but is there a bug in pcre_tables or something?
The reason I ask is
/^X-Original-To:.*user@/ should produce the same result as if the * is appened,,, in other words if the X-Original-To is from user@foo.com or user@foo1.com etc... that portion of the patter should match without including the * (which I maybe interpreting incorrectly to be a wildcard letter or letters 0 or more times)

kekahuna
20th August 2007, 19:35
Falko, I'll give it a shot, but is there a bug in pcre_tables or something?
The reason I ask is
/^X-Original-To:.*user@/ should produce the same result as if the * is appened,,, in other words if the X-Original-To is from user@foo.com or user@foo1.com etc... that portion of the patter should match without including the * (which I maybe interpreting incorrectly to be a wildcard letter or letters 0 or more times)

This did not work. Its as if !/(user@foo|user2@foo)/ Reject is being ignored.