List Info

Thread: RFC822 Carriage return problem




RFC822 Carriage return problem
user name
2006-07-17 18:47:12
Hi,

Could anyone explain to me why amavisd-new seems to find
headers ended with 
<CRLF> as a BAD Header.
After reading RFC822 and RFC2821 I am a bit confused why
amavisd-new will not 
accept this as a good header.
According to RFC822 the header field needs to be terminated
by <CRLF>.

My setup is postfix -> amavisd-new -> postfix(lmtp)
-> virtual 


Postfix version: postfix-2.2.10_1,1
Amavisd-new version: amavisd-new-2.4.1_1,1 
Spamassassin version: p5-Mail-SpamAssassin-3.1.3

Problem:

Return-Path: <>
Delivered-To: bad-header-quarantine
X-Envelope-From: <rootxxxxxxx>
X-Envelope-To: <matthewiu.nl>
X-Quarantine-ID: <WIsm0Gds-9kP>
X-Amavis-Alert: BAD HEADER Improper use of control character
(char 0D hex):
        Reply-To: Matthew <matthewiu.nl>\r\n
Received: from xxxxx ([127.0.0.1])
        by localhost (xxxxx[127.0.0.1]) (amavisd-new, port
10024)
        with LMTP id WIsm0Gds-9kP for <matthewiu.nl>;
        Thu, 13 Jul 2006 15:12:08 +0200 (CEST)
Received: by xxxxxx (Postfix, from userid 0)
        id D4087E4853; Thu, 13 Jul 2006 15:12:08 +0200
(CEST)
To: matthewiu.nl
Subject: Testing html mail
From: Matthew <matthewiu.nl>
Reply-To: Matthew <matthewiu.nl>
MIME-Version: 1.0
Content-Type: text/html; charset=iso-8859-1
Message-Id: <20060713131208.D4087E4853xxxxxxx>
Date: Thu, 13 Jul 2006 15:12:08 +0200 (CEST)


<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 
4.01//EN' 'http://www.w3.o
rg/TR/html4/strict.dtd'>
<html>
        <head>
                <meta
http-equiv="Content-Type"
content="text/html; 
charset=iso-8859-1">
                <style type="text/css">
                        <!--
                        body {
                                background-color: #FFFFFF;
                        }
                        -->
                </style>
        </head>
        <body>
                <div align="center">
                <p> Image testing</p>
                <img src="http://www.iu.nl/nl/lo
go04.gif">

                <p> Table testing </p>
                <table>
                        <tr>
                                <th> Test</th
                        </tr>
                        <tr>
                                <td>
Testing</td>
                        </tr>
                </table>

                <p> Text size testing </p>
                <h1>Foo</h1>
                <h2>Bar</h2>
                <h3>Foo</h3>
                <h4>Bar</h3>
                <h5>Foo</h5>
                </div>
        </body>
</html>

When I replace \r\n with \n amavisd-new seems to find the
header just fine.
So it seems to me that amavisd-new isn`t keeping up to the
old RFC 822.
Is there a special reason why amavis should even consider
this header bad?

For the information I used a simple test mail with php

Simple test code where it fails upon:

<?

// message
$message = "
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 
4.01//EN' 'http://www.w3.o
rg/TR/html4/strict.dtd'>
<html>
        <head>
                <meta
http-equiv=\"Content-Type\"
content=\"text/html; 
charset=iso-8859-1\">
                <style
type=\"text/css\">
                        <!--
                        body {
                                background-color: #FFFFFF;
                        }
                        -->
                </style>
        </head>
        <body>
                <div align=\"center\">
                <p> Image testing</p>
                <img src=\"http://www.iu.nl/nl/lo
go04.gif\">

                <p> Table testing </p>
                <table>
                        <tr>
                                <th> Test</th
                        </tr>
                        <tr>
                                <td>
Testing</td>
                        </tr>
                </table>

                <p> Text size testing </p>
                <h1>Foo</h1>
                <h2>Bar</h2>
                <h3>Foo</h3>
                <h4>Bar</h3>
                <h5>Foo</h5>
                </div>
        </body>
</html>
";

// Recipient
$to = "matthewiu.nl";

// Subject
$subject = "Testing html mail";

// headers
$headers = "From: Matthew <matthewiu.nl>\r\n";
$headers .= "Reply-To: Matthew <matthewiu.nl>\r\n";
$headers .= "MIME-Version: 1.0" .
"\r\n";
$headers .= "Content-Type: text/html;
charset=iso-8859-1" . "\r\n";

// Lets mail this test
mail($to, $subject, $message, $headers);
?>

Thanks

With kind regards

Matthew Whittaker-Williams

-- 
Unix system & Network Engineer
Internet Unie Services B.V.
Postbus 23667
1100 ED  AMSTERDAM
Tel: +31(0)20 463 0506
Fax: +31(0)20 463 2146
Email: m.whittaker-williamsiu.nl
URL: http://iu.nl
PGP: 0x08A909D0
Ripe nic-handle: MW2861-RIPE

------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief surveys
-- and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/
RFC822 Carriage return problem
user name
2006-07-17 20:13:27
At 01:47 PM 7/17/2006, Matthew Whittaker-Williams wrote:
>Hi,
>
>Could anyone explain to me why amavisd-new seems to find

>headers ended with
><CRLF> as a BAD Header.
>After reading RFC822 and RFC2821 I am a bit confused why

>amavisd-new will not
>accept this as a good header.
>According to RFC822 the header field needs to be 
>terminated by <CRLF>.

The RFC's define what a message looks like during SMTP 
transfer, not what a unix file should look like.

-- 
Noel Jones 


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief surveys
-- and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/
RFC822 Carriage return problem
user name
2006-07-28 15:50:27
Matthew,

> Could anyone explain to me why amavisd-new seems to
find headers ended with
> <CRLF> as a BAD Header.

It doesn't. Perhaps you had a sequence CR CR LF in the SMTP
protocol.

> After reading RFC822 and RFC2821 I am a bit confused
why amavisd-new will
> not accept this as a good header.
> According to RFC822 the header field needs to be
terminated by <CRLF>.

On the wire (SMTP protocol), lines end with CR LF.
When mail is store to a Unix file, lines end with LF,
i.e. CRLF line endings are converted to LF line endings.

If you had a CR CR LF on the wire, this would end up as CR
LF on a file,
which it is illegal.

> X-Amavis-Alert: BAD HEADER Improper use of control
character (char 0D hex):
>         Reply-To: Matthew <matthewiu.nl>\r\n
> ...
> When I replace \r\n with \n amavisd-new seems to
find the header just fine.
> So it seems to me that amavisd-new isn`t keeping up to
the old RFC 822.
> Is there a special reason why amavis should even
consider this header bad?

My guess is that whatever software inserted the Reply-To
header field,
did it incorrectly, leaving there one extra CR.

  Mark

------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief surveys
-- and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )