firemail

标题: 发信逻辑 [打印本页]

作者: hechengjin    时间: 2016-4-19 12:22
标题: 发信逻辑
发送逻辑
src\app\conversations\modules\stdlib\send.js
function sendMessage(aParams,...
gMsgCompose.SendMsg(deliverType, identity, identity.key, options && options.msgWindow, progress);
\mailnews\compose\src\nsMsgCompose.cpp
nsMsgCompose::SendMsg
nsMsgCompose::_SendMsg
\mailnews\compose\src\nsMsgSend.cpp
nsMsgComposeAndSend::CreateAndSendMessage(
nsMsgComposeAndSend::Init(
nsMsgComposeAndSend::HackAttachments(nsIArray *attachments,
nsMsgComposeAndSend::GatherMimeAttachments()  ///注意nsMsgAttachmentHandler这个会造成这个函数多次调用

发送后,保存到已发送方案
1. smtp copy  ??
DoFcc()  // mCompFields->GetFcc(); 如果保存到已经发送,这里执行邮件的拷贝操作,imap再对拷贝后的邮件进行同步

MimeDoFCC

还有另外一种逻辑?
FetcherURLDoneCallback(nsresult aStatus,
                       const nsACString &aContentType,
                       const nsACString &aCharset,
                       int32_t totalSize,
                       const char16_t* aMsg, void *tagData)
{
return ma->UrlExit(aStatus, aMsg);
}
nsMsgAttachmentHandler::UrlExit(nsresult status, const char16_t* aMsg)
{
  status = m_mime_delivery_state->GatherMimeAttachments ();
}
nsMsgComposeAndSend::GatherMimeAttachments()
{
status = DeliverMessage();
}

nsMsgSend.cpp

nsMsgComposeAndSend:eliverMessage() {
  return DeliverFileAsMail();
}

nsMsgComposeAndSend:eliverFileAsMail()
{
MsgDeliveryListener *deliveryListener = new MsgDeliveryListener(this, false); //mMsgSend->SendDeliveryCallback(url, mIsNewsDelivery, aExitCode);
nsCOMPtr<nsIInterfaceRequestor> callbacks;
    GetNotificationCallbacks(getter_AddRefs(callbacks));
rv = smtpService->SendMailMessageWithExtraInfo(mTempFile, buf, mUserIdentity,
                                      mSmtpPassword.get(), deliveryListener, msgStatus,
                                      callbacks, mCompFields->GetDSN(),
                                      to, subject,
                                      getter_AddRefs(runningUrl),
                                      getter_AddRefs(mRunningRequest));
}

2.imap append

mail.identity.default.fcc;true

mail.identity.id1.fcc_folder;imap://ccc@firemail.com/Sent    %identitykey%

mail.identity.id1.fcc_folder_picker_mode;0     0已发送邮件夹  1其它自定义邮件夹







欢迎光临 firemail (http://firemail.wang:8088/) Powered by Discuz! X3