[PATCH 4/4] email-test-patchset: grab all To and Cc headers.

Artem Bityutskiy dedekind1 at gmail.com
Mon Feb 10 01:18:59 PST 2014


From: Jacob Keller <jacob.e.keller at intel.com>

This change modifies email-test-patchset to grab every To and Cc header
instead of just the first. Because refernces to to and cc except email
lists (comma seperated), we use merge_addresses with an empty second
parameter. This works due to recent changes to the merge_addresses
function see in a previous patch in this series.

Artem: amend the patch a tiny bit.

Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
---
 email/aiaiai-email-test-patchset | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset
index 1988a71..beb3e96 100755
--- a/email/aiaiai-email-test-patchset
+++ b/email/aiaiai-email-test-patchset
@@ -269,8 +269,13 @@ id="$(fetch_header "X-Aiaiai-Cover-Letter-Message-Id" < "$mbox")"
 [ -n "$id" ] || fetch_header_or_die id "Message-Id" < "$mbox"
 
 fetch_header_or_die from "From" < "$mbox"
-to="$(fetch_header "To" < "$mbox")"
-cc="$(fetch_header "Cc" < "$mbox")"
+
+to="$(fetch_all_headers "To" < "$mbox")"
+cc="$(fetch_all_headers "Cc" < "$mbox")"
+# If there are multiple "To:" or "Cc:" headers in the first patch, we need to
+# merge them into a single comma-separated list of addresses.
+to="$(merge_addresses "$to")"
+cc="$(merge_addresses "$cc")"
 
 # Either "To:" or "Cc:" must exist
 if [ -z "$to" ] && [ -z "$cc" ]; then
-- 
1.8.5.2




More information about the aiaiai mailing list