summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-10-05 12:57:48 +0200
committerAndreas Gruenbacher <agruen@linbit.com>2011-10-05 12:57:48 +0200
commitf3e7822028616014f933b99d05f42fc028f8d12c (patch)
tree4f868c97bb4e62d16938135afd02e1966e4d32fa
parentc6750845136ff21eb13bc99ec7a6e1689100a13a (diff)
downloadquilt-f3e7822028616014f933b99d05f42fc028f8d12c.tar.gz
quilt mail: Allow commas in Signed-off-by and Acked-by lines
The standard quilt_mail_patch_filter() in quilt mail tries to extract email addresses from Signed-off-by and Acked-by lines. It adds Cc headers with those addresses. Signed-off-by and Acked-by lines sometimes contain commas as part of the address. When put in recipient headers (To, Cc, Bcc), the commas are interpreted as separators, which breaks things. Try to recognize this case and add the appropriate quotes. For example, the email address in ``Signed-off-by: Gruenbacher, Andreas <agruen@linbit.com>'' is now extracted as ``"Gruenbacher, Andreas" <agruen@linbit.com>''. Note that quilt_mail_patch_filter() can be overridden in .quiltrc; you may need to update your .quiltrc.
-rw-r--r--quilt/mail.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/quilt/mail.in b/quilt/mail.in
index bbb4718..5752542 100644
--- a/quilt/mail.in
+++ b/quilt/mail.in
@@ -365,8 +365,14 @@ then
echo "Replace-Subject: $subject"
# Add recipients defined by some recognized keywords
+
+ # In Signed-off-by: and Acked-by: lines, try to recognize email
+ # addresses that contain commas and add quotes, e.g.,
+ # Last, First <email> => "Last, First" <email>
+
sed -n -e "/\<${LOGNAME:-$(whoami)}@/d" \
-e 's/^\(To\|Cc\):/Recipient-\1:/ip' \
+ -e 's/^\(\(Signed-off-by\|Acked-by\):[ '$'\t'']*\)\([^"]*\(,[^"]*\)\+[^" '$'\t'']\)\([ '$'\t'']*<.*>\)/\1"\3"\5/i' \
-e 's/^\(Signed-off-by\|Acked-by\):/Recipient-Cc:/ip' \
$tmpdir/header