Bug 137705 - Saving a message with "From ..." or ">From ..." in the headers without a colon in that line reports "Message contains invalid header"
Summary: Saving a message with "From ..." or ">From ..." in the headers without a colo...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: cyrus-imapd
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Petr Rockai
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-31 01:14 UTC by Steven Lawrance
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-26 13:44:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch that accepts "From " and ">From " as valid header lines (1.25 KB, patch)
2004-10-31 01:16 UTC, Steven Lawrance
no flags Details | Diff
Spec file with the patch included (40.08 KB, text/plain)
2004-10-31 01:20 UTC, Steven Lawrance
no flags Details

Description Steven Lawrance 2004-10-31 01:14:24 UTC
Description of problem:
When saving a message from a MUA such as Mozilla Mail that contains at
least one line like any of the following two lines, the server returns
an error saying "Message contains invalid header"

From liboe@linux  Sun Jun 11 19:48:24 2000
>From - Sat Oct 30 11:46:51 2004

I'm not sure when this strange From line gets added, but it happened
on a message that I received through cyrus-imapd correctly that I
moved to my Mozilla Mail archive. When I tried to copy or move that
message back to cyrus-imapd, the server prevented it with the "Message
contains invalid header" message. Most messages that I archive in the
same manner from the same server don't have the strange From line
added, though some do. In all cases, a validly-formed From: line also
exists, making the invalid From line unnecessary. The specifics of
what creates a strange From line are unknown to me, and more research
may be necessary.

I searched Google and found that people in the past had run into this
and came up with solutions ranging from `grep -v`ing their mbox files
to changing message.c to accept the space character as valid when
validating the header. While I could have filed a bug with Mozilla to
strip out the strange From and >From lines when saving to IMAP, I
opted to patch cyrus-imapd instead to accept those two special cases
while preventing spaces in other header names.

Here are some historical references to this bug:
http://asg.web.cmu.edu/archive/message.php?mailbox=archive.info-cyrus&msg=10649
http://www.irbs.net/internet/info-cyrus/0206/0744.html
http://archives.neohapsis.com/archives/postfix/2000-11/0070.html

From the referenced sources above, it looks like this may affect other
MUAs as well.


Version-Release number of selected component (if applicable):
cyrus-imapd-2.2.6-2.FC3.6

How reproducible:
Always

Steps to Reproduce:
1. Using a MUA (I used Mozilla Mail 1.7.2), copy or move a message
containing a "From " or ">From " line in the header without a colon in
that line to a cyrus-imapd folder


Actual Results:  Operation fails with "Message contains invalid header"

Expected Results:  Message gets copied or moved properly, depending on
what the operation was.

Additional info:

I created a patch that special-cases "From " and ">From " as valid
header lines. Ideally, this should be fixed upstream, though at least
the patch can have a home for now.

Comment 1 Steven Lawrance 2004-10-31 01:16:06 UTC
Created attachment 105986 [details]
Patch that accepts "From " and ">From " as valid header lines

Comment 2 Steven Lawrance 2004-10-31 01:20:05 UTC
Created attachment 105987 [details]
Spec file with the patch included

I'm guessing that this patch may be an optional rpm-build-time parameter like
the others in the RPM, though it would be nice if it makes it into the
mainstream RPMs.

Comment 3 Yann Rouillard 2005-04-01 15:36:42 UTC
I confirm this bug, which is a bit annoying as it prevents some users to
manually migrate messages to the cyrus imap server.

Comment 4 Petr Rockai 2006-04-26 13:44:30 UTC
The RFC 2060 (IMAP4v1) says that the literal argument to APPEND SHOULD be in 
RFC 822 (Standard for ARPA Internet Text Messages, superseded by 2822, 
Internet Message Format) format. However, neither RFC 822 nor 2822 allows 
the From or >From line without colon.

As for exception to this (should) rule, rfc says:

      Note: There MAY be exceptions, e.g. draft messages, in which
      required [RFC-822] header lines are omitted in the message literal
      argument to APPEND.  The full implications of doing so MUST be
      understood and carefully weighed.

However, nothing is said about leading From lines. These lines most probably 
come from mbox files (as described in RFC 4155). So this is really a 
non-conforming behaviour on the part of the client. I would suggest filing 
bugs against the MUAs in question.

Comment 5 Steven Lawrance 2006-04-26 14:00:18 UTC
I agree. I actually had stopped using this patch as Thunderbird appears to not
exhibit this behavior anymore. So I'm totally okay with this [not-a-]bug being
closed :-).


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