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>
[ -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