diff options
author | Allen Hubbe <allenbh@gmail.com> | 2015-05-26 17:32:03 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-27 13:01:48 -0700 |
commit | 3169e06daf297227362fb64a9d5c2cc451fefcbb (patch) | |
tree | 8b4b3893cec5fa76edcb16526c4df4986540adfb /t/t9001-send-email.sh | |
parent | 9532ead9875b7b92ff2007f9de61af5874e8839a (diff) | |
download | git-3169e06daf297227362fb64a9d5c2cc451fefcbb.tar.gz git-3169e06daf297227362fb64a9d5c2cc451fefcbb.tar.xz |
send-email: add sendmail email aliases format
Teach send-email to read aliases in the sendmail aliases format, i.e.
<alias>: <address|alias>[, <address|alias>...]
Examples:
alice: Alice W Land <awol@example.com>
bob: Robert Bobbyton <bob@example.com>
# this is a comment
# this is also a comment
chloe: chloe@example.com
abgroup: alice, bob
bcgrp: bob, chloe, Other <o@example.com>
- Quoted aliases and quoted addresses are not supported.
- Line continuations are not supported.
Warnings are printed for explicitly unsupported constructs, and any
other lines that are not matched by the parser.
Signed-off-by: Allen Hubbe <allenbh@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-x | t/t9001-send-email.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 7be14a4e3..01c7ef4d9 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -1549,6 +1549,33 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' ' grep "^!someone@example\.org!$" commandline1 ' +test_expect_success $PREREQ 'sendemail.aliasfiletype=sendmail' ' + clean_fake_sendmail && rm -fr outdir && + git format-patch -1 -o outdir && + cat >>.tmp-email-aliases <<-\EOF && + alice: Alice W Land <awol@example.com> + bob: Robert Bobbyton <bob@example.com> + # this is a comment + # this is also a comment + chloe: chloe@example.com + abgroup: alice, bob + bcgrp: bob, chloe, Other <o@example.com> + EOF + git config --replace-all sendemail.aliasesfile \ + "$(pwd)/.tmp-email-aliases" && + git config sendemail.aliasfiletype sendmail && + git send-email \ + --from="Example <nobody@example.com>" \ + --to=alice --to=bcgrp \ + --smtp-server="$(pwd)/fake.sendmail" \ + outdir/0001-*.patch \ + 2>errors >out && + grep "^!awol@example\.com!$" commandline1 && + grep "^!bob@example\.com!$" commandline1 && + grep "^!chloe@example\.com!$" commandline1 && + grep "^!o@example\.com!$" commandline1 +' + do_xmailer_test () { expected=$1 params=$2 && git format-patch -1 && |