Le 13/02/2011 23:30, Franck MAHE a écrit : > I did the same test on a postfix release 2.6.5, and I’ve the same behavior. > Any idea? > > > > > > Franck > ------------------------------------------- > E: <mailto:m...@civis.net> m...@civis.net > > De : Franck MAHE [mailto:m...@civis.net] > Envoyé : dimanche 13 février 2011 22:33 > À : 'postfix-users@postfix.org' > Objet : Issue with header_checks > > > > Hello, > > > > I’ve the following in main.cf > > header_checks = regexp:/etc/postfix/regexp_table > > > > My postfix release is 2.3.8 > > > > I’ve the following in my header_checks regex table: > > # MAL FORMATED EMAIL ADDRESS > > /^From:.*\.@.*/ REJECT "1 - Your Email address is not compliant with > RFC, Go Away" > > /^From:.*<.*\.\..*@.*>/ REJECT "2 - Your Email address is not compliant with > RFC, Go Away" >
you can probably make all that simpler. if /^From:/ /\.@/ REJECT 1 blah blah /\.\./ REJECT 2 blah blah /(\[|\].....)/ REJECT 3 or 4 blah blah endif > /^From:.*<.*(\[|\]|\(|\)|\`|\;|\,|\^|\#|\:|\||\\|\@|<|>|\/|\!|\ > |\$|"|"|\%|\&|').*@.*>/ REJECT "3 - Your Email address is not compliant with > RFC, Go Away" > > if !/^From:.*<.*@.*>/ > > /^From:.*(\[|\]|\(|\)|\`|\;|\,|\^|\#|\:|\||\\|\@|<|>|\/|\!|\ > |\$|"|"|\%|\&|')@.*/ REJECT "4 - Your Email address is not compliant > with RFC, Go Away" > > endif > I fail to see the difference between 3 and 4. but anyway, what are you trying to do? these reject compliant formats. for example From: (mouss) <mo...@example.com> is valid 822 syntax. do not invent new rules. besides, will these reject a lot of spam? and will they reject spam that can't be rejected via safer mechanisms? > > > All is fine for REJECT 1, 2 & 3, however when the From field is only “From: > u...@domain.tld”, the REJECT 4 is not taken into account, ie the REJECT 4 > seems not to be tested. So, it seems that the if…endif block is not working. > > > > Do you have any idea to solve that? > > > > Franck > ------------------------------------------- > E: m...@civis.net > >