Subject: Re: [PATCH v3 2/6] t9001: check email address is in Cc: field

From: Matthieu Moy <[email-masked]>
Date: Thu, 09 Jun 2016 07:55:55 +0200

Tom Russello <[email-masked]> writes:

> Check if the given utf-8 email address is in the Cc: field.

I wouldn't harm to explain what was the problem with existing code here.
If I understand correctly, that would be:

  Existing code just checked that the address appeared in a line starting
  with a space, but not to which field the address belonged.

But probably the real motivation for this was that you want to introduce
code that changes the layout and breaks this "address appears on a line
starting with space"?

> --- a/t/t9001-send-email.sh
> +++ b/t/t9001-send-email.sh
> @@ -888,8 +888,8 @@ test_expect_success $PREREQ 'utf8 Cc is rfc2047 encoded' '
>  	--to=[email-masked] \
>  	--smtp-server="$(pwd)/fake.sendmail" \
>  	outdir/*.patch &&
> -	grep "^	" msgtxt1 |
> -	grep "=?UTF-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <[email-masked]>"
> +	cc_adr=$(awk "/^Cc: /{flag=1}/^Subject: /{flag=0} flag {print}" msgtxt1) &&
> +	echo "$cc_adr" | grep "=?UTF-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <[email-masked]>"
>  '
>  
>  test_expect_success $PREREQ '--compose adds MIME for utf8 body' '

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/