Le 25/04/2011 04:07, ben thielsen a écrit :
> given two lines in header_checks, both work when testing with postmap, but 
> only one works when processing actual mail.  it's my sense that it's related 
> to the fact that the non working header check has to do with mail submitted 
> via sendmail(1), but i can't figure out what i'm doing wrong.
> 
>> cat message 
> Delivered-To: u...@gmail.com
> Return-Path: <u...@example.com>
> Received: from mta.example.com ([127.0.0.1])
>  by localhost (mta.example.com [127.0.0.1]) (amavisd-maia, port 10024)
>  with LMTP id 15153-02 for <u...@gmail.com>;
>  Sun, 24 Apr 2011 21:24:37 -0400 (EDT)
> Received: by mta.example.com (Postfix, from userid 2000)
>       id C359241692; Sun, 24 Apr 2011 21:24:37 -0400 (EDT)
> From: "u...@example.com" <u...@example.com>
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> Subject: meeting
> Date: Thu, 21 Apr 2011 21.47.30 -0400
> To: "u...@gmail.com" <u...@gmail.com>
> Mime-Version: 1.0
> X-Mailer: mail client
> 
> meeting will be today
> 
>> cat header_checks-ignored 
> /^Received:\s+by\s+mta\.example\.com\s+\(Postfix, from userid \d+\)\s+id/     
>         warn
> /^Received:\s+from\s+mta\.example\.com\s+\(\[127\.0\.0\.1\]\)\s+by\s+localhost\s+\(mta\.example\.com\s+\[127\.0\.0\.1\]\)\s+\(amavisd-maia\,\s+port
>  10024\)*/ warn
> 

what is the last "*" (the one after "\)") for? remove it and try again.
if you was meaning ".*", tyhen it's useless at the end of an expression.


>> postmap -hq - pcre:./header_checks-ignored < message 
> Received: from mta.example.com ([127.0.0.1])
>  by localhost (mta.example.com [127.0.0.1]) (amavisd-maia, port 10024)
>  with LMTP id 15153-02 for <u...@gmail.com>;
>  Sun, 24 Apr 2011 21:24:37 -0400 (EDT)        warn
> Received: by mta.example.com (Postfix, from userid 2000)
>       id C359241692; Sun, 24 Apr 2011 21:24:37 -0400 (EDT)    warn
> 
>> postconf header_checks
> header_checks = regexp:$config_directory/tables/header_checks-spam,
>               regexp:$config_directory/tables/header_checks-ignored
> 

you are not testing the same data. you test a "pcre" file, but your
postfix uses two regexp files.

>[snip]

Reply via email to