[PATCH 3/6] cli: make the hacky from guessing more liberal

Jani Nikula jani at nikula.org
Wed Oct 16 12:00:10 PDT 2013


This is in preparation of switching to gmime header parsing. Accept
"for" and "by" preceded by tabs in the received header. This is a bit
flaky, but so is the whole guessing code.
---
 notmuch-reply.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 9d6f843..4b67e66 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -423,7 +423,7 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message
     /* First we look for a " for <email at add.res>" in the received
      * header
      */
-    ptr = strstr (received, " for ");
+    ptr = strstr (received, "for ");
 
     /* Note: ptr potentially contains a list of email addresses. */
     addr = user_address_in_string (ptr, config);
@@ -440,7 +440,7 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message
      * system in this step of the receive chain
      */
     by = received;
-    while((by = strstr (by, " by ")) != NULL) {
+    while((by = strstr (by, "by ")) != NULL) {
 	by += 4;
 	if (*by == '\0')
 	    break;
-- 
1.8.4.rc3



More information about the notmuch mailing list