f



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

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 andres@monroy.com
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
0
andres
6/27/2003 11:52:32 PM
comp.lang.perl.misc 33233 articles. 2 followers. brian (1246) is leader. Post Follow

1 Replies
742 Views

Similar Articles

[PageSpeed] 2

>> On 27 Jun 2003 16:52:32 -0700,
>> andres@monroy.com (Andres Monroy-Hernandez) said:

> 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 andres@monroy.com
> 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
0
Tony
6/27/2003 11:58:32 PM
Reply: