On Fri, Mar 22, 2013 at 09:04:21AM +0000, Chris Green wrote:
> On Thu, Mar 21, 2013 at 05:06:17PM -0500, Derek Martin wrote:
> > On Wed, Mar 20, 2013 at 06:08:49PM -0500, David Champion wrote:
> > > There absolutely should be a blank line.  I think though that the order
> > > is wrong: mutt expects that a message (i.e. a From_ line) appears at
> > > the old EOF marker, and that the EOF marker is on/after a blank line.
> > > I think that if you adjust your filter to write the message and then a
> > > blank line instead of a blank line and then a message, the error will go
> > > away.
> > 
> > This matches my expectation also.
> > 
> That's all very well but it does have some issues:-
> 
> What should an MTA do if there *isn't* a blank line at the end of
> the current mbox where it is going to append a new message?  

That's a reasonable question (technically MTA does not come into play
here, this is an MDA or MUA behavior).  To be 100% correct, most
likely the mailer should CHECK what the state of the mailbox is, add a
blank line if required, and NOT add a blank line if one is there.
That's more work than making assumptions, but it's not so horrible.
But it does seem that M*A software in general expects the trailing
blank line, so it should always ensure it's there on messages it
writes itself.  This makes sense: the blank line is often called the
"message separator", but what it really is is the end of message
indicator.  Thinking about it as a separator leads to thinking that
it's optional if there's not a subsequent message, which leads to the
problem you're having.

> It seems to me that what the Python libraries do guarantees that
> there will always be a blank line before the 'From ' line, if
> there's one already then it doesn't matter too much.

It does change the content of the last message though, which is
incorrect behavior.  You say it doesn't matter much, but it might, if
you have some automated process that expects a particular mailbox to
be in a particular state.  What does it do if you subsequently delete
the last message, and then add another one?  My suspicion is that it
might add yet another blank line, which clearly is wrong.  Though in
any case, adding even a single extra blank line is wrong.

> Mutt itself *doesn't* put a blank line there, if you S[ave] or
> C[opy] messages to a new mbox the messages have no blank lines
> before the 'From '.

Yet it works with every MDA I've ever used... which seems to suggest
that this is the expected behavior, and that the Python library got it
wrong.  And to be honest it's not really *that* surprising... I've
seen other cases where Python libraries were doing it wrong (whatever
"it" might be).

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.

Attachment: pgp__ftuSj8U5.pgp
Description: PGP signature

Reply via email to