--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id C5C23429E29\r
+ for <notmuch@notmuchmail.org>; Sat, 30 Mar 2013 07:21:39 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id KyZfgUsOe-42 for <notmuch@notmuchmail.org>;\r
+ Sat, 30 Mar 2013 07:21:38 -0700 (PDT)\r
+Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
+ [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 49A38431FD7\r
+ for <notmuch@notmuchmail.org>; Sat, 30 Mar 2013 07:21:36 -0700 (PDT)\r
+Received: by mail-lb0-f181.google.com with SMTP id r11so910753lbv.26\r
+ for <notmuch@notmuchmail.org>; Sat, 30 Mar 2013 07:21:34 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
+ :references:in-reply-to:references:x-gm-message-state;\r
+ bh=fkWdoztOuJvp5t9Z1M/kbGJRHF09TLv8Q4BpHLlbkrE=;\r
+ b=en47N4t3TEDcAIEUpXgdTo8kUD7ktXiQ3l64hX6TYlxG1gWUzjmRmykItZt4YSkM5l\r
+ V8M8WTcMzlVMegij6tq+pLOYOI5nZi6ZcCjYUEPJktz3HcXpT8P4b8W16qiPKWDlLpU/\r
+ reUXnDSzKLePW90iS0JVVcPnWXT9/OwZZ8+zEdkD6Fg2IupIJ2+QXPa1abSGjrJasMhD\r
+ 1M2lKqzF+UF7DjcV57bzOnt0s9F+45EdOd36XEHiZWH5j0jcy8mTTyRuOqfFHrUS6XPK\r
+ cwleKJMdF12d2Bgvlk3g4GLUWyfLoBP6B6CV70VYebvwE5ekHIE0PbK4rAClux77nUPI\r
+ HttQ==\r
+X-Received: by 10.112.59.104 with SMTP id y8mr3000445lbq.39.1364653294753;\r
+ Sat, 30 Mar 2013 07:21:34 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
+ [80.223.81.27])\r
+ by mx.google.com with ESMTPS id fz10sm2656631lbb.12.2013.03.30.07.21.32\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Sat, 30 Mar 2013 07:21:33 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 2/3] cli: add reply.honor_followup_to configuration option\r
+Date: Sat, 30 Mar 2013 16:21:21 +0200\r
+Message-Id:\r
+ <698d81ea04495c4315ff7da603f3e54eed1d24f1.1364652420.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1364652420.git.jani@nikula.org>\r
+References: <cover.1364652420.git.jani@nikula.org>\r
+In-Reply-To: <cover.1364652420.git.jani@nikula.org>\r
+References: <cover.1364652420.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQmCKzX6xFSXVdYlV14feLps3NxG1RYLRdu6KX4dRytWi3VXIM+him6+OnDryID3L5Wh7NWF\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 30 Mar 2013 14:21:40 -0000\r
+\r
+The reply.honor_followup_to configuration option determines whether\r
+notmuch reply takes into account the Mail-Followup-To: header in\r
+incoming messages.\r
+---\r
+ notmuch-client.h | 7 +++++++\r
+ notmuch-config.c | 43 +++++++++++++++++++++++++++++++++++++++++++\r
+ 2 files changed, 50 insertions(+)\r
+\r
+diff --git a/notmuch-client.h b/notmuch-client.h\r
+index 45749a6..0b7800c 100644\r
+--- a/notmuch-client.h\r
++++ b/notmuch-client.h\r
+@@ -301,6 +301,13 @@ notmuch_config_set_new_ignore (notmuch_config_t *config,\r
+ size_t length);\r
+ \r
+ notmuch_bool_t\r
++notmuch_config_get_reply_honor_followup_to (notmuch_config_t *config);\r
++\r
++void\r
++notmuch_config_set_reply_honor_followup_to (notmuch_config_t *config,\r
++ notmuch_bool_t honor_followup_to);\r
++\r
++notmuch_bool_t\r
+ notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config);\r
+ \r
+ void\r
+diff --git a/notmuch-config.c b/notmuch-config.c\r
+index 66a1cdf..053038e 100644\r
+--- a/notmuch-config.c\r
++++ b/notmuch-config.c\r
+@@ -53,6 +53,17 @@ static const char new_config_comment[] =\r
+ "\t names will be ignored, independent of its depth/location\n"\r
+ "\t in the mail store.\n";\r
+ \r
++static const char reply_config_comment[] =\r
++ " Configuration for \"notmuch reply\"\n"\r
++ "\n"\r
++ " The following option is supported here:\n"\r
++ "\n"\r
++ "\thonor_followup_to Valid values are true and false.\n"\r
++ "\n"\r
++ "\tIf true, \"notmuch reply\" will honor the \"Mail-Followup-To:\""\r
++ "\theader in incoming messages. (This will not generate the headers"\r
++ "\tto outgoing messages.)\n";\r
++\r
+ static const char user_config_comment[] =\r
+ " User configuration\n"\r
+ "\n"\r
+@@ -115,6 +126,7 @@ struct _notmuch_config {\r
+ size_t new_tags_length;\r
+ const char **new_ignore;\r
+ size_t new_ignore_length;\r
++ notmuch_bool_t reply_honor_followup_to;\r
+ notmuch_bool_t maildir_synchronize_flags;\r
+ const char **search_exclude_tags;\r
+ size_t search_exclude_tags_length;\r
+@@ -240,6 +252,7 @@ notmuch_config_open (void *ctx,\r
+ char *notmuch_config_env = NULL;\r
+ int file_had_database_group;\r
+ int file_had_new_group;\r
++ int file_had_reply_group;\r
+ int file_had_user_group;\r
+ int file_had_maildir_group;\r
+ int file_had_search_group;\r
+@@ -273,6 +286,7 @@ notmuch_config_open (void *ctx,\r
+ config->new_tags_length = 0;\r
+ config->new_ignore = NULL;\r
+ config->new_ignore_length = 0;\r
++ config->reply_honor_followup_to = FALSE;\r
+ config->maildir_synchronize_flags = TRUE;\r
+ config->search_exclude_tags = NULL;\r
+ config->search_exclude_tags_length = 0;\r
+@@ -316,6 +330,7 @@ notmuch_config_open (void *ctx,\r
+ file_had_database_group = g_key_file_has_group (config->key_file,\r
+ "database");\r
+ file_had_new_group = g_key_file_has_group (config->key_file, "new");\r
++ file_had_reply_group = g_key_file_has_group (config->key_file, "reply");\r
+ file_had_user_group = g_key_file_has_group (config->key_file, "user");\r
+ file_had_maildir_group = g_key_file_has_group (config->key_file, "maildir");\r
+ file_had_search_group = g_key_file_has_group (config->key_file, "search");\r
+@@ -383,6 +398,15 @@ notmuch_config_open (void *ctx,\r
+ }\r
+ \r
+ error = NULL;\r
++ config->reply_honor_followup_to =\r
++ g_key_file_get_boolean (config->key_file,\r
++ "reply", "honor_followup_to", &error);\r
++ if (error) {\r
++ notmuch_config_set_reply_honor_followup_to (config, FALSE);\r
++ g_error_free (error);\r
++ }\r
++\r
++ error = NULL;\r
+ config->maildir_synchronize_flags =\r
+ g_key_file_get_boolean (config->key_file,\r
+ "maildir", "synchronize_flags", &error);\r
+@@ -406,6 +430,10 @@ notmuch_config_open (void *ctx,\r
+ g_key_file_set_comment (config->key_file, "new", NULL,\r
+ new_config_comment, NULL);\r
+ \r
++ if (! file_had_reply_group)\r
++ g_key_file_set_comment (config->key_file, "reply", NULL,\r
++ reply_config_comment, NULL);\r
++\r
+ if (! file_had_user_group)\r
+ g_key_file_set_comment (config->key_file, "user", NULL,\r
+ user_config_comment, NULL);\r
+@@ -845,6 +873,21 @@ notmuch_config_command (notmuch_config_t *config, int argc, char *argv[])\r
+ }\r
+ \r
+ notmuch_bool_t\r
++notmuch_config_get_reply_honor_followup_to (notmuch_config_t *config)\r
++{\r
++ return config->reply_honor_followup_to;\r
++}\r
++\r
++void\r
++notmuch_config_set_reply_honor_followup_to (notmuch_config_t *config,\r
++ notmuch_bool_t honor_followup_to)\r
++{\r
++ g_key_file_set_boolean (config->key_file,\r
++ "reply", "honor_followup_to", honor_followup_to);\r
++ config->reply_honor_followup_to = honor_followup_to;\r
++}\r
++\r
++notmuch_bool_t\r
+ notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config)\r
+ {\r
+ return config->maildir_synchronize_flags;\r
+-- \r
+1.7.10.4\r
+\r