From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH v2 3/3] cli: support Mail-Followup-To: in notmuch reply
Date: Sat, 30 Mar 2013 16:21:22 +0200 [thread overview]
Message-ID: <390947231bc5d4fc4cb3b3aff94cd32bf25180f3.1364652420.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1364652420.git.jani@nikula.org>
In-Reply-To: <cover.1364652420.git.jani@nikula.org>
Use Mail-Followup-To header to determine recipients according to
http://cr.yp.to/proto/replyto.html if configured and present in the
message being replied to.
---
notmuch-reply.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/notmuch-reply.c b/notmuch-reply.c
index e151f78..7391886 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -324,6 +324,7 @@ add_recipients_from_message (GMimeMessage *reply,
{ "bcc", NULL, GMIME_RECIPIENT_TYPE_BCC }
};
const char *from_addr = NULL;
+ const char *recipients;
unsigned int i;
unsigned int n = 0;
@@ -343,9 +344,29 @@ add_recipients_from_message (GMimeMessage *reply,
reply_to_map[0].fallback = NULL;
}
- for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
- const char *recipients;
+ /* Use Mail-Followup-To header to determine recipients according
+ * to http://cr.yp.to/proto/replyto.html if configured and present
+ * in the message being replied to.
+ */
+ if (reply_all && notmuch_config_get_reply_honor_followup_to (config)) {
+ recipients = notmuch_message_get_header (message, "mail-followup-to");
+ if (recipients && *recipients) {
+ n = scan_address_string (recipients, config, reply,
+ GMIME_RECIPIENT_TYPE_TO, &from_addr);
+ if (n) {
+ /* Same rationale as in the loop below. */
+ reply = NULL;
+
+ /* From address and some recipients are enough, bail out. */
+ if (from_addr)
+ return from_addr;
+
+ /* Else need to find from address in other headers. */
+ }
+ }
+ }
+ for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
recipients = notmuch_message_get_header (message,
reply_to_map[i].header);
if ((recipients == NULL || recipients[0] == '\0') && reply_to_map[i].fallback)
--
1.7.10.4
next prev parent reply other threads:[~2013-03-30 14:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-30 14:21 [PATCH v2 0/3] cli: mail-followup-to support Jani Nikula
2013-03-30 14:21 ` [PATCH v2 1/3] cli: config: remove unnecessary braces from if blocks Jani Nikula
2013-03-30 22:36 ` David Bremner
2013-03-30 14:21 ` [PATCH v2 2/3] cli: add reply.honor_followup_to configuration option Jani Nikula
2013-03-30 14:21 ` Jani Nikula [this message]
2013-05-11 20:05 ` [PATCH v2 0/3] cli: mail-followup-to support Mark Walters
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=390947231bc5d4fc4cb3b3aff94cd32bf25180f3.1364652420.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).