Fix for bug 83541. Use user domain for construct a part ID. The current code was bogus! R=varada, SR=sspitzer

This commit is contained in:
ducarroz%netscape.com 2001-10-12 21:25:10 +00:00
Родитель 13654d2c38
Коммит 3ca9b3f7a8
2 изменённых файлов: 4 добавлений и 11 удалений

Просмотреть файл

@ -1866,7 +1866,7 @@ mime_gen_content_id(PRUint32 aPartNum, const char *aEmailAddress)
GenerateGlobalRandomBytes(rand_buf2, randLen);
// Find the @domain.com string...
if ((!aEmailAddress) || (!*aEmailAddress))
if (aEmailAddress && *aEmailAddress)
domain = PL_strchr(aEmailAddress, '@');
if (!domain)

Просмотреть файл

@ -1794,16 +1794,9 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN
//
// Next, generate a content id for use with this part
//
PRUnichar *myEmail = nsnull;
if (NS_FAILED(mCompFields->GetFrom(&myEmail)))
m_attachments[i].m_content_id = mime_gen_content_id(locCount+1, nsnull);
else
{
nsCAutoString tEmail; tEmail.AssignWithConversion(myEmail);
m_attachments[i].m_content_id = mime_gen_content_id(locCount+1, tEmail);
}
nsXPIDLCString email;
mUserIdentity->GetEmail(getter_Copies(email));
m_attachments[i].m_content_id = mime_gen_content_id(locCount+1, email.get());
if (!m_attachments[i].m_content_id)
return NS_ERROR_OUT_OF_MEMORY;