Ramon Tayag
2009-Jan-27 09:14 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
Hey everyone, PROBLEM I need some backgroundrb help. I have a Rails app that connects to an SMTP server that can only send up to 250 emails per hour. If I try to send the 251st email, it will just ignore it. SENDMAIL? I almost bashed my head trying to setup sendmail so I can send my own emails, but not all emails were being sent. FANCY BDRB STUFF Looking at http://backgroundrb.rubyforge.org/scheduling/ , I can see that there are many things I can do with backgroundrb, but I can''t seem to figure out how to do what''s written on the subject. I basically want to send up to 250 emails immediately, and queue the 251st email til after the next hour since the max limit of 250 will be reset. Is this possible with backgroundrb? Thanks, Ramon Tayag
Hey everyone, PROBLEM I need some help. I have a Rails app on a VPS that connects to an external SMTP server that can only send up to 250 emails per hour. If I try to send the 251st email, it will just ignore it. SENDMAIL? I almost bashed my head trying to setup sendmail so I can send my own emails, but not all emails were being sent. FANCY MOVES I basically want to send up to 250 emails immediately, and queue the 251st email til after the next hour since the max limit of 250 will be reset. What can I use/install that does this for me? If I can avoid installing postfix and sendmail or some other MTA program, it''ll be way simpler for me. Thanks, Ramon Tayag --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chad Thatcher
2009-Jan-27 12:12 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
Hi Ramon, I''m also new to BGRB but I had a similar problem only very recently and I think a variation of my solution might help you. Here is my idea for you (thanks mostly to a even guidance of Hemant himself): class MailWorker < BackgrounDRb::MetaWorker set_worker_name :mail_worker def create(args = nil) # this method is called, when worker is loaded for the first time end def create(args = nil) @mail_queue = [] # double check that add_periodic_timer() accepts seconds - if so, 3600 is one hour. add_periodic_timer(3600) { push_mail() } end def add_mail(args = nil) # PS. this method submitted by Hemant, I haven''t looked into the Struct stuff. klass = Struct.new(:cmd_args) # add mail to the queue @mail_queue << klass.new(args) end def push_mail sleep 10 # I think this is important to make sure that we have definitely gone over an hour since the last push! # loop through the first 250 !NOTE: must specify a concrete range as it is possible that new mails are being queued while this methods runs. task = @mail_queue.shift # send mail here # end loop end def check_count return @mail_queue.count end end You can even add a "is_busy" flag of some sort to make absolutely sure this doesn''t get run twice at the same time. One scenario (if its at all possible) is that there is a huge delay in the sending of mail, meaning the process will lap over the hour. All sorts of bad things could go wrong I suspect. Anyway, thanks primarily to Hemants'' help I hope this helps you too. Cheers, Chad. On 27 Jan 2009, at 09:14, Ramon Tayag wrote:> Hey everyone, > > PROBLEM > I need some backgroundrb help. I have a Rails app that connects to an > SMTP server that can only send up to 250 emails per hour. If I try to > send the 251st email, it will just ignore it. > > SENDMAIL? > I almost bashed my head trying to setup sendmail so I can send my own > emails, but not all emails were being sent. > > FANCY BDRB STUFF > Looking at http://backgroundrb.rubyforge.org/scheduling/ , I can see > that there are many things I can do with backgroundrb, but I can''t > seem to figure out how to do what''s written on the subject. > > I basically want to send up to 250 emails immediately, and queue the > 251st email til after the next hour since the max limit of 250 will be > reset. Is this possible with backgroundrb? > > Thanks, > Ramon Tayag > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
You should look into AR Mailer: http://seattlerb.rubyforge.org/ar_mailer/ The basic idea is that rather than actually sending emails, your app saves emails to the database. AR Mailer then has an external script which can be used to send these emails in batches. Best of luck, Greg On Jan 27, 5:19 am, Ramon Tayag <ramon.ta...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey everyone, > > PROBLEM > I need some help. I have a Rails app on a VPS that connects to an > external SMTP server that can only send up to 250 emails per hour. If > I try to send the 251st email, it will just ignore it. > > SENDMAIL? > I almost bashed my head trying to setup sendmail so I can send my own > emails, but not all emails were being sent. > > FANCY MOVES > I basically want to send up to 250 emails immediately, and queue the > 251st email til after the next hour since the max limit of 250 will be > reset. What can I use/install that does this for me? If I can avoid > installing postfix and sendmail or some other MTA program, it''ll be > way simpler for me. > > Thanks, > Ramon Tayag--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, Greg. I''ve taken a look. I can have to Mailer models that have different uses: the first could be for immediate emailing (forgot password, account activation, etc), and the second, for less immediate email (site notifications, newsletters, etc) which will be a subclass of ARMailer. Ramon Tayag On Wed, Jan 28, 2009 at 1:59 AM, Greg <gregory.brockman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > You should look into AR Mailer: > > http://seattlerb.rubyforge.org/ar_mailer/ > > The basic idea is that rather than actually sending emails, your app > saves emails to the database. AR Mailer then has an external script > which can be used to send these emails in batches. > > Best of luck, > > Greg--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ramon, What I would do is push all the records that need to be mailed to a table (or flag them in a table they already reside in). Then you can have BDRB set up to run once an hour - it picks up the most recent (or the oldest, or some other combination, your choice) and mails them, 250 each hour until there are none left. You can add in records whenever you want, confident that they will go out eventually. Trying to do it another way, i.e. sending out 250, then setting up a schedule to send out the rest, could be done but it''s a lot harder and probably doesn''t get you much more, especially for the 251st and onward email recipients, plus you then have to deal with the issue of that happens if you need to send another batch of 250+ within an hour of the first being sent - what to do then? You can read more about BDRB cron scheduling at http://backgroundrb.rubyforge.org/scheduling/ (this isn''t one of my strengths unfortunately). Hope this helped some. Dale On Tue, Jan 27, 2009 at 1:14 AM, Ramon Tayag <ramon.tayag at gmail.com> wrote:> Hey everyone, > > PROBLEM > I need some backgroundrb help. I have a Rails app that connects to an > SMTP server that can only send up to 250 emails per hour. If I try to > send the 251st email, it will just ignore it. > > SENDMAIL? > I almost bashed my head trying to setup sendmail so I can send my own > emails, but not all emails were being sent. > > FANCY BDRB STUFF > Looking at http://backgroundrb.rubyforge.org/scheduling/ , I can see > that there are many things I can do with backgroundrb, but I can''t > seem to figure out how to do what''s written on the subject. > > I basically want to send up to 250 emails immediately, and queue the > 251st email til after the next hour since the max limit of 250 will be > reset. Is this possible with backgroundrb? > > Thanks, > Ramon Tayag > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20090129/9951a315/attachment.html>
Ramon Tayag
2009-Jan-30 02:25 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
Hi Dale! I suppose by table you mean something like ar_mailer? Thanks, Ramon Tayag On Fri, Jan 30, 2009 at 10:13 AM, Dale Cook <petesalty at gmail.com> wrote:> Ramon, > > What I would do is push all the records that need to be mailed to a table > (or flag them in a table they already reside in). Then you can have BDRB set > up to run once an hour - it picks up the most recent (or the oldest, or some > other combination, your choice) and mails them, 250 each hour until there > are none left. You can add in records whenever you want, confident that they > will go out eventually. > Trying to do it another way, i.e. sending out 250, then setting up a > schedule to send out the rest, could be done but it''s a lot harder and > probably doesn''t get you much more, especially for the 251st and onward > email recipients, plus you then have to deal with the issue of that happens > if you need to send another batch of 250+ within an hour of the first being > sent - what to do then? > > You can read more about BDRB cron scheduling at > http://backgroundrb.rubyforge.org/scheduling/ (this isn''t one of my > strengths unfortunately). > > Hope this helped some. > Dale
Jonathan Wallace
2009-Jan-30 04:39 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
Hi Ramon, I think he means persisting emails to a database table that acts as a queue for your emails. Make the logic in the worker only process 250 elements in your database table. For example, #db table create_table "queued_emails", :force => true do |t| t.string "subject", t.string "body", t.string "to", t.timestamps end #model class QueuedEmail < ActiveRecord::Base end #worker class EmailProcessingWorker < BackgrounDRb::MetaWorker set_worker_name :email_processing_worker def create(args = nil); end def send_emails emails = QueuedEmail.find(:all, :order => "created_on", :limit => 250) emails.each {|e| Notifier.send_email(e) } emails.destroy! end #bdrb config file :backgroundrb: :ip: 0.0.0.0 :port: 1234 :environment: production :schedules: :email_processing_worker: :send_emails: :trigger_args: 0 * */1 * * * You''d need to write the Notifier class which inherits from AR::Mailer and use at your own risk, etc. This code is just a toss off and most definitely contains deficiencies but gets the idea across. Hope this helps, Jonathan On Thu, Jan 29, 2009 at 9:25 PM, Ramon Tayag <ramon.tayag at gmail.com> wrote:> Hi Dale! I suppose by table you mean something like ar_mailer? > > Thanks, > Ramon Tayag > > > > On Fri, Jan 30, 2009 at 10:13 AM, Dale Cook <petesalty at gmail.com> wrote: > > Ramon, > > > > What I would do is push all the records that need to be mailed to a table > > (or flag them in a table they already reside in). Then you can have BDRB > set > > up to run once an hour - it picks up the most recent (or the oldest, or > some > > other combination, your choice) and mails them, 250 each hour until there > > are none left. You can add in records whenever you want, confident that > they > > will go out eventually. > > Trying to do it another way, i.e. sending out 250, then setting up a > > schedule to send out the rest, could be done but it''s a lot harder and > > probably doesn''t get you much more, especially for the 251st and onward > > email recipients, plus you then have to deal with the issue of that > happens > > if you need to send another batch of 250+ within an hour of the first > being > > sent - what to do then? > > > > You can read more about BDRB cron scheduling at > > http://backgroundrb.rubyforge.org/scheduling/ (this isn''t one of my > > strengths unfortunately). > > > > Hope this helped some. > > Dale > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20090129/9528f7bb/attachment.html>
Ramon Tayag
2009-Jan-30 05:56 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
Ahh, yes I understand more. I might not need to use ARMailer? I''ll just save things into the QueuedEmails table, let backgroundrb read that and if it finds something, email it. Thanks! Much clearer now. Ramon Tayag On Fri, Jan 30, 2009 at 12:39 PM, Jonathan Wallace <jonathan.wallace at gmail.com> wrote:> Hi Ramon, > > I think he means persisting emails to a database table that acts as a queue > for your emails. Make the logic in the worker only process 250 elements in > your database table. > > For example, > #db table > create_table "queued_emails", :force => true do |t| > t.string "subject", > t.string "body", > t.string "to", > t.timestamps > end > > #model > class QueuedEmail < ActiveRecord::Base > end > > #worker > class EmailProcessingWorker < BackgrounDRb::MetaWorker > set_worker_name :email_processing_worker > def create(args = nil); end > def send_emails > emails = QueuedEmail.find(:all, :order => "created_on", :limit => 250) > emails.each {|e| Notifier.send_email(e) } > emails.destroy! > end > > #bdrb config file > :backgroundrb: > :ip: 0.0.0.0 > :port: 1234 > :environment: production > :schedules: > :email_processing_worker: > :send_emails: > :trigger_args: 0 * */1 * * * > > You''d need to write the Notifier class which inherits from AR::Mailer and > use at your own risk, etc. This code is just a toss off and most definitely > contains deficiencies but gets the idea across. > > Hope this helps, > > Jonathan > > On Thu, Jan 29, 2009 at 9:25 PM, Ramon Tayag <ramon.tayag at gmail.com> wrote: >> >> Hi Dale! I suppose by table you mean something like ar_mailer? >> >> Thanks, >> Ramon Tayag >> >> >> >> On Fri, Jan 30, 2009 at 10:13 AM, Dale Cook <petesalty at gmail.com> wrote: >> > Ramon, >> > >> > What I would do is push all the records that need to be mailed to a >> > table >> > (or flag them in a table they already reside in). Then you can have BDRB >> > set >> > up to run once an hour - it picks up the most recent (or the oldest, or >> > some >> > other combination, your choice) and mails them, 250 each hour until >> > there >> > are none left. You can add in records whenever you want, confident that >> > they >> > will go out eventually. >> > Trying to do it another way, i.e. sending out 250, then setting up a >> > schedule to send out the rest, could be done but it''s a lot harder and >> > probably doesn''t get you much more, especially for the 251st and onward >> > email recipients, plus you then have to deal with the issue of that >> > happens >> > if you need to send another batch of 250+ within an hour of the first >> > being >> > sent - what to do then? >> > >> > You can read more about BDRB cron scheduling at >> > http://backgroundrb.rubyforge.org/scheduling/ (this isn''t one of my >> > strengths unfortunately). >> > >> > Hope this helped some. >> > Dale >> _______________________________________________ >> Backgroundrb-devel mailing list >> Backgroundrb-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel > >
Jonathan Wallace
2009-Jan-30 06:28 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
"Notifier" in my code is a reference to ARMailer. You''ll still need to use that to send an email message from within rails or backgroundrb. Of course, persisting the jobs to a database table means that you could use something much lighter than backgroundrb (due to it loading a large portion of rails). For example, you could have a plain ruby script that accesses the database and just uses TMail or an equivalent perl script. And then you could use cron to schedule the script. Jonathan On Fri, Jan 30, 2009 at 12:56 AM, Ramon Tayag <ramon.tayag at gmail.com> wrote:> Ahh, yes I understand more. I might not need to use ARMailer? I''ll > just save things into the QueuedEmails table, let backgroundrb read > that and if it finds something, email it. > > Thanks! Much clearer now. > Ramon Tayag > > > > On Fri, Jan 30, 2009 at 12:39 PM, Jonathan Wallace > <jonathan.wallace at gmail.com> wrote: > > Hi Ramon, > > > > I think he means persisting emails to a database table that acts as a > queue > > for your emails. Make the logic in the worker only process 250 elements > in > > your database table. > > > > For example, > > #db table > > create_table "queued_emails", :force => true do |t| > > t.string "subject", > > t.string "body", > > t.string "to", > > t.timestamps > > end > > > > #model > > class QueuedEmail < ActiveRecord::Base > > end > > > > #worker > > class EmailProcessingWorker < BackgrounDRb::MetaWorker > > set_worker_name :email_processing_worker > > def create(args = nil); end > > def send_emails > > emails = QueuedEmail.find(:all, :order => "created_on", :limit => > 250) > > emails.each {|e| Notifier.send_email(e) } > > emails.destroy! > > end > > > > #bdrb config file > > :backgroundrb: > > :ip: 0.0.0.0 > > :port: 1234 > > :environment: production > > :schedules: > > :email_processing_worker: > > :send_emails: > > :trigger_args: 0 * */1 * * * > > > > You''d need to write the Notifier class which inherits from AR::Mailer and > > use at your own risk, etc. This code is just a toss off and most > definitely > > contains deficiencies but gets the idea across. > > > > Hope this helps, > > > > Jonathan > > > > On Thu, Jan 29, 2009 at 9:25 PM, Ramon Tayag <ramon.tayag at gmail.com> > wrote: > >> > >> Hi Dale! I suppose by table you mean something like ar_mailer? > >> > >> Thanks, > >> Ramon Tayag > >> > >> > >> > >> On Fri, Jan 30, 2009 at 10:13 AM, Dale Cook <petesalty at gmail.com> > wrote: > >> > Ramon, > >> > > >> > What I would do is push all the records that need to be mailed to a > >> > table > >> > (or flag them in a table they already reside in). Then you can have > BDRB > >> > set > >> > up to run once an hour - it picks up the most recent (or the oldest, > or > >> > some > >> > other combination, your choice) and mails them, 250 each hour until > >> > there > >> > are none left. You can add in records whenever you want, confident > that > >> > they > >> > will go out eventually. > >> > Trying to do it another way, i.e. sending out 250, then setting up a > >> > schedule to send out the rest, could be done but it''s a lot harder and > >> > probably doesn''t get you much more, especially for the 251st and > onward > >> > email recipients, plus you then have to deal with the issue of that > >> > happens > >> > if you need to send another batch of 250+ within an hour of the first > >> > being > >> > sent - what to do then? > >> > > >> > You can read more about BDRB cron scheduling at > >> > http://backgroundrb.rubyforge.org/scheduling/ (this isn''t one of my > >> > strengths unfortunately). > >> > > >> > Hope this helped some. > >> > Dale > >> _______________________________________________ > >> Backgroundrb-devel mailing list > >> Backgroundrb-devel at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20090130/4ee749cf/attachment.html>
Jack Nutting
2009-Jan-30 12:50 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
On Tue, Jan 27, 2009 at 10:14 AM, Ramon Tayag <ramon.tayag at gmail.com> wrote:> PROBLEM > I need some backgroundrb help. I have a Rails app that connects to an > SMTP server that can only send up to 250 emails per hour. If I try to > send the 251st email, it will just ignore it. > > SENDMAIL? > I almost bashed my head trying to setup sendmail so I can send my own > emails, but not all emails were being sent.An outbound mail queue seems like a "solved problem", i.e. every piece of mail server software already does this. Adding your own queue before passing it off to your ISP''s SMTP seems like a waste of effort on your part, and will lead to delays whenever you need to send more than 250 mails/hour. I think a better solution might be to run your own SMTP server. Sendmail is torturous (I maintained the sendmail installation for a former employer, so I know only too well), but it''s not the only choice. Both qmail and postfix have good reputations as sendmail replacements. Take a look at qmail. -- // jack // http://www.nuthole.com
Jonathan Wallace
2009-Jan-30 14:52 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
Jack, That''s a great point. In a 5 minute google search, I couldn''t find anything about qmail or postfix being able to rate limit out of the box but I did find that exim could. http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch39.html#SECTratelimiting The only question in my mind is, does the database email queue provide persistence that an email server would not? And how important is such things to the OP. I''m not familiar enough with SMTP servers to know what happens during a server reboot what happens to queued mail. Cheers, Jonathan On Fri, Jan 30, 2009 at 7:50 AM, Jack Nutting <jnutting at gmail.com> wrote:> On Tue, Jan 27, 2009 at 10:14 AM, Ramon Tayag <ramon.tayag at gmail.com> > wrote: > > PROBLEM > > I need some backgroundrb help. I have a Rails app that connects to an > > SMTP server that can only send up to 250 emails per hour. If I try to > > send the 251st email, it will just ignore it. > > > > SENDMAIL? > > I almost bashed my head trying to setup sendmail so I can send my own > > emails, but not all emails were being sent. > > An outbound mail queue seems like a "solved problem", i.e. every piece > of mail server software already does this. Adding your own queue > before passing it off to your ISP''s SMTP seems like a waste of effort > on your part, and will lead to delays whenever you need to send more > than 250 mails/hour. > > I think a better solution might be to run your own SMTP server. > Sendmail is torturous (I maintained the sendmail installation for a > former employer, so I know only too well), but it''s not the only > choice. Both qmail and postfix have good reputations as sendmail > replacements. Take a look at qmail. > > -- > // jack > // http://www.nuthole.com > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20090130/8a97d426/attachment.html>
Chad Thatcher
2009-Jan-30 21:14 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
Exim is an excellent choice imho. I''ve used it for years and its solid and very simple to configure (well, by comparison to sendmail anyway). In fact it was based originally on sendmail source code, if I remember correctly, and one of the main goals of the Exim creator(s) was to eliminate the awful sendmail configuration. Once you have passed the message to exim it enters the mail queue and that has been impervious to sudden server crashes/reboots etc. since the dawn of email :). In any event, troubleshooting/diagnosing/ queuing mail with your own homegrown solution is reinventing the wheel as someone already said. A homegrown solution isn''t going to be any more resilient then the tried an tested mailq. IMHO the best way to ensure that the mail got there is to use receipts. Anyway thats my 2c. :) Chad. On 30 Jan 2009, at 14:52, Jonathan Wallace wrote:> Jack, > > That''s a great point. In a 5 minute google search, I couldn''t find > anything about qmail or postfix being able to rate limit out of the > box but I did find that exim could. http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch39.html#SECTratelimiting > > The only question in my mind is, does the database email queue > provide persistence that an email server would not? And how > important is such things to the OP. I''m not familiar enough with > SMTP servers to know what happens during a server reboot what > happens to queued mail. > > Cheers, > Jonathan > > On Fri, Jan 30, 2009 at 7:50 AM, Jack Nutting <jnutting at gmail.com> > wrote: > On Tue, Jan 27, 2009 at 10:14 AM, Ramon Tayag > <ramon.tayag at gmail.com> wrote: > > PROBLEM > > I need some backgroundrb help. I have a Rails app that connects > to an > > SMTP server that can only send up to 250 emails per hour. If I > try to > > send the 251st email, it will just ignore it. > > > > SENDMAIL? > > I almost bashed my head trying to setup sendmail so I can send my > own > > emails, but not all emails were being sent. > > An outbound mail queue seems like a "solved problem", i.e. every piece > of mail server software already does this. Adding your own queue > before passing it off to your ISP''s SMTP seems like a waste of effort > on your part, and will lead to delays whenever you need to send more > than 250 mails/hour. > > I think a better solution might be to run your own SMTP server. > Sendmail is torturous (I maintained the sendmail installation for a > former employer, so I know only too well), but it''s not the only > choice. Both qmail and postfix have good reputations as sendmail > replacements. Take a look at qmail. > > -- > // jack > // http://www.nuthole.com > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20090130/380dd150/attachment-0001.html>
Jack Nutting
2009-Jan-30 23:26 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
On Fri, Jan 30, 2009 at 3:52 PM, Jonathan Wallace <jonathan.wallace at gmail.com> wrote:> That''s a great point. In a 5 minute google search, I couldn''t find anything > about qmail or postfix being able to rate limit out of the box but I did > find that exim could. > http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch39.html#SECTratelimitingActually, one of the benefits of the running his own mail server is that he should be able to skip his ISP''s mail server entirely, thereby eliminating the rate limit entirely (unless his ISP is blocking outbound SMTP traffic, which is possible). -- // jack // http://www.nuthole.com
Jonathan Wallace wrote:> Jack, > > That''s a great point. In a 5 minute google search, I couldn''t find > anything about qmail or postfix being able to rate limit out of the > box but I did find that exim could. > http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch39.html#SECTratelimiting >A bit late, but Postfix has rate limiting See the transport settings. Basically you can setup a specific transport for a certain destination and then throttle it to X messages per whatever. The only thing is that if the mails are literally being thrown away silently then you might prefer to go the custom code solution so that there can''t be any mishaps due to say mailserver being restarted and stats being reset leading to mail loss, etc Good luck Ed W
Ramon Tayag
2009-Feb-11 17:51 UTC
[Backgroundrb-devel] Doing max of N tasks per given time
Thank you everyone for you input ? based on what I''ve read, it seems putting up a postfix server would be the solution. Ramon Tayag On 02 9, 09, at 23:13, Ed W <lists at wildgooses.com> wrote:> Jonathan Wallace wrote: >> Jack, >> >> That''s a great point. In a 5 minute google search, I couldn''t find >> anything about qmail or postfix being able to rate limit out of the >> box but I did find that exim could. http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch39.html#SECTratelimiting >> > > A bit late, but Postfix has rate limiting > > See the transport settings. Basically you can setup a specific > transport for a certain destination and then throttle it to X > messages per whatever. The only thing is that if the mails are > literally being thrown away silently then you might prefer to go the > custom code solution so that there can''t be any mishaps due to say > mailserver being restarted and stats being reset leading to mail > loss, etc > > Good luck > > Ed W > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel