[Dovecot] >From escaping

Mark E. Mallett mem at mv.mv.com
Tue Oct 5 17:29:08 EEST 2004

On Tue, Oct 05, 2004 at 05:13:36PM +0300, Timo Sirainen wrote:
> On 5.10.2004, at 16:59, Mark E. Mallett wrote:
> >That's interesting-- I'd guess that email clients are not going to
> >do the ">From" quoting unless they are reading/writing directly to
> >the mbox themselves, and not when accessing IMAP/POP folders.  This
> >would mean that an email client would see a potentially incorrect
> >message, and could corrupt an mbox by sending (for copy/append)
> >a message with missing quoting.  I would think that it would be the
> >responsibility of the IMAP/POP server to maintain the mbox
> >integrity (not to mention the correctness of the message).  But I
> >can see where it would be a pain, for sure.
> Dovecot (and eg. mutt) uses Content-Length header to figure out how 
> large the message body is, so clients can't mess anything by sending 
> From-lines. Also Dovecot requires that From-line has correct syntax and 
> valid timestamp or it's not treated as From-line.

Cool..  Just a little devil's advocation here:

That's great as long as dovecot is the only one that will ever touch
the mbox.  There are a lot of different "correct" formats of "From "
lines, including some homegrown ones, and there are various code
bases out there that recognize "From " separators in different ways.
That's one reason that intelligent "From " quoting/recognition is
not always better than being dumb about it (IMHO at least).  I favor
being aware of the fact that you might be maintaining an mbox that
has to be compatible with all manners of access.

As an aside, mutt uses content-length only if available, and
calculates it if not (I would assume dovecot generates it always, if
it's going to rely on it?).  (and in fact mutt, up to at
least, is broken in the way it recognizes "From " lines if the
content-length is missing: specifically, it would recognize "From " lines
even if not preceded by a blank line.. I patched it here.)


More information about the dovecot mailing list