Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Close SMTP connections after we're done with them #31

Closed
wants to merge 1 commit into from

2 participants

@mpalmer
Owner

Otherwise a heavily erroring app can cause resource exhaustion.

@mpalmer mpalmer Close SMTP connections after we're done with them
Otherwise a heavily erroring app can exhaust resources.
c837cdd
@mpalmer mpalmer added the mpalmer-ok label
@jjb
Collaborator
jjb commented

i'm not familiar with Net::SMTP but this look legit

  1. needs tests
  2. needs a rebase
@mpalmer
Owner

Burninating this, since TMail/Net::SMTP are dead and buried.

@mpalmer mpalmer closed this
@mpalmer mpalmer deleted the unknown repository branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2011
  1. @mpalmer

    Close SMTP connections after we're done with them

    mpalmer authored
    Otherwise a heavily erroring app can exhaust resources.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rack/contrib/mailexceptions.rb
View
8 lib/rack/contrib/mailexceptions.rb
@@ -78,10 +78,10 @@ def send_notification(exception, env)
server.enable_starttls
end
- server.start smtp[:domain], smtp[:user_name], smtp[:password], smtp[:authentication]
-
- mail.to.each do |recipient|
- server.send_message mail.to_s, mail.from, recipient
+ server.start smtp[:domain], smtp[:user_name], smtp[:password], smtp[:authentication] do |smtp|
+ mail.to.each do |recipient|
+ smtp.send_message mail.to_s, mail.from, recipient
+ end
end
end
Something went wrong with that request. Please try again.