Permalink
Browse files

check more traditional sendmail locations

  • Loading branch information...
1 parent 445c501 commit a76cb5633c890f2ad9ef744d95fd82962794a8d9 @rjbs rjbs committed Jul 12, 2009
Showing with 14 additions and 1 deletion.
  1. +3 −0 Changes
  2. +11 −1 lib/Email/Sender/Transport/Sendmail.pm
View
@@ -1,5 +1,8 @@
Revision history for Email-Sender
+0.091930 2009-07-12
+ add some more common sendmail locations to default search
+
0.091870 2009-07-06
exclude unwanted methods from Email::Sender::Transport
to suppress a new warning from Moose role composition
@@ -42,7 +42,17 @@ sub _find_sendmail {
my ($self, $program_name) = @_;
$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);
return $sendmail if ($^O eq 'MSWin32') ? -f $sendmail : -x $sendmail;
}

0 comments on commit a76cb56

Please sign in to comment.