On Mon, 03 Oct 2011 23:12:57 +0100
Frank Leonhardt wrote:

> I'm having a great deal of trouble writing a rule to match something
> in a Received: header. The problem is that sendmail(?) is whitespace 
> wrapping the header. In other words, instead of:

Headers are converted into a single line before the header rules are
run against them. I think you've probably just made a silly mistake
somewhere.


$ cat /tmp/test.txt
Received: from [192.168.1.31] (mux.example.com [1.2.3.4])
     by mail.example.com(8.14.4/8.14.4) with ESMTP id abc1234
     (version=TLSv1/SSLv3 cipher=DHE-DSS-CAMELLIA256-SHA bits=256 verify=NO


$ grep TEST_RULE  /usr/local/etc/mail/spamassassin/local-rules.cf
score    TEST_RULE    0.001
header   TEST_RULE    Received =~ /ESMTP/


$ spamc -u test < /tmp/test.txt | grep " TEST_RULE"
        *  0.0 TEST_RULE TEST_RULE

Reply via email to