From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/2] cli: also use Delivered-To header to figure out the reply from address
Date: Fri, 11 May 2012 17:32:22 +0300 [thread overview]
Message-ID: <21a946917c5c8dd63295b7c87b7c2d1ebcb6e71e.1336746160.git.jani@nikula.org> (raw)
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>
---
notmuch-reply.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/notmuch-reply.c b/notmuch-reply.c
index 7184a5d..7efd5cd 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -334,7 +334,11 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message
const char *delim=". \t";
size_t i,j,other_len;
- const char *to_headers[] = {"Envelope-to", "X-Original-To"};
+ const char *to_headers[] = {
+ "Envelope-to",
+ "X-Original-To",
+ "Delivered-To",
+ };
primary = notmuch_config_get_user_primary_email (config);
other = notmuch_config_get_user_other_email (config, &other_len);
@@ -348,8 +352,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
*/
--
1.7.9.5
next reply other threads:[~2012-05-11 14:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 14:32 Jani Nikula [this message]
2012-05-11 14:32 ` [PATCH 2/2] test: add tests for notmuch reply From guessing Jani Nikula
2012-05-11 20:17 ` [PATCH 1/2] cli: also use Delivered-To header to figure out the reply from address Tomi Ollila
2012-05-12 14:11 ` Mark Walters
2012-05-14 2:15 ` Michael Hudson-Doyle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21a946917c5c8dd63295b7c87b7c2d1ebcb6e71e.1336746160.git.jani@nikula.org \
--to=jani@nikula.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).