cosmicperl has asked for the wisdom of the Perl Monks concerning the following question:
As you can see it simple tests for files in known places, assuming if they have qmail installed then they are using it over sendmail.if (-e "/usr/bin/sendmail") { $sendmail = "/usr/bin/sendmail"; }#if if (-e "/usr/sbin/sendmail") { $sendmail = "/usr/sbin/sendmail"; }#if if (-e "/usr/lib/sendmail") { $sendmail = "/usr/lib/sendmail"; }#if if (-e "/var/qmail/bin/qmail-inject") { $sendmail = "/var/qmail/bin/qmail-inject"; }#if
But sendmail doesn't seem to have a --help, and this would only test the binary is there, and not that it's actually working.my $return = `/usr/lib/sendmail --help`;
Is there a safe way to test and get 'EX_OK' without actually sending out mail?if ( system( '/usr/lib/sendmail -t ...' ) eq 'EX_OK' ) { ... }#if
unless ( system( '/usr/lib/sendmail -bv to:test@test.com' ) ) { ### OK }#unless
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Searching for Sendmail
by holli (Abbot) on Feb 16, 2009 at 11:12 UTC | |
by cosmicperl (Chaplain) on Feb 16, 2009 at 11:35 UTC | |
by tirwhan (Abbot) on Feb 16, 2009 at 12:08 UTC | |
by cosmicperl (Chaplain) on Feb 16, 2009 at 13:45 UTC | |
by cosmicperl (Chaplain) on Feb 16, 2009 at 13:49 UTC | |
Re: Searching for Sendmail
by Bloodnok (Vicar) on Feb 16, 2009 at 13:00 UTC | |
Re: Searching for working Sendmail
by McD (Chaplain) on Feb 16, 2009 at 14:33 UTC | |
by cosmicperl (Chaplain) on Feb 17, 2009 at 01:37 UTC | |
by McD (Chaplain) on Feb 17, 2009 at 04:16 UTC |