Subject: | Headers should not be case sensitive |
Hi,
another issue when using headers_from_message. According to RFC 822 "Upper and lower case are not distinguished when comparing field-names." (see http://www.zvon.org/tmRFC/RFC822/Output/chapter9.html#sub2).
I was sending a message with Content-Type header specified, e.g:
-------message.txt------------
From: Administrator <david.heath@oneworld.net>
Content-Type: "text/plain"; charset="UTF-8"
Content-Transfer-Encoding: 8bit
To: "Administrator" <david.heath@oneworld.net>
JOBS: All Commercial Jobs Organisations
Show quoted text
> Caucasus Programme Officer (Maternity Cover)
> Researcher/Consultant
> Programme Directors - for Pakistan and India Programmes
----end message.txt------------------------
This was getting mangled due to Bulkmail.pm inserting another "Content-type" header (note lower case 't'). A transcript from a run using DummyServer follows:
--------NEW MESSAGE (connection reset)-------
RSET
quit
EHLO oneworld.net
--------NEW MESSAGE (connection reset)-------
RSET
MAIL FROM:<david.heath@oneworld.net>
RCPT TO:<david.heath@oneworld.net>
DATA
Date: Wed, 17 Nov 2004 11:24:19 +0000
From: "test sender" <david.heath@oneworld.net>
To: "test sender" <david.heath@oneworld.net>
Sender: david.heath@oneworld.net
Reply-To: "test sender" <david.heath@oneworld.net>
Precedence: list
Content-type: text/plain
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="UTF-8"
X-Bulkmail: 3.12
JOBS: All Commercial Jobs Organisations
Show quoted text> Caucasus Programme Officer (Maternity Cover)
> Researcher/Consultant
> Programme Directors - for Pakistan and India Programmes
---------------------
My MTA was not happy with this and mangled the mail further, resulting in something looking like this:
Return-Path: <david@davidheath.org>
X-Original-To: heathd@localhost
Delivered-To: heathd@localhost.vaux.oneworld.net
Received: from localhost (localhost.localdomain [127.0.0.1]) by
vau19.vaux.oneworld.net (Postfix) with ESMTP id 7E26E50008 for
<heathd@localhost>; Wed, 17 Nov 2004 05:47:11 -0500 (EST)
Received: from mx0.oneworld.net [217.72.172.242] by localhost with IMAP
(fetchmail-6.2.4) for heathd@localhost (single-drop); Wed, 17 Nov 2004
10:47:11 +0000 (GMT)
Received: from hathor.oneworld.net ([unix socket]) by hathor.oneworld.net
(Cyrus v2.1.15-Mandrake-RPM-2.1.15-8mdk) with LMTP; Wed, 17 Nov 2004
10:40:47 +0000
X-Sieve: CMU Sieve 2.2
Received: by hathor.oneworld.net (Postfix, from userid 90) id 6E6871141FC;
Wed, 17 Nov 2004 10:40:47 +0000 (GMT)
Received: from vau19.vaux.oneworld.net (unknown [217.196.236.241]) by
hathor.oneworld.net (Postfix) with ESMTP id 24BB51141FC for
<david.heath@oneworld.net>; Wed, 17 Nov 2004 10:40:37 +0000 (GMT)
Received: from oneworld.net (localhost.localdomain [127.0.0.1]) by
vau19.vaux.oneworld.net (Postfix) with ESMTP id 8550250008 for
<david.heath@oneworld.net>; Wed, 17 Nov 2004 05:42:48 -0500 (EST)
Date: Wed, 17 Nov 2004 10:42:48 +0000
From: Administrator <david.heath@oneworld.net>
To: "Administrator" <david.heath@oneworld.net>
Sender: david@davidheath.org
Reply-To: Administrator <david.heath@oneworld.net>
Precedence: list
X-Bulkmail: 3.12
Message-Id: <20041117104248.8550250008@vau19.vaux.oneworld.net>
X-Spam-Status: No, hits=0.1 required=5.0 tests=RCVD_IN_ORBS version=2.55
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
X-Sanitizer: Advosys mail filter
Subject: No Subject
Mime-Version: 1.0
text/plain; charset="UTF-8"
MIME-Version: 1.0
Content-Type: text/plain_text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
JOBS: All Commercial Jobs Organisations
Show quoted text> Caucasus Programme Officer (Maternity Cover)
> Researcher/Consultant
> Programme Directors - for Pakistan and India Programmes
---------------------
I think the offending code is Bulkmail.pm line 1994. This may have wider ramifications, e.g. the checks in sub header for 'From' etc. should probably be case insensitive as well.
In any case, I can work around this for now (by using Content-type) but thought I should point out this slightly incorrect behaviour.
Dave