Cagao has asked for the wisdom of the Perl Monks concerning the following question:

I've raised this with the maintainer of Email::Send, but perhaps I'll get a quicker response here, and/or some better ideas.

I've looked at using Email::Send::SMTP to reduce the load of forking sendmail, our servers send masses of mail daily and kill the load.

Big problem for me is that Email::Send returns success even if the rcpt-to is unknown on the remote host.

Exim logs on the remote host prove this.

Is this a known issue, or is there another way to determine this error? or another module someone would recommend?

Getting the message-id of the sent mail would be nice too.
  • Comment on Email::Send succeeds with "unknown user"

Replies are listed 'Best First'.
Re: Email::Send succeeds with "unknown user"
by ides (Deacon) on Jan 12, 2008 at 22:11 UTC

    This is the nature of E-mail. Your SMTP server will accept the message for delivery regardless if the recipient exists, because it hasn't even attempted to send it on yet, and this is the only "error" you can retrieve from Email::Send. You'll have to watch for the bounce messages via another method.

    Also, if you are using SMTP to the same sendmail ( the one you were forking ) and aren't reusing the connection for multiple messages then you haven't reduce load, you've just changed where you're forking.

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

      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?
        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.

        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