Discussion Locked

Net::SMTP troubleshooting

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am using Net::SMTP in a CGI program for feedback. I have two machines running Redhat 7.0, everything is fine on one, on the other problems. The short script:

use Net::SMTP;
$smtp=Net::SMTP->new('smtp.csulb.edu',Debug=>1) || print "fail";
$smtp->quit;

Results in a "fail". (script works fine on other machine)
Net::SMTP _is_ installed (I successfully did make, make test, make install (as su) in libnet-... module)

8 replies

by cpfeiffe

This may seem like a simple stab at it, but the first thing I typically look at with SMTP services of any kind (after verifying the service is up locally) is DNS. Is your Linux box that is failing set up properly as a DNS client? (assuming there may be any config differences between the one that works and the one that doesn't). If that is it great, if not sorry - I don't know Net::SMTP.

by wziemer

The command: sendmail -vt
works perfectly. The server smtp.csulb.edu responds and sends the mail.

by feacosta

it seems that your missing the perl module NET::SMTP on your system with the problem.

Go to search.cpan.org and download the module and install.

by wziemer

Again, the SMTP module is installed.
When the command fails the $! variable contains the output from the Net::SMTP->new command (i.e. "operation in progress")

by ludovicy

Try to change smtp.csulb.edu with the IP adress, aka 134.139.1.56. If this works your DNS isn't configured correctly.

If this doesn't work try to telnet smtp.csulb.edu on smtp port to check manually if the machine is able to connect.

telnet 134.139.1.56 25
HELO localhost
MAIL FROM: my@email.com
RCPT TO: someemail@thatisvalid.com
DATA
test
.

If that works redo the test by connecting via
telnet smtp.csulb.edu 25

If this works to you have something weird with your Net::SMTP installation.
Try to reinstall it by manually downloading it from cpan.org

by wziemer

As noted above the command "sendmail -vt" works, smtp.csulb.edu responds and sends the mail. Also I have tried "telnet smtp.csulb.edu 25" and it works fine. Net::SMTP was installed with a fresh cpan copy, and all other commands in the Net module work fine.
I now belive the error is one of permissions or of a conflicting service.

This discussion is closed to new replies.