プロジェクト

全般

プロフィール

Vote #73929

完了

Disconnect and logout from IMAP after mail receive

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Email receiving_29
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
29
version_id:
72
issue_org_id:
14103
author_id:
26986
assigned_to_id:
1
comments:
3
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

When running Redmine::IMAP.check(imap_options, options) in a continuous loop with a delay (I don't want to boot the rails env every time) you will eventually get the error listed below depending on your mail provider's maximum concurrent users:

rake aborted!
 Too many simultaneous connections. (Failure)
/usr/local/lib/ruby/2.0.0/net/imap.rb:1156:in `get_tagged_response'
/usr/local/lib/ruby/2.0.0/net/imap.rb:1210:in `block in send_command'
/usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/usr/local/lib/ruby/2.0.0/net/imap.rb:1192:in `send_command'
/usr/local/lib/ruby/2.0.0/net/imap.rb:435:in `login'
/home/ppretorius/workspace-ruby/redmine-2.3.1/lib/redmine/imap.rb:30:in `check'

This problem is fixed by simply adding imap.logout and imap.disconnect at the end of the method:

  imap.expunge
  imap.logout
  imap.disconnect

I got the solution "from this stackoverflow post":http://stackoverflow.com/questions/3322510/ruby-netimap-closing-a-connection.


journals

Since Redmine handles the connection opening and login, it could/should handle logout and disconnection as well.
--------------------------------------------------------------------------------
Patch committed in r11905, thanks.
--------------------------------------------------------------------------------
Merged.
--------------------------------------------------------------------------------


related_issues

relates,Closed,14101,Receive IMAP by uid's

Admin Redmine さんが約4年前に更新

  • カテゴリEmail receiving_29 にセット
  • 対象バージョン2.3.2_72 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0