Rt-mailgate chokes on multi-line email subject headers

I am running RT 3.0.6 using mod_perl, apache 1.3 and postgres 7.3 on FreeBSD 4.8

After some testing with a troublesome email I have determined that rt-mailgate chockes when the Subject line contains a newline. I dont know if any email RFCs actually allows Subject lines with newlines but we received a support request from a client which had this issue.

So the Subject header looks something like this:

X-Some-Headers: some stuff
software YYY on OS ZZZ
X-Rest-Of-Headers: more stuff

I got a bunch of not very enlightening error messages in my rt-error-log. The problem is pretty easily replicateable, you just need to compose a message that contains a Subject line like the above and pipe it through rt-mailgate with the right parameters.

If anyone has any experience with anything like this, please let me know.
If it is necessary to look at the error messages I got, I will be happy to supply them.

Wynand van Dyk

After some testing with a troublesome email I have determined that
rt-mailgate chockes when the Subject line contains a newline. I dont know
if any email RFCs actually allows Subject lines with newlines but we
received a support request from a client which had this issue.

Yes, it’s legal. It’s even the example used to illustrate folding in RFC 2822
(sec. 2.2.3, “Long Header Fields”):

For example, the header field:


can be represented as:

 	  is a test

Ross A. Patterson
Chief Technology Officer
CatchFIRE Systems, Inc.
5885 Trinity Parkway, Suite 220
Centreville, VA 20120
(703) 563-4164

It’s helpful if you can send examples that make RT fail to
rt-bugs@fsck.com as GZIPPED attachments, so that they don’t make our RT
fail when it tries to parse them. That said, I was pretty sure that we
had tesxted this functionality in the past.On Thu, Oct 09, 2003 at 03:34:51PM +0200, wvd@cequrux.com wrote:

I am running RT 3.0.6 using mod_perl, apache 1.3 and postgres 7.3 on FreeBSD 4.8

After some testing with a troublesome email I have determined that rt-mailgate chockes when the Subject line contains a newline. I dont know if any email RFCs actually allows Subject lines with newlines but we received a support request from a client which had this issue.

So the Subject header looks something like this:

X-Some-Headers: some stuff
Subject: RE: [blah #blah] having a problem with feature XXX in
software YYY on OS ZZZ
X-Rest-Of-Headers: more stuff

I got a bunch of not very enlightening error messages in my rt-error-log. The problem is pretty easily replicateable, you just need to compose a message that contains a Subject line like the above and pipe it through rt-mailgate with the right parameters.

If anyone has any experience with anything like this, please let me know.
If it is necessary to look at the error messages I got, I will be happy to supply them.


Wynand van Dyk


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.

yes , the same problem for RT 3.0.3, perl 5.8 for RH 8
DecodeMIMEWordsToUTF8 sub in lib/RT/I18N.pm is unable to decode
correctly mult-line subject.
the standard perl 5.8.0 Encode module provides the functionality, here
is my patched sub :

sub DecodeMIMEWordsToUTF8 {
my $str = shift;
use Encode qw/decode/;
return decode(‘MIME-Header’, $str);
}

Ross Patterson wrote:>On Thursday 09 October 2003 09:34 am, wvd@cequrux.com wrote:

After some testing with a troublesome email I have determined that
rt-mailgate chockes when the Subject line contains a newline. I dont know
if any email RFCs actually allows Subject lines with newlines but we
received a support request from a client which had this issue.

Yes, it’s legal. It’s even the example used to illustrate folding in RFC 2822
(sec. 2.2.3, “Long Header Fields”):

For example, the header field:

  Subject: This is a test

can be represented as:

  Subject: This
    is a test

Omar Dahhani - inet6
o 51, rue de Verdun
/ _ __ _ 92158 Suresnes cedex
/ /\ /_ / /_ France
/ /_ / /_/ Tel. +33 (0) 1 41 44 85 37
Inetsys S.A. Fax +33 (0) 1 46 97 20 10