Bug 2031 - Headers are subjected to word wrap when messages are forwarded
Summary: Headers are subjected to word wrap when messages are forwarded
Status: REOPENED
Alias: None
Product: Claws Mail (Windows)
Classification: Unclassified
Component: default (show other bugs)
Version: 3.7.4
Hardware: PC Windows XP
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2009-10-29 22:50 UTC by Neil Darlow
Modified: 2011-05-16 04:28 UTC (History)
1 user (show)

See Also:


Attachments
Message submitted to SpamCop (from Sent Folder) (2.98 KB, text/plain)
2009-10-30 19:32 UTC, Neil Darlow
Details
SpamCop View Full Message result (3.76 KB, text/plain)
2009-10-30 19:37 UTC, Neil Darlow
Details
test message and forwarded copies (1.89 KB, application/octet-stream)
2011-05-16 04:28 UTC, Denis Laxalde
Details

Description Neil Darlow 2009-10-29 22:50:40 UTC
Claws-Mail-3.7.3cvs2

I forward multiple messages, as attachments, to SpamCop. These attachments feature a Received-SPF: header which is formatted as a single long line of text.

Viewing the headers of a received message shows the Received-SPF: header word wrapped on the screen (which I guess is OK) but when such a message is forwarded to SpamCop the header is word wrapped in the outgoing attachment also.

Disabling all Claws-Mail Wrapping options appears to have no effect on the header being word wrapped so I conclude this behaviour must be a bug.

It seems sensible, to me, that word wrapping should only apply to a message body and not to accompanying headers or attachment content.
Comment 1 Michael Rasmussen 2009-10-29 23:12:50 UTC
Mail headers are subjective to rules. A header line must only hold up to 1000 characters according to the RFC, if I remember currect.
Comment 2 Neil Darlow 2009-10-29 23:20:54 UTC
I understand the 1000 character limit for headers exists but the header that is being wrapped is considerably shorter than that.
Comment 3 Michael Rasmussen 2009-10-29 23:27:24 UTC
I haven't seen your header line so my information was more an information to you what could have been the cause to your wrapped line.
Comment 4 Colin Leroy 2009-10-30 09:29:13 UTC
1000 characters is the utter maximum limit. But, quoting RFC 2822

2.1.1 Line Length Limits
"Each line of characters SHOULD be no more than 78 characters" 

2.2.3 Long Header Fields
"The field body portion of a header field can be split into a multiple line representation"

Re-wrapping headers to make no line longer than 78 characters is RFC-compliant, standard compliant, and MUST NOT (to speak in RFC terms) change anything on the receiving side, or the receiving side isn't RFC-compliant.

I don't think rewrapping the Received-SPF header confuses SpamCop in any way...

Of course, if this header is rewrapped incorrectly, instead of "folded" (that is, subsequent lines don't start with a space or tab), then please reopen the bug.
Comment 5 Neil Darlow 2009-10-30 11:20:52 UTC
I believe it is the case that the Received-SPF header is not correctly folded.

SpamCop submissions from Claws Mail result in an "Unable to parse head" error and the header is shown wrapped (without a leading space/tab on the second line) but submissions from KMail on Linux parse correctly and SpamCop shows a horizontal scrollbar to permit viewing of the header.

The fact that both my clients (Claws Mail on Windows and KMail on Linux) are configured identically to submit messages to SpamCop but only show errors for the Claws Mail case would suggest that my trnasmission chain isn't modifying the header in any way but there is cause for further investigation of Claws Mail.

The Received-SPF header is generated, on my server, by postfix-policyd-spf-perl and this has already been investigated as generating < 1000 character single-line headers.

One additional piece if information relating to my Claws Mail/Windows setup, which may be of relevance, is that I PGP/MIME sign my submissions to SpamCop using the Claws Mail PGP core plugins (all from the gpg4win latest Colin snapshot).
Comment 6 Colin Leroy 2009-10-30 11:37:47 UTC
Can you attach one of the forwarded mails (by Claws) ?
Comment 7 Neil Darlow 2009-10-30 18:28:44 UTC
Do you want the message before forwarding (saved with Export selected to mbox...) or a copy-and-paste of what SpamCop received?
Comment 8 Colin Leroy 2009-10-30 18:50:03 UTC
I want the one in your Sent box :)
Comment 9 Neil Darlow 2009-10-30 19:32:32 UTC
Created attachment 742 [details]
Message submitted to SpamCop (from Sent Folder)

The header of interest is Received-SPF which looks OK here but see accompanying SpamCop submission transcript.
Comment 10 Neil Darlow 2009-10-30 19:37:02 UTC
Created attachment 743 [details]
SpamCop View Full Message result

The header of interest is Received-SPF: which is mangled. SpamCop reports an error of "Can't parse head".

Submissions made using KMail under Linux don't result in this error so, unless SpamCop is broken, the problem appears Claws-specific although the Sent Folder copy appears to suggest the header is OK.
Comment 11 Colin Leroy 2009-10-30 20:07:29 UTC
Thanks ! It looks like the sent message has the Received-SPF header unwrapped... The problem may be introduced by some mail server between yours and SpamCop.

From Kmail under Linux, is the smtp server you use the same as with Claws on windows ?
Comment 12 Neil Darlow 2009-10-30 20:35:36 UTC
Yes, I operate my own SMTP and IMAP services. Claws and KMail are configured to access the services identically i.e. SMTP-Auth+STARTTLS and submissions appear to go directly to SpamCop (IronPort).

I might as well add that Outlook Express submits messages to SpamCop also without error (although they're not PGP/MIME signed) so Claws submissions appear to be the only ones affected.

Is it possible that the Sent Folder copy of the forwarded mail isn't indicative of what was actually happening during the SMTP session?
Comment 13 Colin Leroy 2009-10-30 20:54:39 UTC
No, that's not possible... or unheard of.

Can you forward me a spam like you do to spamcop ? (colin@colino.net)

Thanks!
Comment 14 Neil Darlow 2009-11-02 15:17:50 UTC
Information only: Spam forwarded as requested on 30/10/2009.
Comment 15 Neil Darlow 2009-12-18 09:51:01 UTC
I have been running Thunderbird 3.0 for Windows for several days now and made dozens of submissions to SpamCop - none of which have failed.

I am now sure that this problem is related to Claws-Mail on Windows. There are occasional successful submissions but the large majority fail.
Comment 16 Denis Laxalde 2011-05-16 04:23:53 UTC
I'm experiencing a similar issue. Basically, if there are several recipients in e.g. the To field, the corresponding line will be wrapped in the forwarded message (which is ok) but the following header line will appear on the same line as the previous one instead of in a new line.
As far as I can tell, this seems to be related to the "auto wrapping" option since, if not activated, headers are printed correctly in forwarded messages.

I'm using Claws-Mail 3.7.9 under Debian GNU/Linux.
Comment 17 Denis Laxalde 2011-05-16 04:28:10 UTC
Created attachment 982 [details]
test message and forwarded copies

A test message with multiple recipients and forwarded copies with and without auto wrapping. All message were saved as drafts.
When auto wrapping is on, the To header is wrapped in the forwarded message and the Subject header (which here follows the To one) does not start on a new line.

Note You need to log in before you can comment on or make changes to this bug.