diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index b8b47c890c8..84e539c8b20 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -4393,8 +4393,10 @@ NS_IMETHODIMP nsImapMailFolder::GetCurMoveCopyMessageFlags(nsIImapUrl *runningUr if (label != 0) *aResult |= label << 25; } - else if (mFlags & MSG_FOLDER_FLAG_DRAFTS) // if the message is being added to the drafts folder, don't add the seen flag (Bug #198087) - *aResult = 0; + // if the message is being added to the Sent or Templates folders, + // add the seen flag so the message gets marked read + else if (mFlags & (MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_TEMPLATES)) + *aResult = MSG_FLAG_READ; } return NS_OK; } diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index 292812e371b..21f71cf1276 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -5076,15 +5076,13 @@ void nsImapProtocol::OnAppendMsgFromFile() char *mailboxName = OnCreateServerSourceFolderPathString(); if (mailboxName) { - imapMessageFlagsType flagsToSet = kImapMsgSeenFlag; - // we assume msg is read, for appending to sent/drafts folder, because - // in that case, we don't have a msg hdr (and we want the msg to be read) - PRUint32 msgFlags = MSG_FLAG_READ; + imapMessageFlagsType flagsToSet = 0; + PRUint32 msgFlags = 0; if (m_imapMessageSink) m_imapMessageSink->GetCurMoveCopyMessageFlags(m_runningUrl, &msgFlags); - if (!(msgFlags & MSG_FLAG_READ)) - flagsToSet &= ~kImapMsgSeenFlag; + if (msgFlags & MSG_FLAG_READ) + flagsToSet |= kImapMsgSeenFlag; if (msgFlags & MSG_FLAG_MDN_REPORT_SENT) flagsToSet |= kImapMsgMDNSentFlag; // convert msg flag label (0xE000000) to imap flag label (0x0E00)