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 {
* (last Received: header added) and try to extract from them
* indications to which email address this message was delivered.
*
- * The Received: header is special in our get_header function and is
- * always concatenated.
+ * The Received: header is among special ones in our get_header function
+ * and is always concatenated.
*
* Return the address that was found, if any, and NULL otherwise.
*/
* headers: Envelope-To, X-Original-To, and Delivered-To (searched in
* that order).
*
+ * The Delivered-To: header is among special ones in our get_header
+ * function and is always concatenated.
+ *
* Return the address that was found, if any, and NULL otherwise.
*/
static const char *
OK"
test_begin_subtest "From guessing: multiple Delivered-To"
-test_subtest_known_broken
add_message '[from]="Sender <sender@example.com>"' \
'[to]="Recipient <recipient@example.com>"' \
'[subject]="From guessing"' \