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

Mark Walters markwalters1009 at gmail.com
Thu Oct 17 01:11:31 PDT 2013


On Wed, 16 Oct 2013, Jani Nikula <jani at nikula.org> wrote:
> 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.

I am happy with the change but I think a little more explanation of the
problem it fixes would be helpful. Is it that there could be a \n \t
before the "for"/"by" or something else?

> ---
>  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 ");

The comment should be updated to match the code (and depending on the
answer to the above maybe explain that too)

Best wishes

Mark
>  
>      /* 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
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list