[rt-users] bad rfc822 field name?
matt carter
matt at iseek.com.au
Wed Nov 14 21:07:38 EST 2001
Why would a \n get wacked in the middle of the subject line?
the offending portion is.
... at /opt/local/packages/rt2/lib/RT/Template.pm line 255
if ($headers) {
foreach $header (split(/\n/,$headers)) {
(my $key, my $value) = (split(/: /,$header,2));
chomp $key;
chomp $value;
$self->{'MIMEObj'}->head->fold_length($key,10000);
>> $self->{'MIMEObj'}->head->add($key, $value);
}
}
so this is consistent with what you are saying.
how do i get around this? shouldn't we be checking for the presence of :
before we just go and assume that the line is part of the header and split
on : ?
--matt
On Thu, 15 Nov 2001, Chris Pascoe wrote:
> Without looking at the code at all, I'm guessing there is some code in
> place designed to line wrap outgoing mail at a fixed width, and it's also
> operating on the header portion of the message. So a very long subject
> line gets a "\n" whacked in the middle of it, thus making the rest of the
> subject line look like it's starting a new rfc822 field... and then
> baulking. This is consistent with the "no blank line after subject: in
> template" that matt talks about.
>
> The outbound message ends up looking like:
>
> -- start mail
> To: blah
> From: blah
> Subject: blah blah blah blah blah blah blah blah blah blah blah blah \n
> testing 12 3 4 5 6
>
> message body
> -- end mail
>
> Which is obviously evil :). Again, I haven't looked at the code, so I
> can't suggest a fix, but hope this helps put someone on the right track.
>
> Chris
>
More information about the rt-users
mailing list