Double Carriage return breaks header ..

John Fawcett johnml at michaweb.net
Tue May 31 17:55:34 EDT 2005


Patrik Henningsson wrote:
> John Fawcett wrote:
> 
>> I found out that as I'm using amavis, the message arrives ok.
>> Amavis "corrects" the bad header and adds an additional header:
>>
>> X-Amavis-Alert: BAD HEADER Improper use of control character (char 0D
>> hex) in message header 'Subject'
>>      Subject: TEST\r\n ^
>>
>> If I take amavis out of the equation I see the same behaviour as you.
> 
> 
> I'm also running amavis and i get the "BAD HEADER" but i can't see that
> amavis is "correcting" anything for me.
> 
I did two tests, sending the same message
echo -e "Subject: TEST\r\r\n" | sendmail john (at) michaweb.net


This is the message stored in cyrus with amavisd-new running

Return-Path: <root at michaweb.net>
Received: from turate.michaweb.net (localhost [127.0.0.1])
         by imap.michaweb.net (Cyrus v2.2.12) with LMTPA;
         Tue, 31 May 2005 23:29:59 +0200
X-Sieve: CMU Sieve 2.2
Received: from localhost (localhost [127.0.0.1])
        by turate.michaweb.net (Postfix) with ESMTP id 8A25131E99
        for <john at michaweb.net>; Tue, 31 May 2005 23:29:57 +0200 (CEST)
Received: from turate.michaweb.net ([127.0.0.1])
 by localhost (turate [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 23346-01 for <john at michaweb.net>; Tue, 31 May 2005 23:29:49 +0200 (CEST)
Received: by turate.michaweb.net (Postfix, from userid 0)
        id AA2C725F0A; Tue, 31 May 2005 23:29:46 +0200 (CEST)
Subject: TEST
Message-Id: <20050531212946.AA2C725F0A at turate.michaweb.net>
Date: Tue, 31 May 2005 23:29:46 +0200 (CEST)
From: root at michaweb.net (root)
To: undisclosed-recipients:;
X-Virus-Scanned: by amavisd-new at michaweb.net
X-Amavis-Alert: BAD HEADER Improper use of control character (char 0D
hex) in message header 'Subject'
  Subject: TEST\r\n

This is the message stored in cyrus without amavisd-new running:

Return-Path: <root at michaweb.net>
Received: from turate.michaweb.net (localhost [127.0.0.1])
         by imap.michaweb.net (Cyrus v2.2.12) with LMTPA;
         Tue, 31 May 2005 23:33:47 +0200
X-Sieve: CMU Sieve 2.2
Received: by turate.michaweb.net (Postfix, from userid 0)
        id 1CFD7252B4; Tue, 31 May 2005 23:33:45 +0200 (CEST)
Subject: TEST
Message-ID: <cmu-lmtpd-23940-1117575227-0 at imap.michaweb.net>
Date: Tue, 31 May 2005 23:33:47 +0200

Message-Id: <20050531213345.1CFD7252B4 at turate.michaweb.net>
Date: Tue, 31 May 2005 23:33:45 +0200 (CEST)
From: root at michaweb.net (root)
To: undisclosed-recipients:;


So in the case without amavisd-new, cyrus is interpreting
Subject as the end of headers and is inserting it's own
message id and date.

If instead the message passes through amavisd-new, when it
comes out of amavisd-new it no longer has Subject: TEST\r\r\n
but just Subject: TEST\r\n. (I checked this by adding some
extra logging to postfix).

Both these test used lmtp.

Anyway that's just a curiosity, since we should do something
about the \r in header being interpreted as an an end of header
by cyrus.

John

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list