-------- Original-Nachricht -------- > Datum: Mon, 29 Mar 2010 16:44:58 +0200 > Von: Louis-David Mitterrand <vindex+lists-postfix-us...@apartia.org> > An: postfix-users@postfix.org > Betreff: Re: max length of pcre rule?
> On Mon, Mar 29, 2010 at 04:38:17PM +0200, Steve wrote: > > > > > > > Ohhh boy. Now looking at the regexp I see an error. Every line > > starting with "/[^:]*.+" should be replaced by "/[^:]*:.+". Sorry for > > that. > > > > Hi Steve, > Hallo Louis-David, > You if/endif suggestion for the prefix is interesting. > > For added safety, the individual rules should be anchored with ^ and the > bracketed atom plussed, no? > > /^[^:]+:.+ > Yes. You are right. But to be honest this should be enough (just an example): 001) if /^Received|X\-((Origin(ating)?|Client|MDRemote|Sender)\-?IP|(Client|Remote_)Addr|PHP\-Script):/ 002) /\b(127\.0.\d+\.\d+)\b/ REJECT aviso.ci junk 2 003) endif * Rule 001 will match a specific header. * Rule 002 will match 127.0.xxx.xxx * 127.0.xxx.xxx could be anchored with ^ but the rule/if-condition in 001 is already taking care of that 127.0.xxx.xxx is not part of the header name. So you can shorten the regexp to just "/\b(<ip you check/rule>)/b REJECT blah-blah-blah" > Thanks, > No problem. // Steve -- Sicherer, schneller und einfacher. Die aktuellen Internet-Browser - jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser