aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-reply.c
diff options
context:
space:
mode:
authorGravatar Jani Nikula <jani@nikula.org>2012-05-24 08:15:49 +0300
committerGravatar David Bremner <bremner@debian.org>2012-05-24 21:56:21 -0300
commit22a18fc921cfd22d1c996ecb5c205fd142627e61 (patch)
tree46f9317d29e15ff7d33b23d7ba1b710d6782dc41 /notmuch-reply.c
parent308107e5ff5cf56bcc5a4bae1ee00b54be378dde (diff)
cli: also use Delivered-To header to figure out the reply from address
Add another fallback header Delivered-To for guessing the user's from address for notmuch reply before using the Received headers. Apparently some MTAs use Delivered-To instead of X-Original-To (which already exists as a fallback). Reported-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Signed-off-by: Jani Nikula <jani@nikula.org>
Diffstat (limited to 'notmuch-reply.c')
-rw-r--r--notmuch-reply.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c
index 51cb6de8..0f92a2e8 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -384,7 +384,11 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message
const char *delim=". \t";
size_t i;
- const char *to_headers[] = {"Envelope-to", "X-Original-To"};
+ const char *to_headers[] = {
+ "Envelope-to",
+ "X-Original-To",
+ "Delivered-To",
+ };
/* sadly, there is no standard way to find out to which email
* address a mail was delivered - what is in the headers depends
@@ -395,8 +399,9 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message
* the To: or Cc: header. From here we try the following in order:
* 1) check for an Envelope-to: header
* 2) check for an X-Original-To: header
- * 3) check for a (for <email@add.res>) clause in Received: headers
- * 4) check for the domain part of known email addresses in the
+ * 3) check for a Delivered-To: header
+ * 4) check for a (for <email@add.res>) clause in Received: headers
+ * 5) check for the domain part of known email addresses in the
* 'by' part of Received headers
* If none of these work, we give up and return NULL
*/