mailman / mailman

An incoming mail processing microframework in Ruby
MIT License
914 stars 143 forks source link

closed stream exception #113

Open wafcio opened 9 years ago

wafcio commented 9 years ago

We are using mailman with gmail account, connected through imap and everyday we get several exception mails with closed stream exception.

An IOError occurred in background at 08 February 2015 :

closed stream
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/openssl/buffering.rb:326:in `syswrite'

-------------------------------
Backtrace:
-------------------------------

/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/openssl/buffering.rb:326:in `syswrite'
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/openssl/buffering.rb:326:in `do_write'
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/openssl/buffering.rb:423:in `print'
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/imap.rb:1240:in `put_string'
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/imap.rb:1212:in `block in send_command'
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/imap.rb:1207:in `send_command'
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/imap.rb:368:in `logout'
/home/user/www/shared/bundle/ruby/2.2.0/gems/mailman-0.7.2/lib/mailman/receiver/imap.rb:47:in `disconnect'
/home/user/www/shared/bundle/ruby/2.2.0/gems/mailman-0.7.2/lib/mailman/application.rb:143:in `ensure in block in polling_loop'
/home/user/www/shared/bundle/ruby/2.2.0/gems/mailman-0.7.2/lib/mailman/application.rb:143:in `block in polling_loop'
/home/user/www/shared/bundle/ruby/2.2.0/gems/mailman-0.7.2/lib/mailman/application.rb:136:in `loop'
/home/user/www/shared/bundle/ruby/2.2.0/gems/mailman-0.7.2/lib/mailman/application.rb:136:in `polling_loop'
/home/user/www/shared/bundle/ruby/2.2.0/gems/mailman-0.7.2/lib/mailman/application.rb:81:in `run'
/home/user/www/shared/bundle/ruby/2.2.0/gems/mailman-0.7.2/lib/mailman/application.rb:15:in `run'
/home/user/www/current/lib/incoming_mail.rb:26:in `call'
bin/mailer:5:in `
' ------------------------------- Data: ------------------------------- * data: {}

Do you have any suggestions how to fix it ?

Mic92 commented 9 years ago

The current master branch contains retry logic to ensure the daemon is kept running: https://github.com/titanous/mailman/commit/153767a1c91ed431577c04d1539b06f9054aca08

I assume the imap server closes the connection after a certain timeout.

wafcio commented 9 years ago

thanks it helped but now I have started receiving little different emails:

An OpenSSL::SSL::SSLError occurred in background at 11 February 2015 :
SSL_connect SYSCALL returned=5 errno=0 state=unknown state
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/imap.rb:1467:in `connect'
-------------------------------
Backtrace:
-------------------------------
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/imap.rb:1467:in `connect'
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/imap.rb:1467:in `start_tls_session'
/home/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/imap.rb:1060:in `initialize'
/home/user/www/shared/bundle/ruby/2.2.0/bundler/gems/mailman-e16f20173b51/lib/mailman/receiver/imap.rb:49:in `new'
/home/user/www/shared/bundle/ruby/2.2.0/bundler/gems/mailman-e16f20173b51/lib/mailman/receiver/imap.rb:49:in `connect'
/home/user/www/shared/bundle/ruby/2.2.0/bundler/gems/mailman-e16f20173b51/lib/mailman/application.rb:139:in `block in polling_loop'
/home/user/www/shared/bundle/ruby/2.2.0/bundler/gems/mailman-e16f20173b51/lib/mailman/application.rb:137:in `loop'
/home/user/www/shared/bundle/ruby/2.2.0/bundler/gems/mailman-e16f20173b51/lib/mailman/application.rb:137:in `polling_loop'
/home/user/www/shared/bundle/ruby/2.2.0/bundler/gems/mailman-e16f20173b51/lib/mailman/application.rb:81:in `run'
/home/user/www/shared/bundle/ruby/2.2.0/bundler/gems/mailman-e16f20173b51/lib/mailman/application.rb:15:in `run'
/home/user/www/current/lib/incoming_mail.rb:26:in `call'
bin/mailer:5:in `
' ------------------------------- Data: ------------------------------- * data: {}