On Sun, Nov 9, 2008 at 3:11 AM, Jon Hancock <[EMAIL PROTECTED]> wrote:
> > I am looking for people to share their SMTP setup experiences. The > assumption here is that I don't run my own mail server that does the > real delivery, but rather its either gmail or something my hosting > company maintains. > > There are several ways to go at it each with their issues: > > 1 - use merb-mailer to connect directly to your external SMTP > server. > pros: simple. > cons: only as robust as your merb process, assumes merb's run_later is > solid. Also assumes I can use a TLS connect. Does the latest merb- > mailer support this (that is, gmail). > > 2 - use merb-mailer to dump the mail into the local sendmail spool > (postfix, preferably). From here, the sendmail deamon connects to my > external service. > pros: robust > cons: complex setup and we only want it used for local forwarding, we > don't need a full-on mail server. Its a sledgehammer approach. > > 3 - user merb-mailer to dump to a local spool and have some very > lightweight deamon do the delivery. pros: lightwieght and maybe > robust > cons: not sure which solution to try. The choice of a mailing solution to use depends a great deal on the volume of mail being generated, and on scheduling needs. If you are sending one-off emails, or an action will only generate a send of a few emails, just do it right from within the merb process. It's simple and is sufficient for small sends, and has the benefit of being immediate. The typical large volume solution is similar to your #2 option. Generate email files, and dump them to a directory. Then, _something_ (there are quite a few options), picks up those files and sprays them out to your mailer(s). Works great if you are sending a huge number of emails. It can also be effectively used to do scheduled sends. Build your email ahead of time, storing it in a temporary directory. Then, at the scheduled send time, just move everything into your sender queue. A solution that I have used very successfully to send small to moderate volumes of email on a scheduled or ad-hoc-with-modest-latency is to use a web process as a builder/sender for dynamic emails. I had a simple cron job that wakes up once a minute and checks it's queue for any scheduled jobs. If one is found, it entered a simple loop that can be parallelized or distributed for large volumes. That loop hits a URL in my app with a request that contains whatever params the app needs to properly generate the email. The app then sends the email, as well. Even with a very small pool of workers (I have sent newsletters with thousands to tens of thousands of recipients on a single process with this technique), email can be generated and sent quickly and reliably this way, andit lets one leverage the templating and dynamic content construction capabilities of the web framework to build email. I do not know if Merb lets you use it directly in this way, though. Kirk Haines --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/merb?hl=en -~----------~----~----~----~------~----~------~--~---
