firemail
标题:
imap草稿箱相关逻辑
[打印本页]
作者:
hechengjin
时间:
2016-4-8 20:59
标题:
imap草稿箱相关逻辑
本帖最后由 hechengjin 于 2016-4-8 21:30 编辑
1.编辑草稿协议跟踪
红色为客户端发送
蓝色为服务器返回
a.追加一封邮件
6 append "&g0l6P1k5-" (\Draft) {1144}
+ Ready for argument
FCC: imap://bolttest2%
40sina.com@imap.sina.com
/&XfJT0ZAB-
X-Identity-Key: id1
X-Account-Key: id1
From: =?UTF-8?B?SEVDSEVOR0pJTiBb5L2V5oiQ6L+bXQ==?= <
test2@sina.com
>
To:
xxx1@firemail.cn
Cc:
xxx2@kingsoft.com
Subject: 2
Message-ID: <
5707A8D5.6090506@sina.com
>
Date: Fri, 8 Apr 2016 20:49:25 +0800
X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0;
attachmentreminder=0
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="------------050306010304050604070800"
This is a multi-part message in MIME format.
--------------050306010304050604070800
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
2
- .........FIREMAIL...... -
--------------050306010304050604070800
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<html><body><span style="font-family:SimSun;"><span style="font-size:14px;"><span style="color:#000000;"><span style="background-color:#FFFFFF;">2<br></span></span></span></span><pre class="moz-signature">- .........FIREMAIL...... -</pre></body></html>
--------------050306010304050604070800--
* 2 EXISTS
* 1 RECENT
6 OK APPEND completed
b. 获取新追加的草稿的状态标志
9 UID fetch 125:* (FLAGS)
//125是根据上面的124计算出来的
* 2 FETCH (UID 125 FLAGS (\Draft))
//即UID为125的
标记为草稿状态的未读邮件(因为不包含\Seen标志)
9 OK UID FETCH completed
c.获取邮件头信息
10 UID fetch 125 (UID RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS (From To Cc Bcc Subject Date Message-ID Priority X-Priority References Newsgroups In-Reply-To Content-Type Reply-To)])
* 1 FETCH (UID 125 RFC822.SIZE 1339 FLAGS (\Draft) BODY[HEADER.FIELDS (FROM TO CC BCC SUBJECT DATE MESSAGE-ID PRIORITY X-PRIORITY REFERENCES NEWSGROUPS IN-REPLY-TO CONTENT-TYPE REPLY-TO)] {306}
From: =?UTF-8?B?SEVDSEVOR0pJTiBb5L2V5oiQ6L+bXQ==?= <
bolttest2@sina.com
>
To:
hechengjin@wps.cn
Cc:
hechengjin@kingsoft.com
Subject: 2
Message-ID: <
5707A8D5.6090506@sina.com
>
Date: Fri, 8 Apr 2016 20:49:25 +0800
Content-Type: multipart/alternative;
boundary="------------050306010304050604070800"
)
10 OK UID FETCH completed
d.标志此邮件为已读
13 uid store 125 +Flags (\Seen)
* 2 FETCH (UID 125 FLAGS (\Seen \Draft))
* 0 RECENT
13 OK UID STORE completed
上面没有发现从服务器拉取正文的过程,但客户端却已经显示了正文? 正文中如果有字段不对(多了抄送等),则只与本地处理保存时有关
而保存下一封草稿时,又会获取上一封的正文,这之后,上一封的正文就显示正确了和服务器上的一致了
如下获取一个邮件的正文
37 UID fetch 127 (UID RFC822.SIZE BODY.PEEK[])
* 2 FETCH (UID 127 RFC822.SIZE 1313 BODY[] {1118}
FCC: imap://bolttest2%
40sina.com@imap.sina.com
/&XfJT0ZAB-
X-Identity-Key: id1
X-Account-Key: id1
From: =?UTF-8?B?SEVDSEVOR0pJTiBb5L2V5oiQ6L+bXQ==?= <
test2@sina.com
>
To:
xxxx@wps.cn
Subject: 22
Message-ID: <
5707AF42.2000701@sina.com
>
Date: Fri, 8 Apr 2016 21:16:50 +0800
X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0;
attachmentreminder=0
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="------------040206020607050109080409"
This is a multi-part message in MIME format.
--------------040206020607050109080409
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
22
- .........Firemail...... -
--------------040206020607050109080409
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<html><body><span style="font-family:SimSun;"><span style="font-size:14px;"><span style="color:#000000;"><span style="background-color:#FFFFFF;">22<br></span></span></span></span><pre class="moz-signature">- .........Firemail...... -</pre></body></html>
--------------040206020607050109080409--
)
37 OK UID FETCH completed
作者:
hechengjin
时间:
2016-4-8 21:33
本帖最后由 hechengjin 于 2016-4-8 22:00 编辑
在同步服务器上草稿之前,本地存草稿的处理compose.html
id="saveDraftButton"
compose.js
function saveDraft (event) {
sendEmail(null, Ci.nsIMsgCompDeliverMode.SaveAsDraft)
if (gSendStatus) {
gEditorContentChanged = false
gComposeHeaderChanged = false
attachmentOperation.setAttachmentChanged(false)
}
}
复制代码
function sendEmail (event, deliverMode = Ci.nsIMsgCompDeliverMode.Now) { // SaveAsDraft
spawn(function * () {
genericSendEmail(composeWindow, deliverMode)
gSendStatus = true
})
}
复制代码
function genericSendEmail (composeWindow, deliverMode) {
let editIframe = document.querySelector('.ke-edit-iframe')
let sendListener = {
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIMsgSendListener,
Ci.nsISupports
]),
onStopSending: function (aMsgID, aStatus, aMsg, aReturnFile) {
if (aStatus === 0) {
if (composeWindow) {
composeWindow.close()
}
} else {
windowActions.show.call(top)
}
}
}
let stateListener = {
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIMsgComposeStateListener,
Ci.nsISupports
]),
SaveInFolderDone: function (aFolderName) {
// Resume savedraft button.
document.querySelector('#saveDraftButton').onclick = saveDraft
},
ComposeProcessDone: function (aResult) {
if (aResult !== 0) {
windowActions.show.call(top)
}
}
}
let params = top.params
let draftId = params.composeFields.draftId
if (gMsgCompose) {
draftId = gMsgCompose.compFields.draftId
// TODO, update gSendMsgHdrList
}
let sendParams = {
to: getToList(),
cc: getCcList(),
bcc: getBccList(),
subject: getSubject(),
identity: getSelectedIdentity(),
attachments: attachmentOperation.getAttachments(),
draftId: draftId,
hdrs: gSendMsgHdrList
}
if (deliverMode === Ci.nsIMsgCompDeliverMode.Now ||
deliverMode === Ci.nsIMsgCompDeliverMode.Later ||
deliverMode === Ci.nsIMsgCompDeliverMode.Background) {
windowActions.hide.call(top)
}
gMsgCompose = MailServices.send.sendMessage(sendParams,
{
deliverType: deliverMode,
compType: gComposeType
}, {
match: function (x) {
x.editor(editIframe)
}
}, {
progressListener: null,
sendListener: sendListener,
stateListener: stateListener
}, {
msgWindow: MailServices.msgWindow,
popOut: popOut,
archive: archive
}
)
}
复制代码
当服务器上的邮件头下载后,与本地的伪邮件头对比后,触发msgKeyChanged事件
作者:
hechengjin
时间:
2016-4-9 17:59
跟踪下面smtp过程,问题应该不在smtp,而在imap
XPCOMUtils.jsm
defineLazyGetter: function XPCU_defineLazyGetter(aObject, aName, aLambda) // aName:'send'
{
Object.defineProperty(aObject, aName, {
get: function () {
delete aObject[aName];
return aObject[aName] = aLambda.apply(aObject);
},
configurable: true,
enumerable: true
});
},
MailServices.js
XPCOMUtils.defineLazyGetter(MailServices, 'send', function () {
return Cu.import('resource://conversations/modules/stdlib/send.js', {})
})
src\app\conversations\modules\stdlib\send.js
function sendMessage(aParams,
{ deliverType, compType },
aBody,
{ progressListener, sendListener, stateListener },
options) {
let popOut = options && options.popOut; // false
let fields = Cc["@mozilla.org/messengercompose/composefields;1"]
.createInstance(Ci.nsIMsgCompFields);
if ("cc" in aParams)
fields.cc = aParams.cc;
lds.fcc = defaultFcc;
console.log('-------------compType',compType) //New 0 https://dxr.mozilla.org/comm-central/source/mailnews/compose/public/nsIMsgComposeParams.idl#16
let params = Cc["@mozilla.org/messengercompose/composeparams;1"]
.createInstance(Ci.nsIMsgComposeParams);
params.composeFields = fields;
params.identity = identity;
params.type = compType;
params.sendListener = sendListener;
let msgHdr = hdrs[0];
if(msgHdr && msgHdr.folder != null) {
params.origMsgHdr = msgHdr;
params.originalMsgURI = msgHdrGetUri(msgHdr);
}
fields.characterSet = "UTF-8";
fields.body = body;
gMsgCompose.SendMsg(deliverType, identity, identity.key, options && options.msgWindow, progress);
}
\mailnews\compose\src\nsMsgCompose.cpp
NS_IMETHODIMP nsMsgCompose::SendMsg(MSG_DeliverMode deliverMode, nsIMsgIdentity *identity, const char *accountKey, nsIMsgWindow *aMsgWindow, nsIMsgProgress *progress)
{
rv = _SendMsg(deliverMode, identity, accountKey);
}
nsresult nsMsgCompose::_SendMsg(MSG_DeliverMode deliverMode, nsIMsgIdentity *identity,
const char *accountKey)
{
rv = mMsgSend->CreateAndSendMessage(
m_composeHTML ? m_editor.get() : nullptr,
identity,
accountKey,
m_compFields,
false,
false,
(nsMsgDeliverMode)deliverMode,
nullptr,
m_composeHTML ? TEXT_HTML : TEXT_PLAIN,
bodyString,
nullptr,
nullptr,
m_window,
mProgress,
sendListener,
mSmtpPassword.get(),
mOriginalMsgURI,
mType);
}
\mailnews\compose\src\nsMsgSend.cpp
NS_IMETHODIMP
nsMsgComposeAndSend::CreateAndSendMessage(
nsIEditor *aEditor,
nsIMsgIdentity *aUserIdentity,
const char *aAccountKey,
nsIMsgCompFields *fields,
bool digest_p,
bool dont_deliver_p,
nsMsgDeliverMode mode,
nsIMsgDBHdr *msgToReplace,
const char *attachment1_type,
const nsACString &attachment1_body,
nsIArray *attachments,
nsIArray *preloaded_attachments,
nsIDOMWindow *parentWindow,
nsIMsgProgress *progress,
nsIMsgSendListener *aListener,
const char *password,
const nsACString &aOriginalMsgURI,
MSG_ComposeType aType
)
{
rv = Init(aUserIdentity, aAccountKey, (nsMsgCompFields *)fields, nullptr,
digest_p, dont_deliver_p, mode, msgToReplace,
attachment1_type, attachment1_body,
attachments, preloaded_attachments,
password, aOriginalMsgURI, aType);
}
nsresult
nsMsgComposeAndSend::Init(
nsIMsgIdentity *aUserIdentity,
const char *aAccountKey,
nsMsgCompFields *fields,
nsIFile *sendFile,
bool digest_p,
bool dont_deliver_p,
nsMsgDeliverMode mode,
nsIMsgDBHdr *msgToReplace,
const char *attachment1_type,
const nsACString &attachment1_body,
nsIArray *attachments,
nsIArray *preloaded_attachments,
const char *password,
const nsACString &aOriginalMsgURI,
MSG_ComposeType aType)
{
rv = InitCompositionFields(fields, aOriginalMsgURI, aType);
if (sendFile)
{
mTempFile = sendFile;
return NS_OK;
}
return HackAttachments(attachments, preloaded_attachments);
}
nsresult
nsMsgComposeAndSend::HackAttachments(nsIArray *attachments,
nsIArray *preloadedAttachments)
{
// If no attachments - finish now (this will call the done_callback).
if (needToCallGatherMimeAttachments) //发送前什么时候生成的临时文件? nsemail.eml mTempFile C:\Users\hechengjin\AppData\Local\Temp\nsemail.html
return GatherMimeAttachments();
}
nsMsgComposeAndSend::GatherMimeAttachments()
{
rv = nsMsgCreateTempFile("nsemail.html", getter_AddRefs(mHTMLFile));
rv = nsMsgCreateTempFile("nsemail.eml", getter_AddRefs(mTempFile));
//文件中内容 cc都没有问题
}
复制代码
作者:
hechengjin
时间:
2016-4-10 07:59
imap逻辑跟踪
跟踪imap消息头中为什么会有 上次的cc的联系人?
msgsClassified
msgAdded
msgKeyChanged
上面三个事件的关系,为什么上面三个事件都会带上上次写信时的cc?
正常情况下追加完邮件,fetch到标题头解析完后触发msgAdded
nsImapMailFolder::ParseMsgHdrs(nsIImapProtocol * aProtocol, nsIImapHeaderXferInfo * aHdrXferInfo)
nsImapMailFolder::NormalEndHeaderParseStream(nsIImapProtocol * aProtocol, nsIImapUrl * imapUrl)
{
notifier->NotifyMsgKeyChanged(pseudoKey, newMsgHdr);
notifier->NotifyMsgAdded(newMsgHdr);
}
在这之前 msgKeyChanged 事件已经发生,如上
而在msgKeyChanged之前 msgsClassified已经发生,如下:
nsImapMailFolder::SetUrlState(nsIImapProtocol * aProtocol, nsIMsgMailNewsUrl * aUrl, bool isRunning, bool aSuspend, nsresult statusCode)
nsMsgMailNewsUrl::SetUrlState(bool aRunningUrl, nsresult aExitCode)
nsImapMailFolder::OnStopRunningUrl(nsIURI * aUrl, nsresult aExitCode) {
nsIImapUrl::nsImapAppendDraftFromFile:
}
nsImapMailFolder::OnCopyCompleted(nsISupports * srcSupport, nsresult rv) {
(void) CopyFileToOfflineStore(srcFile, m_copyState->m_appendUID); //即追加到imap服务器后,就复制到本地存储了,用于显示了,不用再从imap上拉取下来
}
nsImapMailFolder::CopyFileToOfflineStore(nsIFile * srcFile, unsigned int msgKey){
//没有与服务器同步前生成伪头部
nsCOMPtr<nsIMsgDBHdr> fakeHdr;
rv = mDatabase->CreateNewHdr(msgKey, getter_AddRefs(fakeHdr));
fakeHdr->SetUint32Property("pseudoHdr", 1);
nsCString ccList;
fakeHdr->GetCcList(getter_Copies(ccList));
printf("***************====fakeHdr->ccList %s %d\n", ccList.get(), ccList.Length());
}
mailnews\db\msgdb\src\nsMsgDatabase.cpp
NS_IMETHODIMP nsMsgDatabase::CreateNewHdr(nsMsgKey key, nsIMsgDBHdr **pnewHdr)
{
nsresult err = NS_OK;
nsIMdbRow *hdrRow;
if (key != nsMsgKey_None)
{
allMsgHdrsTableOID.mOid_Scope = m_hdrRowScopeToken;
allMsgHdrsTableOID.mOid_Id = key; // presumes 0 is valid key value
err = m_mdbStore->GetRow(GetEnv(), &allMsgHdrsTableOID, &hdrRow);
if (!hdrRow)
err = m_mdbStore->NewRowWithOid(GetEnv(), &allMsgHdrsTableOID, &hdrRow);
}
else //const nsMsgKey nsMsgKey_None = 0xffffffff;
{
// Mork will assign an ID to the new row, generally the next available ID.
err = m_mdbStore->NewRow(GetEnv(), m_hdrRowScopeToken, &hdrRow);
if (hdrRow)
{
struct mdbOid oid;
hdrRow->GetOid(GetEnv(), &oid);
key = oid.mOid_Id; //本地产生一个假的key,后面再变会真的与服务器一致 //Message-ID: <5708CC42.4080109@sina.com> 根据newMessageId关联这个msghdr nsDataHashtable<nsCStringHashKey, nsMsgKey> m_pseudoHdrs; typedef unsigned long nsMsgKey;
}
}
if (NS_FAILED(err))
return err;
err = CreateMsgHdr(hdrRow, key, pnewHdr);
return err;
}
nsMsgDatabase::CreateMsgHdr(nsIMdbRow* hdrRow, nsMsgKey key, nsIMsgDBHdr* *result)
{
// 主要是这个key是上一个的key 如果是一个伪key则是本地数据库的key加1,如果原来是100,现在这个草稿是101, 当这个草稿与服务器同步完成后,这个key变成了1001,101又恢复使用?
nsresult rv = GetHdrFromUseCache(key, result);
if (NS_SUCCEEDED(rv) && *result)
{
//这里就会记录上次的cc内容了
hdrRow->Release();
return rv;
}
nsMsgHdr *msgHdr = new nsMsgHdr(this, hdrRow);
if(!msgHdr)
return NS_ERROR_OUT_OF_MEMORY;
msgHdr->SetMessageKey(key);
// don't need to addref here; GetHdrFromUseCache addrefs.
*result = msgHdr;
AddHdrToCache(msgHdr, key);
return NS_OK;
nsCOMPtr<nsIMsgDBHdr> newMsgHdr;// https://dxr.mozilla.org/comm-central/source/mailnews/base/public/nsIMsgHdr.idl#14 attribute nsMsgKey messageKey; attribute string ccList; NS_IMETHOD GetCcList(char * *aCcList) = 0;
}
nsresult nsMsgDatabase::GetHdrFromUseCache(nsMsgKey key, nsIMsgDBHdr* *result)
{
//简单的修改方法不要添加进缓存表中了(即 m_bCacheHeaders 改为 false) -----结论:感觉这并不是一个bug而只是方便你不用再重复输入。
if (m_headersInUse)
{
PLDHashEntryHdr *entry =
PL_DHashTableSearch(m_headersInUse, (const void *)(uintptr_t) key);
if (entry)
{
MsgHdrHashElement* element = static_cast<MsgHdrHashElement*>(entry);
*result = element->mHdr;
}
if (*result)
{
NS_ADDREF(*result);
rv = NS_OK;
}
}
return rv;
}
复制代码
作者:
hechengjin
时间:
2016-4-11 09:47
imap调用逻辑整理
1.imap执行追加邮件到服务器后 append "&g0l6P1k5-" (\Draft) {1144}
OnCopyCompleted -> CopyFileToOfflineStore
mDatabase->CreateNewHdr(msgKey, getter_AddRefs(fakeHdr));
//https://dxr.mozilla.org/comm-central/source/mailnews/base/public/nsIMsgHdr.idl#14
msgKey:nsMsgKey_None = 0xffffffff; -----attribute nsMsgKey messageKey;
Message-ID: <5707A8D5.6090506@sina.com> ------attribute string messageId;
/*
nsCString ccList;
fakeHdr->GetCcList(getter_Copies(ccList));
nsCString messageId;
fakeHdr->GetMessageId(getter_Copies(messageId));
printf("------CopyFileToOfflineStore NotifyMsgsClassified messageKey:%d nsMsgKey_None:%d messageId:%s fakeHdr->ccList:%s\n", msgKey, nsMsgKey_None, messageId.get(), ccList.get());
*/
messages->AppendElement(fakeHdr, false);
notifier->NotifyMsgsClassified(messages, false, false);
触发前端 msgsClassified -->addMessageByMsgHdr
let exists = this.getMessageItem(item.primaryKey)
console.log(`===addMessageByMsgHdr exists:${exists} primaryKey:${item.primaryKey} messageKey:${msgHdr.messageKey} folderID:${folderID} messageId:${msgHdr.messageId}`)
if (exists) {
return
}
然后把PseudoKey与messageId的对应关联记录到内存中
mailnews\imap\src\nsImapOfflineSync.cpp
//对离线处理完的任务进行清理
nsresult nsImapOfflineSync::ProcessNextOperation(){
imapFolder->AddMoveResultPseudoKey(curKey);
}
NS_IMETHODIMP nsImapMailFolder::AddMoveResultPseudoKey(nsMsgKey aMsgKey){
printf("------AddMoveResultPseudoKey messageId:%s aMsgKey:%d\n", messageId.get(), aMsgKey);
}
2.获取服务端对应的真正的key后触发msgKeyChanged (messageId作为关联字段)【这个事件中直接把原来的记录删除,再重新添加】,去然后再触发msgAdded事件
NormalEndHeaderParseStream {
m_pseudoHdrs.Get(newMessageId, &pseudoKey); //根据messageId找到对应的pseudoKey 什麽時候添加進來的呢? printf("------AddMoveResultPseudoKey messageId:%s aMsgKey:%d", messageId.get(), aMsgKey);
if (notifier && pseudoKey != nsMsgKey_None)
{
nsMsgKey newKey = nsMsgKey_None;
newMsgHdr->GetMessageKey(&newKey); // =m_curMsgUid
printf("------NormalEndHeaderParseStream NotifyMsgKeyChanged pseudoKey:%d newKey:%d newMessageId:%s\n", pseudoKey, newKey, newMessageId.get());
notifier->NotifyMsgKeyChanged(pseudoKey, newMsgHdr);
m_pseudoHdrs.Remove(newMessageId);
}
mDatabase->AddNewHdrToDB(newMsgHdr, true);
if (notifier) {
nsMsgKey newKey = nsMsgKey_None;
newMsgHdr->GetMessageKey(&newKey);
printf("------NormalEndHeaderParseStream NotifyMsgAdded Key:%d newMessageId:%s\n", newKey, newMessageId.get());
notifier->NotifyMsgAdded(newMsgHdr);
}
}
3对邮件进行完过滤后再调用一次msgsClassified
nsresult nsMsgDBFolder::NotifyHdrsNotBeingClassified(){
notifier->NotifyMsgsClassified(msgHdrsNotBeingClassified,
// no classification is being performed
false, false);
}
总结:问题原因是因为伪Key采用了上一封邮件的Key,所以造成关联错误
这里修改方法在上一封Key基础上增加一个数字,防止重复,
nsImapMailFolder::OnCopyCompleted(nsISupports *srcSupport, nsresult rv)
{
(void) CopyFileToOfflineStore(srcFile, m_copyState->m_appendUID + 10);
日志如下:
2016-04-10 19:29:21 Conversations.Send DEBUG [Exception... "Failure a
rg 0 [nsIMsgCompose.initEditor]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" loc
ation: "JS frame :: resource://conversations/modules/stdlib/send.js :: sendMessa
ge/<.editor :: line 456" data: no]
2016-04-10 19:29:21 Conversations.Send DEBUG This message might be co
nvertible: 4
--1----CopyFileToOfflineStore msgKey:1515870820
--2----CopyFileToOfflineStore msgKey:1515870820
------CopyFileToOfflineStore NotifyMsgsClassified messageKey:1515870820 nsMsgKe
y_None:-1 messageId:570A3912.4030306@sina.com fakeHdr->ccList:chenlong3@kingsoft
.com
console.log: ===msgsClassified ccList:chenlong3@kingsoft.com, messageKey:1515870
820 messageId:570A3912.4030306@sina.com
console.log: ===addMessageByMsgHdr exists:undefined primaryKey:87415216740 messa
geKey:1515870820 folderID:20 messageId:570A3912.4030306@sina.com
------AddMoveResultPseudoKey messageId:570A3912.4030306@sina.com aMsgKey:1515870
820
------NormalEndHeaderParseStream NotifyMsgKeyChanged pseudoKey:1515870820 newKey
:206 newMessageId:570A3912.4030306@sina.com
console.log: ===msgKeyChanged old messageKey:1515870820, new ccList:chenlong3@ki
ngsoft.com, messageKey:206, messageId:570A3912.4030306@sina.com
console.log: ===deleteMessageByMessageID primaryKey:87415216740
console.log: ===addMessageByMsgHdr exists:undefined primaryKey:85899346126 messa
geKey:206 folderID:20 messageId:570A3912.4030306@sina.com
------NormalEndHeaderParseStream NotifyMsgAdded Key:206 newMessageId:570A3912.40
30306@sina.com
console.log: ===msgAdded, ccList:chenlong3@kingsoft.com messageKey:206 messageId
:570A3912.4030306@sina.com
console.log: ===addMessageByMsgHdr exists:[object Object] primaryKey:85899346126
messageKey:206 folderID:20 messageId:570A3912.4030306@sina.com
---------NotifyHdrsNotBeingClassified
console.log: ===msgsClassified ccList:chenlong3@kingsoft.com, messageKey:206 me
ssageId:570A3912.4030306@sina.com
console.log: ===addMessageByMsgHdr exists:[object Object] primaryKey:85899346126
messageKey:206 folderID:20 messageId:570A3912.4030306@sina.com
console.log: less has finished. css generated in 160ms
console.log: Create finished
console.log: fontFace is:SimSun
console.log: fontSize is:14px
console.log: WinJS init finished
2016-04-10 19:29:57 Conversations.Send DEBUG [Exception... "Failure a
rg 0 [nsIMsgCompose.initEditor]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" loc
ation: "JS frame :: resource://conversations/modules/stdlib/send.js :: sendMessa
ge/<.editor :: line 456" data: no]
2016-04-10 19:29:57 Conversations.Send DEBUG This message might be co
nvertible: 4
--1----CopyFileToOfflineStore msgKey:216
--2----CopyFileToOfflineStore msgKey:216
------CopyFileToOfflineStore NotifyMsgsClassified messageKey:216 nsMsgKey_None:
-1 messageId:570A3936.2000001@sina.com fakeHdr->ccList:
console.log: ===msgsClassified ccList:, messageKey:216 messageId:570A3936.20000
01@sina.com
console.log: ===addMessageByMsgHdr exists:undefined primaryKey:85899346136 messa
geKey:216 folderID:20 messageId:570A3936.2000001@sina.com
------AddMoveResultPseudoKey messageId:570A3936.2000001@sina.com aMsgKey:216
------NormalEndHeaderParseStream NotifyMsgKeyChanged pseudoKey:216 newKey:207 ne
wMessageId:570A3936.2000001@sina.com
console.log: ===msgKeyChanged old messageKey:216, new ccList:, messageKey:207, m
essageId:570A3936.2000001@sina.com
console.log: ===deleteMessageByMessageID primaryKey:85899346136
console.log: ===addMessageByMsgHdr exists:undefined primaryKey:85899346127 messa
geKey:207 folderID:20 messageId:570A3936.2000001@sina.com
------NormalEndHeaderParseStream NotifyMsgAdded Key:207 newMessageId:570A3936.20
00001@sina.com
console.log: ===msgAdded, ccList: messageKey:207 messageId:570A3936.2000001@sina
.com
console.log: ===addMessageByMsgHdr exists:[object Object] primaryKey:85899346127
messageKey:207 folderID:20 messageId:570A3936.2000001@sina.com
---------NotifyHdrsNotBeingClassified
console.log: ===msgsClassified ccList:, messageKey:207 messageId:570A3936.20000
01@sina.com
console.log: ===addMessageByMsgHdr exists:[object Object] primaryKey:85899346127
messageKey:207 folderID:20 messageId:570A3936.2000001@sina.com
console.log: *****start search:filterFolderIDs,recipientDisplay,folderID,listVie
w,sortType,sortOrder,threaded; unread:undefined; starred:undefined; folderID:21;
filterFolderIDs:20,24,19,23,22,21,25,26,18,27,28
console.log: searchView.applyWhere finished false
console.log: The search keywors []
console.log: *****start search:filterFolderIDs,recipientDisplay,folderID,listVie
w,sortType,sortOrder,threaded; unread:undefined; starred:undefined; folderID:20;
filterFolderIDs:20,24,19,23,22,21,25,26,18,27,28
console.log: searchView.applyWhere finished false
console.log: The search keywors []
console.log: The time consumed to init 114
console.log: The time consumed to init 105
console.log: The time consumed to init 99
复制代码
作者:
hechengjin
时间:
2016-4-19 12:29
本帖最后由 hechengjin 于 2016-4-19 12:36 编辑
负面影响 :由于离线保存的Key进行了改变,在copy完成后,进行邮件过滤时,根据原来的key则找不到对应的邮件
nsImapMailFolder::SetAppendMsgUid(nsMsgKey aKey,
nsIImapUrl * aUrl){
else if (mailCopyState->m_listener) // CopyFileMessage();
// Draft/Template goes here
{
mailCopyState->m_appendUID = aKey;
mailCopyState->m_listener->SetMessageKey(aKey);
}
}
CopyListener::SetMessageKey(nsMsgKey aMessageKey)
{
if (mComposeAndSend)
mComposeAndSend->SetMessageKey(aMessageKey);
return NS_OK;
}
nsMsgComposeAndSend::FilterSentMessage(){
nsCOMPtr<nsIMsgDBHdr> msgHdr;
rv = folder->GetMessageHeader(
m_messageKey
, getter_AddRefs(msgHdr));
if (NS_FAILED(rv))
return rv;
}
欢迎光临 firemail (http://firemail.wang:8088/)
Powered by Discuz! X3