in reply to Re: Email::Send succeeds with "unknown user"
in thread Email::Send succeeds with "unknown user"

I thought Email::Send::SMTP was trying to connect to the remote host to deliver it directly, not connecting to the SMTP server on the localhost? If that's the case, would anyone recommend a module to attempt delivery directly?
  • Comment on Re^2: Email::Send succeeds with "unknown user"

Replies are listed 'Best First'.
Re^3: Email::Send succeeds with "unknown user"
by bart (Canon) on Jan 12, 2008 at 22:50 UTC
    You can (in fact, it looks like you must) specify which SMTP server to connect to.

    From the docs (somewhat broken English, but the meaning is clear):

    The first invocation of send requires an SMTP server arguments.
      no doubt it uses localhost by default, or Email::Send makes that choice, i haven't set it explicitly.

      When I sid i wanted to reduce the load, our code currently opens a pipe to sendmail.

      Doesn't the SMTP method atleast communicate with the sendmail daemon? rather than starting a new process?
        This script checks for registered mailers that you have available:

        #!/usr/bin/perl use strict; use warnings; use Email::Send; my $sender = Email::Send->new( { mailer => 'SMTP' } ); $sender->mailer_args( [ Host => 'localhost' ] ); my @available = $sender->all_mailers; print "@available\n";

        As for the reason why it succeeds with "unknown user", three things come to mind. First, you'll need to open Postfix's main.cf configuration file, for example, /etc/postfix/main.cf. Look for "soft_bounce"---thats where mail that would ordinarily bounce remains queued. Set that to soft_bounce = no. Second, look for "ignore_mx_lookup_error"---that ignores DNS MX lookups that produce no response. Set that to ignore_mx_lookup_error = no. Third, there's another entry that might be there. Look for "smtp_defer_if_no_mx_address_found"---Set that to smtp_defer_if_no_mx_address_found = yes.

Re^3: Email::Send succeeds with "unknown user"
by ides (Deacon) on Jan 14, 2008 at 17:28 UTC

    Everyone relies on an MTA like Sendmail to deliver their E-mail. If you want to "deliver it directly" as you say, you will need to do a DNS look up for the MX server(s) for each domain and attempt to send to each MX ( in order ) until one of them accepts. If they don't accept you'll need to etiher just not care about that and move on to your next receipient, or queue it up for later delivery.... btw this is exactly what Sendmail is doing for you.

    Frank Wiles <frank@revsys.com>
    www.revsys.com