Mail::Sendmail cannot connect to localhost but the mail command can

  • Thread starter Andres Monroy-Hernandez
  • Start date
A

Andres Monroy-Hernandez

Hello,
I have a script that uses Mail::Sendmail, this script works just fine
in 4 different boxes (RedHat and Solaris).

Nevertheless, there is this Solaris machine where it doesn't work, and
this is the error I get in the $Mail::Sendmail::error variable:

connect to localhost failed (Connection refused)

The thing that puzzles me, is that in the same machine, the mail
command works just fine.

<snipet>
39 sfx@et2:ver_2> mail (e-mail address removed)
testing
..
</snipet>

As far as I know, mail tries to send emails via the localhost SMTP
just as Mail::Sendmail does.

I also tried changing the host name in Mail::Sendmail from localhost
to the server's IP and host name, but it didn't work either.

Any comments are appreciated.

-Andrés
 
T

Tony Curtis

On 27 Jun 2003 16:52:32 -0700,
Hello, I have a script that uses Mail::Sendmail, this
script works just fine in 4 different boxes (RedHat and
Solaris).
Nevertheless, there is this Solaris machine where it
doesn't work, and this is the error I get in the
$Mail::Sendmail::error variable:
connect to localhost failed (Connection refused)
The thing that puzzles me, is that in the same machine,
the mail command works just fine.
<snipet> 39 sfx@et2:ver_2> mail (e-mail address removed)
testing . </snipet>

This just requires a locally installed sendmail (or some
other MTA like postfix) into which mail/mailx can inject
the message. It doesn't require an SMTP service.

I'd wager there's an SMTP server running on all the other
machines (probably sendmail -bd) but not on this one, or
the other boxes are configured as clients to a local mail
hub, and this one isn't.

(If so, we've wandered out of perl territory. You
probably want to take a step back and re-think your local
mail setup first.)

hth
t
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top