Changeset 292d78


Ignore:
Timestamp:
Feb 28, 2009, 2:17:45 AM (11 years ago)
Author:
rene <rene@…>
Branches:
lite_0.1, multiEdit, ng_0.6, ng_0.6_help, ng_0.8, ng_0.9
Children:
7c6cb9
Parents:
f53dc3
Message:

added option for not RFC-compliant SMTP servers which don't add received headers

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_smartIdentity.js

    rf53dc3 r292d78  
    252252
    253253        vI_notificationBar.dump("## vI_smartIdentity: Reply()\n");
    254        
    255         if (hdr && !gMsgCompose.compFields.newsgroups && !hdr.getStringProperty("vI_received")) { // mail was not received
    256                 vI_notificationBar.dump("## vI_smartIdentity: reply on non-received (sent?) mail. Using SmartDraft. \n");
    257                 vI_smartIdentity.ReplyOnSent(hdr);
    258                 return;
    259         }
    260                
     254
     255        if (hdr && !gMsgCompose.compFields.newsgroups) {
     256        //  RFC 2821 (http://www.ietf.org/rfc/rfc2821.txt) says:
     257        //  "4.4 Trace Information
     258        //  When an SMTP server receives a message for delivery or further
     259        //  processing, it MUST insert trace ("time stamp" or "Received")
     260        //  information at the beginning of the message content, as discussed in
     261        //  section 4.1.1.4."
     262        //  so it should be always possible to decide if Reply or Draft based on received headers
     263        //  hidden option smart_detectByReceivedHeader will act as a switch for not RFC-compliant servers
     264            // RFC-compliant
     265            if (vI.preferences.getBoolPref("smart_detectByReceivedHeader")) {
     266                if (!hdr.getStringProperty("vI_received")) { // mail was not received
     267                    vI_notificationBar.dump("## vI_smartIdentity: reply on non-received (sent?) mail. Using SmartDraft. \n");
     268                    vI_smartIdentity.ReplyOnSent(hdr);
     269                    return;
     270                }
     271            }
     272            // not RFC-compliant
     273            else {
     274                const MSG_FOLDER_FLAG_INBOX = 0x1000
     275                const MSG_FOLDER_FLAG_SENTMAIL = 0x0200;
     276
     277                if (hdr && (hdr.folder.flags & MSG_FOLDER_FLAG_SENTMAIL)) {
     278                    vI_notificationBar.dump("## vI_smartIdentity: reply from Sent folder.");
     279                    if (hdr.folder.flags & MSG_FOLDER_FLAG_INBOX)
     280                        vI_notificationBar.dump(" Folder is INBOX, assuming Reply-Case. \n");
     281                    else {
     282                        vI_notificationBar.dump(" Using SmartDraft. \n");
     283                        vI_smartIdentity.ReplyOnSent(hdr);
     284                        return;
     285                    }
     286                }
     287            }
     288        }
     289           
    261290        var storageIdentities = new identityCollection();
    262291        vI_storage.getVIdentityFromAllRecipients(storageIdentities);
  • defaults/preferences/preferences.js

    rf53dc3 r292d78  
    1919pref("extensions.virtualIdentity.smart_reply_ignoreFullName", false);
    2020pref("extensions.virtualIdentity.smart_reply_for_newsgroups", false);
     21pref("extensions.virtualIdentity.smart_detectByReceivedHeader", true);
    2122pref("extensions.virtualIdentity.autoTimestamp", false);
    2223pref("extensions.virtualIdentity.get_header_notification", true);
Note: See TracChangeset for help on using the changeset viewer.