send-email: handle multiple Cc addresses when reading mbox message
When git format-patch is given multiple --cc arguments, it generates a
Cc header that looks like:
Cc: first@example.com,
second@example.com,
third@example.com
Before this commit, send-email was unable to handle such a message as it
did not handle folded header lines, nor multiple recipients in a Cc
line.
This patch:
- Unfolds header lines by pre-processing the header before extracting
any of its fields.
- Handles Cc lines with multiple recipients.
- Adds use of Mail::Address if available for splitting Cc line and
the "Who should the emails be sent to?" prompt", with fall back to
existing split_addrs() function.
- Tests the new functionality and adds two tests for detecting whether
"From:" appears correctly in message body when patch author differs
from patch sender.
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>