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

Discussion in 'Perl Misc' started by Andres Monroy-Hernandez, Jun 28, 2003.

  1. 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
    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
     
    Andres Monroy-Hernandez, Jun 28, 2003
    #1
    1. Advertising

  2. Andres Monroy-Hernandez

    Tony Curtis Guest

    Re: Mail::Sendmail cannot connect to localhost but the mail commandcan

    >> On 27 Jun 2003 16:52:32 -0700,
    >> (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
    > 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
     
    Tony Curtis, Jun 28, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sugapablo
    Replies:
    0
    Views:
    2,163
    sugapablo
    Sep 21, 2007
  2. Andrzej Adam Filip
    Replies:
    0
    Views:
    4,100
    Andrzej Adam Filip
    Mar 31, 2008
  3. qvx
    Replies:
    2
    Views:
    340
  4. Jhary-a-Conel
    Replies:
    2
    Views:
    239
    Per Hedeland
    Jul 4, 2003
  5. ++imanshu
    Replies:
    10
    Views:
    402
    Peter J. Holzer
    Nov 11, 2009
Loading...

Share This Page