On Fri, May 04, 2012 at 10:03:35PM -0400, Wietse Venema wrote:
> Vincent Lefevre:
> > I've received a mail having:
> > 
> > From: 
> > =?GB2312?B?tfXBoyy2/rrP0ru19cGjLMj9us/Su7X1waMsy8S6z9K7tfXBoyy3/srOtfXB?=
> > 
> > I wanted to reject such mail with
> > 
> > /^.=\?GB2312\?B\?/   REJECT GB2312 in headers

The OP showed that on two lines, but if it is, there would be leading 
whitespace. You want to match a whole logical header, not only a 
continued line. The expression should be:

/^From:.=\?GB2312\?B\?/   REJECT GB2312 in headers

Or, remove the anchor:

/=\?GB2312\?B\?/   REJECT GB2312 in headers

> > in header_checks.pcre, but this didn't work. I don't understand 
> > because
> > 
> >   postmap -q - pcre:/etc/postfix/header_checks.pcre < the_message
> > 
> > says that the rule applies on this line.
> 
> Try:
> 
>     postmap -h -q ....
> 
> This way you enforce that it looks at headers only.

One thing the header_checks(5) manual is not clear about is how to 
match the line end and leading whitespace. Is it matched by a single 
space in the expression, or would we have to replace spaces with 
something like this: "[[:blank:]]+" ?
-- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:

Reply via email to