Monks,
I'm trying to write a mail filter using the excellent Mail::Audit module with sendmail 8.11.6, but when the script is run by the mailer (through a .forward file), Sys::Hostname throws errors:
----- The following addresses had permanent fatal errors ----- |/home/matt/devel/bin/mail_filter (reason: 1) (expanded from: <matt@infernus.net>) ----- Transcript of session follows ----- Use of uninitialized value at /usr/libdata/perl/5.00503/Sys/Hostname.p +m line 100. Use of uninitialized value at /usr/libdata/perl/5.00503/Sys/Hostname.p +m line 109. Can't exec "/com/host": No such file or directory at /usr/libdata/perl/5.00503/Sys/Hostname.pm line 115. Cannot get host name of local machine at /usr/local/lib/perl5/site_perl/5.005/Mail/Audit.pm line 17 BEGIN failed--compilation aborted at /home/matt/devel/bin/mail_filter +line 7. 554 5.3.0 unknown mailer error 1
However, when I run ~/devel/bin/mail_filter by hand, it has no problems whatsoever, and neither does Sys::Hostname:
matt@shub-niggurath:~ Thu Jun 20-14:10:28>perl -MSys::Hostname -e 'print hostname, "\n"' shub-niggurath.infernus.net matt@shub-niggurath:~ Thu Jun 20-14:18:00>
I thought that it might be an environment issue... but my mail_filter script is chmod 744: only I can execute it! Since it's obviously being executed by me, it should have the standard paths, and be able to find /bin/hostname... right?
I can't find any indication of this happening to other Mail::Audit users, nor any mention of similar Sys::Hostname bugs. The local documentation of sendmail's .forward files isn't especially helpful: it says what they do, but not how. Help?
--
The hell with paco, vote for Erudil!
:wq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |