Professional Web Applications Themes

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

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 sfxet2:ver_2> mail [email]andresmonroy.com[/email] 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 ...

  1. #1

    Default 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 sfxet2:ver_2> mail [email]andresmonroy.com[/email]
    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 Guest

  2. #2

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

    >> On 27 Jun 2003 16:52:32 -0700,
    >> [email]andresmonroy.com[/email] (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 sfxet2:ver_2> mail [email]andresmonroy.com[/email]
    > 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 Guest

Similar Threads

  1. Mail using Localhost
    By dannyra in forum Coldfusion Server Administration
    Replies: 1
    Last Post: September 13th, 09:39 PM
  2. Localhost mail testing
    By Brendon in forum Coldfusion - Getting Started
    Replies: 10
    Last Post: September 25th, 04:32 PM
  3. mail() through localhost on WinXP
    By Laiverd.COM in forum PHP Development
    Replies: 2
    Last Post: November 7th, 05:17 PM
  4. Using /usr/bin/mail instead of sendmail?
    By ratlhead in forum PHP Development
    Replies: 1
    Last Post: July 4th, 06:55 AM
  5. perl script generates sendmail NOQUEUE: connect from rootlocalhost
    By Jhary-a-Conel in forum PERL Miscellaneous
    Replies: 2
    Last Post: July 3rd, 11:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139