|
|
@ -72,6 +72,7 @@ git send-email [options] <file | directory | rev-list options > |
|
|
|
|
|
|
|
|
|
|
|
Automating: |
|
|
|
Automating: |
|
|
|
--identity <str> * Use the sendemail.<id> options. |
|
|
|
--identity <str> * Use the sendemail.<id> options. |
|
|
|
|
|
|
|
--to-cmd <str> * Email To: via `<str> \$patch_path` |
|
|
|
--cc-cmd <str> * Email Cc: via `<str> \$patch_path` |
|
|
|
--cc-cmd <str> * Email Cc: via `<str> \$patch_path` |
|
|
|
--suppress-cc <str> * author, self, sob, cc, cccmd, body, bodycc, all. |
|
|
|
--suppress-cc <str> * author, self, sob, cc, cccmd, body, bodycc, all. |
|
|
|
--[no-]signed-off-by-cc * Send to Signed-off-by: addresses. Default on. |
|
|
|
--[no-]signed-off-by-cc * Send to Signed-off-by: addresses. Default on. |
|
|
@ -191,7 +192,8 @@ sub do_edit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Variables with corresponding config settings |
|
|
|
# Variables with corresponding config settings |
|
|
|
my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd); |
|
|
|
my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc); |
|
|
|
|
|
|
|
my ($to_cmd, $cc_cmd); |
|
|
|
my ($smtp_server, $smtp_server_port, @smtp_server_options); |
|
|
|
my ($smtp_server, $smtp_server_port, @smtp_server_options); |
|
|
|
my ($smtp_authuser, $smtp_encryption); |
|
|
|
my ($smtp_authuser, $smtp_encryption); |
|
|
|
my ($identity, $aliasfiletype, @alias_files, $smtp_domain); |
|
|
|
my ($identity, $aliasfiletype, @alias_files, $smtp_domain); |
|
|
@ -220,6 +222,7 @@ my %config_settings = ( |
|
|
|
"smtppass" => \$smtp_authpass, |
|
|
|
"smtppass" => \$smtp_authpass, |
|
|
|
"smtpdomain" => \$smtp_domain, |
|
|
|
"smtpdomain" => \$smtp_domain, |
|
|
|
"to" => \@to, |
|
|
|
"to" => \@to, |
|
|
|
|
|
|
|
"tocmd" => \$to_cmd, |
|
|
|
"cc" => \@initial_cc, |
|
|
|
"cc" => \@initial_cc, |
|
|
|
"cccmd" => \$cc_cmd, |
|
|
|
"cccmd" => \$cc_cmd, |
|
|
|
"aliasfiletype" => \$aliasfiletype, |
|
|
|
"aliasfiletype" => \$aliasfiletype, |
|
|
@ -278,6 +281,7 @@ my $rc = GetOptions("sender|from=s" => \$sender, |
|
|
|
"in-reply-to=s" => \$initial_reply_to, |
|
|
|
"in-reply-to=s" => \$initial_reply_to, |
|
|
|
"subject=s" => \$initial_subject, |
|
|
|
"subject=s" => \$initial_subject, |
|
|
|
"to=s" => \@to, |
|
|
|
"to=s" => \@to, |
|
|
|
|
|
|
|
"to-cmd=s" => \$to_cmd, |
|
|
|
"no-to" => \$no_to, |
|
|
|
"no-to" => \$no_to, |
|
|
|
"cc=s" => \@initial_cc, |
|
|
|
"cc=s" => \@initial_cc, |
|
|
|
"no-cc" => \$no_cc, |
|
|
|
"no-cc" => \$no_cc, |
|
|
@ -729,7 +733,7 @@ if (!defined $sender) { |
|
|
|
$prompting++; |
|
|
|
$prompting++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!@to) { |
|
|
|
if (!@to && !defined $to_cmd) { |
|
|
|
my $to = ask("Who should the emails be sent to? "); |
|
|
|
my $to = ask("Who should the emails be sent to? "); |
|
|
|
push @to, parse_address_line($to) if defined $to; # sanitized/validated later |
|
|
|
push @to, parse_address_line($to) if defined $to; # sanitized/validated later |
|
|
|
$prompting++; |
|
|
|
$prompting++; |
|
|
@ -1258,21 +1262,10 @@ foreach my $t (@files) { |
|
|
|
} |
|
|
|
} |
|
|
|
close F; |
|
|
|
close F; |
|
|
|
|
|
|
|
|
|
|
|
if (defined $cc_cmd && !$suppress_cc{'cccmd'}) { |
|
|
|
push @to, recipients_cmd("to-cmd", "to", $to_cmd, $t) |
|
|
|
open(F, "$cc_cmd \Q$t\E |") |
|
|
|
if defined $to_cmd; |
|
|
|
or die "(cc-cmd) Could not execute '$cc_cmd'"; |
|
|
|
push @cc, recipients_cmd("cc-cmd", "cc", $cc_cmd, $t) |
|
|
|
while(<F>) { |
|
|
|
if defined $cc_cmd && !$suppress_cc{'cccmd'}; |
|
|
|
my $c = $_; |
|
|
|
|
|
|
|
$c =~ s/^\s*//g; |
|
|
|
|
|
|
|
$c =~ s/\n$//g; |
|
|
|
|
|
|
|
next if ($c eq $sender and $suppress_from); |
|
|
|
|
|
|
|
push @cc, $c; |
|
|
|
|
|
|
|
printf("(cc-cmd) Adding cc: %s from: '%s'\n", |
|
|
|
|
|
|
|
$c, $cc_cmd) unless $quiet; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
close F |
|
|
|
|
|
|
|
or die "(cc-cmd) failed to close pipe to '$cc_cmd'"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($broken_encoding{$t} && !$has_content_type) { |
|
|
|
if ($broken_encoding{$t} && !$has_content_type) { |
|
|
|
$has_content_type = 1; |
|
|
|
$has_content_type = 1; |
|
|
@ -1330,6 +1323,30 @@ foreach my $t (@files) { |
|
|
|
$message_id = undef; |
|
|
|
$message_id = undef; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Execute a command (e.g. $to_cmd) to get a list of email addresses |
|
|
|
|
|
|
|
# and return a results array |
|
|
|
|
|
|
|
sub recipients_cmd { |
|
|
|
|
|
|
|
my ($prefix, $what, $cmd, $file) = @_; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $sanitized_sender = sanitize_address($sender); |
|
|
|
|
|
|
|
my @addresses = (); |
|
|
|
|
|
|
|
open(F, "$cmd \Q$file\E |") |
|
|
|
|
|
|
|
or die "($prefix) Could not execute '$cmd'"; |
|
|
|
|
|
|
|
while(<F>) { |
|
|
|
|
|
|
|
my $address = $_; |
|
|
|
|
|
|
|
$address =~ s/^\s*//g; |
|
|
|
|
|
|
|
$address =~ s/\s*$//g; |
|
|
|
|
|
|
|
$address = sanitize_address($address); |
|
|
|
|
|
|
|
next if ($address eq $sanitized_sender and $suppress_from); |
|
|
|
|
|
|
|
push @addresses, $address; |
|
|
|
|
|
|
|
printf("($prefix) Adding %s: %s from: '%s'\n", |
|
|
|
|
|
|
|
$what, $address, $cmd) unless $quiet; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
close F |
|
|
|
|
|
|
|
or die "($prefix) failed to close pipe to '$cmd'"; |
|
|
|
|
|
|
|
return @addresses; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
cleanup_compose_files(); |
|
|
|
cleanup_compose_files(); |
|
|
|
|
|
|
|
|
|
|
|
sub cleanup_compose_files() { |
|
|
|
sub cleanup_compose_files() { |
|
|
|