@@ -1492,7 +1492,24 @@ sub send_message {
if ($dry_run) {
# We don't want to send the email.
- } elsif (file_name_is_absolute($smtp_server)) {
+ } elsif (file_name_is_absolute($smtp_server) || $smtp_server =~ /^!/) {
+ if ($smtp_server =~ s/^!//) {
+ my $smtp_command;
+ my @progs = map {"$_/$smtp_server"} split /:/, $ENV{PATH};
+ foreach (@progs) {
+ if (-x $_) {
+ $smtp_command = $_;
+ last;
+ }
+ }
+
+ if (!defined $smtp_command) {
+ die __("The command $smtp_server was not found on PATH.")
+ }
+
+ $smtp_server = $smtp_command;
+ }
+
my $pid = open my $sm, '|-';
defined $pid or die $!;
if (!$pid) {