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

I had perfectly good code sending emails. Now I don't. A previous monk had this problem, which turned out to be the smtp server. The result of my $smtp->dataend() is ok, my Hello seems fine too. Is there any other debugging or checks I can perform to diagnose where the problem is?

Replies are listed 'Best First'.
Re: SMTP stopped
by robartes (Priest) on Jan 21, 2003 at 13:42 UTC
    Could you be more specific: what exactly doesn't work anymore? Are there any error messages, timeouts, ...?

    One quick way of testing whether your smtp server is still alive is to telnet to the server on port 25. It should respond with a more or less verbose greeting.

    CU
    Robartes-

      No error messages, no timeouts. Where as before I ran the script and within seconds an email appeared, now I run the script, it completes as before with no errors. But I receive no email. I can ping the smtp server, and I telnet'ed to it, as you suggested, all fine.
        We're wandering away from Perl here, but nevertheless: you can check the mailqueue on the smtp server (if you have access to it) with the mailq command. It gives you a list of stuff that's waiting to be sent, with an explanation as to why it was not sent, if applicable.

        If your mail does not show up, check the mailer logs (somewhere in /var/adm or /var/log, depending on your Unix version). If your mail does not show up there, it never got to the server.

        If your mail server is on a Windows machine, people more knowledgeable about that than me will provide you with the equivalent commands and log files to check this (I hope ;) ).

        CU
        Robartes-

Re: SMTP stopped
by traveler (Parson) on Jan 21, 2003 at 16:29 UTC
    A non-perl but valuable tool is the free ethereal protocol analyzer. It is multi-platform and has lots of features. Try watching the SMTP conversation -- that may lead you to the trouble. I find that using a protocol analyzer is often the quickest way to diagnose these things.

    HTH, --traveler