Skip to content

Commit

Permalink
check more traditional sendmail locations
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbs committed Jul 12, 2009
1 parent 445c501 commit a76cb56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,8 @@
Revision history for Email-Sender Revision history for Email-Sender


0.091930 2009-07-12
add some more common sendmail locations to default search

0.091870 2009-07-06 0.091870 2009-07-06
exclude unwanted methods from Email::Sender::Transport exclude unwanted methods from Email::Sender::Transport
to suppress a new warning from Moose role composition to suppress a new warning from Moose role composition
Expand Down
12 changes: 11 additions & 1 deletion lib/Email/Sender/Transport/Sendmail.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ sub _find_sendmail {
my ($self, $program_name) = @_; my ($self, $program_name) = @_;
$program_name ||= 'sendmail'; $program_name ||= 'sendmail';


for my $dir (File::Spec->path) { my @path = File::Spec->path;

if ($program_name eq 'sendmail') {
# for 'real' sendmail we will look in common locations -- rjbs, 2009-07-12
push @path, (
File::Spec->catfile('', qw(usr sbin)),
File::Spec->catfile('', qw(usr lib)),
);
}

for my $dir (@path) {
my $sendmail = File::Spec->catfile($dir, $program_name); my $sendmail = File::Spec->catfile($dir, $program_name);
return $sendmail if ($^O eq 'MSWin32') ? -f $sendmail : -x $sendmail; return $sendmail if ($^O eq 'MSWin32') ? -f $sendmail : -x $sendmail;
} }
Expand Down

0 comments on commit a76cb56

Please sign in to comment.