From: "Laurence Moughan" on
--=__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>&nbsp;</DIV>
<DIV>Would someone just please give me a headsup on the format for reg exp =
headerchecks files,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Im not sure how to format for searching for a string within an email =
address,</DIV>
<DIV>&nbsp;</DIV>
<DIV>eg</DIV>
<DIV>&nbsp;</DIV>
<DIV>to reject all mail with the word "boarding"&nbsp; eg for the from =
address <A href=3D"mailto:boarding_pc(a)domain.com">boarding_pc(a)domain.com</A=
>&nbsp;and <A href=3D"mailto:newboarding_pcnew(a)domain.com">newboarding_pcne=
w(a)domain.com</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>I have </DIV>
<DIV>&nbsp;</DIV>
<DIV>/^From:(.*)boarding_pc\@domain\.com/ REJECT junk<BR>/^From:(*)boarding=
(*)\@adomain\.com/&nbsp; REJECT junk<BR>/^From: *boarding*\@domain\.com/&nb=
sp;&nbsp;&nbsp;&nbsp; REJECT junk<BR>/^From: (.*)boarding(.)*\@domain\.com/=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REJECT junk</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>this is working now - </DIV>
<DIV>&nbsp;</DIV>
<DIV>which one is right ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>im a bit confused</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks</DIV>
<DIV>&nbsp;</DIV>
<DIV>Laurence<BR></DIV></BODY></HTML>

--=__Part78538F2F.0__=--
From: Martijn de Munnik on
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
--=__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>&nbsp;</DIV>
<DIV>eg</DIV>
<DIV>&nbsp;</DIV>
<DIV>postmap -q "boarding" regexp:/etc/postfix/headerchecks<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>This comes back with nothing - i thought it might coma back with a =
match ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Laurence<BR><BR>&gt;&gt;&gt; "Laurence Moughan" &lt;Laurence.Moughan@a=
erlingus.com&gt; 16/09/09 12:00:15 &gt;&gt;&gt;<BR></DIV>
<DIV style=3D"FONT: 10pt Tahoma; COLOR: #000000">
<DIV>Hi All,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Would someone just please give me a headsup on the format for reg exp =
headerchecks files,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Im not sure how to format for searching for a string within an email =
address,</DIV>
<DIV>&nbsp;</DIV>
<DIV>eg</DIV>
<DIV>&nbsp;</DIV>
<DIV>to reject all mail with the word "boarding"&nbsp; eg for the from =
address <A href=3D"mailto:boarding_pc(a)domain.com">boarding_pc(a)domain.com</A=
>&nbsp;and <A href=3D"mailto:newboarding_pcnew(a)domain.com">newboarding_pcne=
w(a)domain.com</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>I have </DIV>
<DIV>&nbsp;</DIV>
<DIV>/^From:(.*)boarding_pc\@domain\.com/ REJECT junk<BR>/^From:(*)boarding=
(*)\@adomain\.com/&nbsp; REJECT junk<BR>/^From: *boarding*\@domain\.com/&nb=
sp;&nbsp;&nbsp;&nbsp; REJECT junk<BR>/^From: (.*)boarding(.)*\@domain\.com/=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REJECT junk</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>this is working now - </DIV>
<DIV>&nbsp;</DIV>
<DIV>which one is right ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>im a bit confused</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks</DIV>
<DIV>&nbsp;</DIV>
<DIV>Laurence<BR></DIV></DIV></BODY></HTML>

--=__PartA18A56F8.0__=--
From: Wietse Venema on
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
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!