зеркало из https://github.com/mozilla/pjs.git
Bug #258489 --> Outgoing mail imported from Eudora shows raw HTML code
Migrating messages from the eudora sent folder / outbox...eudora doesn't mark html messages as being HTML so we need to sniff the first line of the body looking for a <html> tag. sr=bienvenu
This commit is contained in:
Родитель
e9533f85d9
Коммит
bb6a2967d0
|
@ -166,6 +166,7 @@ nsresult nsEudoraMailbox::DeleteFile( nsIFileSpec *pSpec)
|
|||
|
||||
|
||||
#define kComposeErrorStr "X-Eudora-Compose-Error: *****" "\x0D\x0A"
|
||||
#define kHTMLTag "<html>"
|
||||
|
||||
nsresult nsEudoraMailbox::ImportMailbox( PRUint32 *pBytes, PRBool *pAbort, const PRUnichar *pName, nsIFileSpec *pSrc, nsIFileSpec *pDst, PRInt32 *pMsgCount)
|
||||
{
|
||||
|
@ -297,6 +298,12 @@ nsresult nsEudoraMailbox::ImportMailbox( PRUint32 *pBytes, PRBool *pAbort, const
|
|||
*pBytes += (((body.m_writeOffset - 1 + headers.m_writeOffset - 1) / div) * mul);
|
||||
}
|
||||
|
||||
// Unfortunately Eudora stores HTML messages in the sent folder
|
||||
// without any content type header at all. If the first line of the message body is <html>
|
||||
// then mark the message as html internally...See Bug #258489
|
||||
if (body.m_pBuffer && body.m_writeOffset > sizeof(kHTMLTag) && (strncmp(body.m_pBuffer, kHTMLTag, sizeof(kHTMLTag)) == 0))
|
||||
bodyType = "text/html"; // ignore whatever body type we were given...force html
|
||||
|
||||
compose.SetBody( body.m_pBuffer, body.m_writeOffset - 1, bodyType);
|
||||
compose.SetHeaders( headers.m_pBuffer, headers.m_writeOffset - 1);
|
||||
compose.SetAttachments( &m_attachments);
|
||||
|
|
Загрузка…
Ссылка в новой задаче