]> git.notmuchmail.org Git - notmuch/blobdiff - lib/message-file.c
lib: consider all instances of Delivered-To header
[notmuch] / lib / message-file.c
index 647ccf3abedaaf52f95bcc44e9a3199de8d4b42d..68f646a4e56d878459d37a665ca0298621e0c1d9 100644 (file)
@@ -291,11 +291,16 @@ _notmuch_message_file_get_header (notmuch_message_file_t *message,
     if (value)
        return value;
 
-    if (strcasecmp (header, "received") == 0) {
+    if (strcasecmp (header, "received") == 0 ||
+       strcasecmp (header, "delivered-to") == 0) {
        /*
-        * The Received: header is special. We concatenate all
-        * instances of the header as we use this when analyzing the
-        * path the mail has taken from sender to recipient.
+        * The Received: header is special. We concatenate all instances of the
+        * header as we use this when analyzing the path the mail has taken
+        * from sender to recipient.
+        *
+        * Similarly, multiple instances of Delivered-To may be present. We
+        * concatenate them so the one with highest priority may be picked (eg.
+        * primary_email before other_email).
         */
        decoded = _notmuch_message_file_get_combined_header (message, header);
     } else {