Bug 137705 - Saving a message with "From ..." or ">From ..." in the headers without a colon in that line reports "Message contains invalid header"
Saving a message with "From ..." or ">From ..." in the headers without a colo...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: cyrus-imapd (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Petr Rockai
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-30 21:14 EDT by Steven Lawrance
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-26 09:44:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Steven Lawrance 2004-10-30 21:14:24 EDT
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-30 21:16:06 EDT
Created attachment 105986 [details]
Patch that accepts "From " and ">From " as valid header lines
Comment 2 Steven Lawrance 2004-10-30 21:20:05 EDT
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 10:36:42 EST
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 09:44:30 EDT
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 10:00:18 EDT
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.