(Charles added to To-list since the getmail list is subscriber-only and there is no obvious way to get a post-only subscription.)
> > Okay. So the actual problem here is that the original message contains the > > invalid content, and getmail's straight-paper-path tried very hard to > > preserve > > the original content as-is (i.e. don't rewrite messages Just Because). No, the original message is quite valid. Its content may not be what the sender intended, but it is quite legal for the body of an email message to contain arbitrary text, including lines beginning with "From ". If getmail produces an ill-formed mbox from well-formed input, the fault lies with getmail. The messages received from the IMAP server _need_ to be rewritten, for a very good reason: the mbox format requires it. You can't just concatenate mail messages into a file verbatim and call it a mbox. Even until now, From_-lines within the body of the message were >-escaped, but due to a bug in Python's email library, this didn't happen for multipart messages. If you are unwilling to fix the issue in getmail, I can just report it to the Python maintainers and once the email library works correctly, getmail users will eventually (years from now) reap the benefits. Even then, the python library produces mboxo instead of mboxrd, and getmail's documentation should reflect this, unless real mboxrd support is added. > Lauri Alanko acknowledges that he had an IMAP problem for his > environment in another bug report. That was a _different_ environment, not related to the current issue. And although that environment did in fact have a problem, the problem was reverse: it served contents of messages with From_-lines escaped, although the IMAP server should decode any escapings its internal storage format happens to use before sending the content. This is the crux of the problem, and the reason why imap-mbox -interaction isn't so straightforward: messages in a mbox file _must_ be From_-escaped. Messages transmitted through IMAP _must not_ be From_-escaped. Lauri -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

