Re: need help with regexp in header_checks

2013-11-15 Thread LuKreme
On Nov 13, 2013, at 8:01, Noel Jones njo...@megan.vbhcs.org wrote: Anyway, this should match better: /^(To|From|Cc|Reply-To): .*[ ]admin@/DISCARD Besides the discussion on the need to anchor the regex (you do), I'm trying to wrap my head around why one would want to discard mail from

Re: need help with regexp in header_checks

2013-11-14 Thread Viktor Dukhovni
On Thu, Nov 14, 2013 at 01:35:39AM -0600, Stan Hoeppner wrote: Mere excuse for sloppiness. I find that offensive Viktor. There is a huge difference between arguing a point of fact and arguing a position. Above is an example of the former, and is a correct statement. Sorry to hear

Re: need help with regexp in header_checks

2013-11-14 Thread Noel Jones
On 11/14/2013 1:07 AM, tejas sarade wrote: I think .* will match everythig. On Nov 13, 2013 8:32 PM, Noel Jones njo...@megan.vbhcs.org The expression I posted is correct. /^(To|From|Cc|Reply-To): .*[ ]admin@/DISCARD This should match headers such as From: System admin

Re: need help with regexp in header_checks

2013-11-14 Thread Bill Cole
On 14 Nov 2013, at 1:32, Stan Hoeppner wrote: On 11/13/2013 9:50 AM, Bill Cole wrote: On 13 Nov 2013, at 6:39, Stan Hoeppner wrote: Also, note that the carat (^) anchor isn't necessary. The header fields you're testing for are in the left most position. Thus no reason to left anchor your

Re: need help with regexp in header_checks

2013-11-14 Thread Michael P. Demelbauer
On Thu, Nov 14, 2013 at 08:19:52AM -0600, Noel Jones wrote: On 11/14/2013 1:07 AM, tejas sarade wrote: I think .* will match everythig. On Nov 13, 2013 8:32 PM, Noel Jones njo...@megan.vbhcs.org The expression I posted is correct. /^(To|From|Cc|Reply-To): .*[ ]admin@/DISCARD

Re: need help with regexp in header_checks

2013-11-14 Thread Noel Jones
On 11/14/2013 9:27 AM, Michael P. Demelbauer wrote: On Thu, Nov 14, 2013 at 08:19:52AM -0600, Noel Jones wrote: On 11/14/2013 1:07 AM, tejas sarade wrote: I think .* will match everythig. On Nov 13, 2013 8:32 PM, Noel Jones njo...@megan.vbhcs.org The expression I posted is correct.

Re: need help with regexp in header_checks

2013-11-14 Thread Wietse Venema
Stan, your contributions are appreciated but please do not criticize those who suggest improvements. Anchoring regular expressions (that don't start with wild-card) is a must to avoid false matches. This is a correctness issue. Matching To: just because it appears in a Subject: is wrong.

need help with regexp in header_checks

2013-11-13 Thread naser sonbaty
Hi, I need help with postfix regexp in header_checks. I want discard all emails(any domain) from admin@ I use following: /^(To|From|Cc|Reply-To): admin@(.*)/DISCARD but its not working thx for help

Re: need help with regexp in header_checks

2013-11-13 Thread Stan Hoeppner
On 11/13/2013 2:34 AM, naser sonbaty wrote: Hi, I need help with postfix regexp in header_checks. I want discard all emails(any domain) from admin@ I use following: /^(To|From|Cc|Reply-To): admin@(.*)/DISCARD but its not working Tests fine here: $ cat test.regexp

Re: need help with regexp in header_checks

2013-11-13 Thread Noel Jones
On 11/13/2013 2:34 AM, naser sonbaty wrote: Hi, I need help with postfix regexp in header_checks. I want discard all emails(any domain) from admin@ I use following: /^(To|From|Cc|Reply-To): admin@(.*)/DISCARD but its not working thx for help WARNING: This looks like a

Re: need help with regexp in header_checks

2013-11-13 Thread moparisthebest
Agreed. Why would you want to discard my emails? :( Is there something wrong with having an email named admin? On 11/13/2013 10:01 AM, Noel Jones wrote: On 11/13/2013 2:34 AM, naser sonbaty wrote: Hi, I need help with postfix regexp in header_checks. I want discard all emails(any domain)

Re: need help with regexp in header_checks

2013-11-13 Thread Jan P. Kessler
Also, note that the carat (^) anchor isn't necessary. The header fields you're testing for are in the left most position. Thus no reason to left anchor your expression. Of course there is. - Anchored expressions are executed faster (the parser has to check the pattern only against the

Re: need help with regexp in header_checks

2013-11-13 Thread Bill Cole
On 13 Nov 2013, at 6:39, Stan Hoeppner wrote: On 11/13/2013 2:34 AM, naser sonbaty wrote: Hi, I need help with postfix regexp in header_checks. I want discard all emails(any domain) from admin@ I use following: /^(To|From|Cc|Reply-To): admin@(.*)/DISCARD but its not working Tests

Re: need help with regexp in header_checks

2013-11-13 Thread Bill Cole
On 13 Nov 2013, at 3:34, naser sonbaty wrote: Hi, I need help with postfix regexp in header_checks. Start by reading the documentation, including the man pages for header_checks and regexp_table and Postfix's BUILTIN_FILTER_README. Also: following the advice in the last ~50 lines of the

Re: need help with regexp in header_checks

2013-11-13 Thread Viktor Dukhovni
On Thu, Nov 14, 2013 at 12:32:45AM -0600, Stan Hoeppner wrote: In recent years CPUs have become so blindingly fast it makes no difference. Any excess cycles burned by a non anchored regex were idle cycles anyway. There are good arguments for anchoring expressions, but saving CPU cycles is

Re: need help with regexp in header_checks

2013-11-13 Thread tejas sarade
I think .* will match everythig. On Nov 13, 2013 8:32 PM, Noel Jones njo...@megan.vbhcs.org wrote:

Re: need help with regexp in header_checks

2013-11-13 Thread Stan Hoeppner
On 11/14/2013 12:41 AM, Viktor Dukhovni wrote: On Thu, Nov 14, 2013 at 12:32:45AM -0600, Stan Hoeppner wrote: In recent years CPUs have become so blindingly fast it makes no difference. Any excess cycles burned by a non anchored regex were idle cycles anyway. There are good arguments for