in reply to Re: Faster Then Sendmail
in thread Faster Then Sendmail

I agree with you completely on Net::SMTP, merlyn. However, gaggio posted a module that has some additional functionality that Net::SMTP doesn't directly support.

All this depends on where you're counting on the SMTP server being located, however. If you're using the local machines, which is the wisest, then this argument holds no water. You can always count on being able to connect to the local SMTP server (as a general rule. Always check return results to be sure!). Additionally, a user may be getting his mail via POP3 or IMAP, because s/he may not have a local SMTP server that you can connect to.

If you're trying to connect to a SMTP mailserver on a remote network, then unless you know the actual address of the SMTP server, you may not be able to connect to it. The remote network may have an MX record for their SMTP server, since the mail machine may be mail.mynetwork.com, but has a different IP address than user@mynetwork.com.

To this end, gaggios module uses DNS::Resolver to determine if an MX record exists for that network, and sends mail to the appropriate MX machine.

I think this idea is really good, although (and no offense, gaggio) I'd really like to see it wrapped around Net::SMTP, instead of code that has had less exposuse to real world server issues.

--Chris

e-mail jcwren

Replies are listed 'Best First'.
RE: (jcwren) RE: Re: Faster Then Sendmail
by mt2k (Hermit) on Aug 05, 2000 at 21:30 UTC
    K, jcwren and merlyn, does Net::SMTP send mail like sendmail or retrieve mail from POP accounts and manage an e-mail server??
    Just reading jcwren's post and looking at Net::SMTP's perldoc, it looks for like Net::SMTP is used to actually manage an e-mail server.

    And in this thing that sendmail immediately sends e-mail, could the real reason it takes so long for the e-mail to arrive in the recipient's inbox be because sendmail is being used so much at once?
    I realize that sendmail is opened with a pipe, meaning it can handle a great amount of traffic at one time, but is the process slowed down with many scripts accessing it at the same time?

    Because I also tried using the scripts right now, and the e-mails always arrive faster than I can get to the inbox, but yesterday it would take about 2 hours to arrive.

    I'm trying to tell myself that the more proccesses attempting to use sendmail, the slower it runs, but this can't be true can it?

      SMTP is the internet protocol used when sending mail from an end-user client (Netscape Mail, Eudora, etc) for delivery to the local mailserver. The "local" mailserver is then respobsible for forwarding the mail so it will reach the final recipient. SMTP is also used by a mail server (Sendmail, Qmail, MS Exchange) when delivering internet mail to another mail server. If you are on the unix command-line there are other ways of getting your message into the "local mailserver" to start delivery other than your program talking with the server directly via SMTP.

      No matter how you send internet mail to someone it will almost certainly take part of the journey over SMTP. Mail generally hops across several mail servers on its path to delivery. E-mail is not designed for immediate delivery. Best efforts will be made to get the message to the recipient in a timely fashion, but anytime a mail-server is under load (handling many messages) delivery times will increase.

      POP3 (among others like IMAP) is a protocol used by end-user agents (and some mail forwarding agents, like feetchmail) to retrieve mail from a mailbox.

      Not to add more confusion to the mix, but couldn't the slowdown also be on the rcpt's end? Up front, my familiarity with POP and SMTP is rudimentary at best, but I seem to believe that some sys are configured to only pick up mail and pass it on to userss mailboxes every now and again (esp. if one's outside connetion is only intermitent, or it's a narrow pipe that has more imp. biz to attend to.) I'm just saying that, after a point, no matter how fast you send it, there's still a possibility that the rcpt won't get it for a bit, and there's no doing anything about it. (in the likelihood that I'm on crack re: POP and SMTP, here, please someone set my straight.)

      The Autonomic Pilot; it's FunkyTown, babe.