Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a Perl processing script located on a Solaris 7 Server. It processes info for a web page and has worked and sent email for a couple years. Just in the last week it no longer sends email. I also dont get any error messages in my action web page. Please advise what I can check or do to correct the problem?
use strict; my $sendmail = '/usr/lib/sendmail -t'; open (MAIL,"|$sendmail") || "Not working: $!"; print MAIL <<"EOF"; To: smith\@here.com From: jones\@here.com Subject: theSubject Information here etc EOF close MAIL || "Not working: $!";

Replies are listed 'Best First'.
Re: Sendmail no longer working
by ysth (Canon) on Jul 13, 2005 at 11:02 UTC
    You want || die "Not working: $!";. Putting the die in (both places) should get you something in your error log.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Sendmail no longer working
by gellyfish (Monsignor) on Jul 13, 2005 at 11:40 UTC

    If there has been no change in the code itself, then the likely culprit is the mail system configuration, you probably want to check the mail logs in first instance.

    /J\

Re: Sendmail no longer working
by jhourcle (Prior) on Jul 13, 2005 at 12:34 UTC

    Besides the items already mentioned, by handing off to sendmail, you actually don't send the message immediately -- you place the message in the mail queue, and the system processes it when it feels like. If the main mail daemon dies, then no mail will be sent out, and no error messages will be generated.

    I'd check the webserver and mail logs first (I can't remember if Solaris 7 defaulted to putting mail in a seperate log file, it might be in one of the other log files that syslog manages). I'd also check the mail queue (you can get a report from the 'mailq' command, the files should be in /var/spool/mail).

      Can you advise an alternative mail software to use and how I would use it in the below script?
      use strict; my $sendmail = '/usr/lib/sendmail -t'; open (MAIL,"|$sendmail") || "Not working: $!"; print MAIL <<"EOF"; To: smith\@here.com From: jones\@here.com Subject: theSubject Information here etc EOF close MAIL || "Not working: $!";