Prev: How did I get this [Sender address rejected: User unknown in virtual alias table] and how do I get rid of it?
Next: Postfix 2.3.15 RPM package and no SASL support
From: "Laurence Moughan" on 16 Sep 2009 07:00 --=__Part78538F2F.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi All, =20 Would someone just please give me a headsup on the format for reg exp = headerchecks files, =20 Im not sure how to format for searching for a string within an email = address, =20 eg =20 to reject all mail with the word "boarding" eg for the from address = boarding_pc(a)domain.com and newboarding_pcnew(a)domain.com =20 I have=20 =20 /^From:(.*)boarding_pc\@domain\.com/ REJECT junk /^From:(*)boarding(*)\@adomain\.com/ REJECT junk /^From: *boarding*\@domain\.com/ REJECT junk /^From: (.*)boarding(.)*\@domain\.com/ REJECT junk =20 =20 this is working now -=20 =20 which one is right ? =20 im a bit confused =20 =20 Thanks =20 Laurence --=__Part78538F2F.0__= Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Description: HTML <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"= > <META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD> <BODY style=3D"MARGIN: 4px 4px 1px; FONT: 10pt Tahoma"> <DIV>Hi All,</DIV> <DIV> </DIV> <DIV>Would someone just please give me a headsup on the format for reg exp = headerchecks files,</DIV> <DIV> </DIV> <DIV>Im not sure how to format for searching for a string within an email = address,</DIV> <DIV> </DIV> <DIV>eg</DIV> <DIV> </DIV> <DIV>to reject all mail with the word "boarding" eg for the from = address <A href=3D"mailto:boarding_pc(a)domain.com">boarding_pc(a)domain.com</A= > and <A href=3D"mailto:newboarding_pcnew(a)domain.com">newboarding_pcne= w(a)domain.com</A></DIV> <DIV> </DIV> <DIV>I have </DIV> <DIV> </DIV> <DIV>/^From:(.*)boarding_pc\@domain\.com/ REJECT junk<BR>/^From:(*)boarding= (*)\@adomain\.com/ REJECT junk<BR>/^From: *boarding*\@domain\.com/&nb= sp; REJECT junk<BR>/^From: (.*)boarding(.)*\@domain\.com/= REJECT junk</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>this is working now - </DIV> <DIV> </DIV> <DIV>which one is right ?</DIV> <DIV> </DIV> <DIV>im a bit confused</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>Thanks</DIV> <DIV> </DIV> <DIV>Laurence<BR></DIV></BODY></HTML> --=__Part78538F2F.0__=--
From: Martijn de Munnik on 16 Sep 2009 07:12 On Wed, 16 Sep 2009 12:00:15 +0100, "Laurence Moughan" <Laurence.Moughan(a)aerlingus.com> wrote: > Hi All, > > Would someone just please give me a headsup on the format for reg exp > headerchecks files, > > Im not sure how to format for searching for a string within an email > address, > > eg > > to reject all mail with the word "boarding" eg for the from address > boarding_pc(a)domain.com and newboarding_pcnew(a)domain.com > > I have > > /^From:(.*)boarding_pc\@domain\.com/ REJECT junk > /^From:(*)boarding(*)\@adomain\.com/ REJECT junk > /^From: *boarding*\@domain\.com/ REJECT junk > /^From: (.*)boarding(.)*\@domain\.com/ REJECT junk /^From: .*boarding.*\@domain\.com$/ REJECT junk > > > this is working now - > > which one is right ? > > im a bit confused > > > Thanks > > Laurence -- YoungGuns Kasteleinenkampweg 7b 5222 AX 's-Hertogenbosch T. 073 623 56 40 F. 073 623 56 39 www.youngguns.nl KvK 18076568
From: "Laurence Moughan" on 16 Sep 2009 07:29 --=__PartA18A56F8.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Appologies the second post - can someone please also explain the postmap = test, =20 eg =20 postmap -q "boarding" regexp:/etc/postfix/headerchecks =20 This comes back with nothing - i thought it might coma back with a match ? =20 Laurence >>> "Laurence Moughan" <Laurence.Moughan(a)aerlingus.com> 16/09/09 12:00:15 = >>> Hi All, =20 Would someone just please give me a headsup on the format for reg exp = headerchecks files, =20 Im not sure how to format for searching for a string within an email = address, =20 eg =20 to reject all mail with the word "boarding" eg for the from address = boarding_pc(a)domain.com and newboarding_pcnew(a)domain.com =20 I have=20 =20 /^From:(.*)boarding_pc\@domain\.com/ REJECT junk /^From:(*)boarding(*)\@adomain\.com/ REJECT junk /^From: *boarding*\@domain\.com/ REJECT junk /^From: (.*)boarding(.)*\@domain\.com/ REJECT junk =20 =20 this is working now -=20 =20 which one is right ? =20 im a bit confused =20 =20 Thanks =20 Laurence --=__PartA18A56F8.0__= Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Description: HTML <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"= > <META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD> <BODY style=3D"MARGIN: 4px 4px 1px; FONT: 10pt Tahoma"> <DIV>Appologies the second post - can someone please also explain the = postmap test,</DIV> <DIV> </DIV> <DIV>eg</DIV> <DIV> </DIV> <DIV>postmap -q "boarding" regexp:/etc/postfix/headerchecks<BR></DIV> <DIV> </DIV> <DIV>This comes back with nothing - i thought it might coma back with a = match ?</DIV> <DIV> </DIV> <DIV>Laurence<BR><BR>>>> "Laurence Moughan" <Laurence.Moughan@a= erlingus.com> 16/09/09 12:00:15 >>><BR></DIV> <DIV style=3D"FONT: 10pt Tahoma; COLOR: #000000"> <DIV>Hi All,</DIV> <DIV> </DIV> <DIV>Would someone just please give me a headsup on the format for reg exp = headerchecks files,</DIV> <DIV> </DIV> <DIV>Im not sure how to format for searching for a string within an email = address,</DIV> <DIV> </DIV> <DIV>eg</DIV> <DIV> </DIV> <DIV>to reject all mail with the word "boarding" eg for the from = address <A href=3D"mailto:boarding_pc(a)domain.com">boarding_pc(a)domain.com</A= > and <A href=3D"mailto:newboarding_pcnew(a)domain.com">newboarding_pcne= w(a)domain.com</A></DIV> <DIV> </DIV> <DIV>I have </DIV> <DIV> </DIV> <DIV>/^From:(.*)boarding_pc\@domain\.com/ REJECT junk<BR>/^From:(*)boarding= (*)\@adomain\.com/ REJECT junk<BR>/^From: *boarding*\@domain\.com/&nb= sp; REJECT junk<BR>/^From: (.*)boarding(.)*\@domain\.com/= REJECT junk</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>this is working now - </DIV> <DIV> </DIV> <DIV>which one is right ?</DIV> <DIV> </DIV> <DIV>im a bit confused</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>Thanks</DIV> <DIV> </DIV> <DIV>Laurence<BR></DIV></DIV></BODY></HTML> --=__PartA18A56F8.0__=--
From: Wietse Venema on 16 Sep 2009 08:00 Laurence Moughan: > Hi All, > > Would someone just please give me a headsup on the format for reg > exp headerchecks files, This is documented. man 5 regexp_table man 5 header_checks man 7 regex Wietse
From: LuKreme on 16 Sep 2009 09:54
On 16-Sep-2009, at 05:28, Laurence Moughan wrote: > postmap -q "boarding" regexp:/etc/postfix/headerchecks > > This comes back with nothing - i thought it might coma back with a > match ? > /^From:(.*)boarding_pc\@domain\.com/ REJECT junk > /^From:(*)boarding(*)\@adomain\.com/ REJECT junk > /^From: *boarding*\@domain\.com/ REJECT junk > /^From: (.*)boarding(.)*\@domain\.com/ REJECT junk Your regex all require an '@domain\.com. First, change them to one line as Martijn suggested: /^From: .*boarding.*\@domain\.com$/ REJECT junk Note the $ at the end of the match, that is quite important. then postmap -q "boarding(a)doamin.com" regexp:/etc/postfix/headerchecks Also, be sure and test anything like this very carefully. You might even consider running it with a WARN instead of REJECT for a time. I would recommend that instead of 'junk' you have a longer description, even if it is only "Boarding Junk", but "Suspicious user name BOARDING not allowed" is probably better. -- Instant karma's going to get you! |