]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
email-test-patchset: grab all To and Cc headers.
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 11 Feb 2014 17:50:38 +0000 (09:50 -0800)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 12 Feb 2014 11:32:42 +0000 (13:32 +0200)
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@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
email/aiaiai-email-test-patchset

index 1988a7164d216e6a6f5a335c110cda032a032b39..beb3e9649452b03b43ebd359e7e24298f80d039a 100755 (executable)
@@ -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