Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Whenever I try to move an email from a local Junk folder to an IMAP folder in Thunderbird, I get the following error message:

The current command did not succeed. The mail server responded: Message contains invalid header

If Thunderbird's Junk folder is an IMAP folder on the server, then after Thunderbird has moved messages to that folder, I can successfully move messages from Junk back into to some other IMAP folder. However, if the Junk folder is not on the server, then moving a message from the local Junk folder to an IMAP folder yields the aforementioned error.

The only interesting thing I've found about this error is "Message contains invalid header" from the MozillaZine Knowledge Base. That article officially is about importing folders from another email client, and does not mention the Junk filter as another possible cause. However the proposed solution is not very helpful since it requires manual editing of the message box files.

Any better ideas?

EDIT: make sure you read the comments before answering the question.

share|improve this question
    
Have you confirmed that the article indeed describes your problem? (Like by viewing the mbox files, and did you indeed ever import messages from another email client?) And what OS are you on? –  Arjan Sep 16 '09 at 10:38
    
Actually I've tried a bit more, and the problem only occurs when the spam filter puts mail in my local folder, and I want to put it back. I guess TB's junk filter adds a non-standard header to the mail. –  Peltier Sep 16 '09 at 11:11
    
Hmmm, maybe as a workaround you can try to store your Junk folder on the server as well? I doubt it will result in other headers, but you could try if no helpful answers are posted. Any chance you can show the relevant headers here, as copied from an mbox file? –  Arjan Sep 16 '09 at 11:25
    
>maybe as a workaround you can try to store your Junk folder on the server as well? It does work this way, but I'd really like to avoid storing junk on my saturated IMAP account :-/ –  Peltier Sep 18 '09 at 11:13
    
Hmmm, it seems to me that the article you found (which was about problems with imported messages) does not really apply then? But of course, it does provide useful insight in how messages are stored. Maybe add the following to the question then? If Thunderbird's Junk folder is an IMAP folder on the server, then after Thunderbird has moved messages to that folder, I can move messages from Junk into to some other IMAP folder. However, if the Junk folder is not on the server, then moving a message from the (local) Junk folder to an IMAP folder yields the following error: [..] –  Arjan Sep 18 '09 at 11:29

2 Answers 2

up vote 2 down vote accepted
+50

Found this article : "Fix invalid mail headers when moving from Thunderbird to IMAP", where a Python script is proposed that fixes all mailbox files in a given directory.

Even if you don't use Python, it should be quite easy to do the same in another language or a text-editor or sed. Apparently, this fixed the problem for the author of the article.

share|improve this answer
    
What's interesting in that article is its statement Thunderbird adds invalid mail headers to it's local folders. It does, however, wrongly refer to the KB article Peltier already found, which is about If you import a folder from another email client. The script Removes ">From" and "From " lines from mail headers but Real "From:" lines have a colon and are not touched. So, this answer seems a good solution, but before applying it I'd still want to see the headers from the mbox-file. For example: I'd want to be sure that each message still has a "From" as its very first line. –  Arjan Sep 21 '09 at 11:02
    
Be sure to read the comment(s) below that article! –  Arjan Sep 21 '09 at 11:15

Actually, I found another thing that causes this error. I converted my Outlook mail to Thunderbird via a program called MailStore Home and in some of the results mbox files there were extraneous lines with the following

Microsoft Mail Internet Headers Version 2.0

Once I removed those lines, messages that hadn't been able to move to an IMAP folder were able to be moved.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.