Changeset 65eabe


Ignore:
Timestamp:
Jul 5, 2008, 11:45:14 AM (13 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
7991d3
Parents:
f606f9
Message:

detect mailing-lists and prevent using 'to' header as sender

Location:
chrome/content/v_identity
Files:
2 edited

Legend:

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

    rf606f9 r65eabe  
    9898        for (header in currentHeaderData) {
    9999            headerName = currentHeaderData[header].headerName.toLowerCase()
     100
     101            // remember list-id header to prevent using Mailing-List addresses as sender
     102            if (headerName == "list-id") {
     103                hdr.setStringProperty("vI_list-id","found");
     104                vI_notificationBar.dump("## vI_getHeader: found header: list-id  ...stored to recognize mailing-list\n");
     105                continue;
     106            }
     107
    100108            if (currentHeadersCounter[headerName]) currentHeadersCounter[headerName]++
    101109            else currentHeadersCounter[headerName] = 1
     
    206214        vI_prepareHeader.unicodeConverter.charset = "UTF-8";
    207215        var header_list = vI_prepareHeader.unicodeConverter.ConvertToUnicode(vI_prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_headers")).split(/\n/)
     216       
     217        // add List-Id to recognizable headers to prevent using Mailing-List addresses as sender
     218        header_list.push("List-Id")
     219
    208220        try {
    209221            var extraHdrs = " " +
  • chrome/content/v_identity/vI_smartIdentity.js

    rf606f9 r65eabe  
    196196            var replyHeaderNameToRead = replyHeaderName
    197197            if (!isNaN(replyHeaderNumber)) replyHeaderNameToRead += ":" + replyHeaderNumber
    198 
     198           
     199            // if mailing-list ignore to-header (usually the mailing list address)
     200            if (replyHeaderNameToRead == "to" && hdr.getStringProperty("vI_list-id")) {
     201                vI_notificationBar.dump("## vI_smartIdentity: header 'list-id' found (mailinglist), skipping header 'to'\n");
     202                continue;
     203            }
     204           
    199205            // ------------- read the stored header -------------------------------
    200206            var value = vI.unicodeConverter.ConvertToUnicode(hdr.getStringProperty("vI_" + replyHeaderNameToRead))
Note: See TracChangeset for help on using the changeset viewer.