{"action":"created","issue":{"url":"https://api.github.com/repos/mscdex/node-imap/issues/354","labels_url":"https://api.github.com/repos/mscdex/node-imap/issues/354/labels{/name}","comments_url":"https://api.github.com/repos/mscdex/node-imap/issues/354/comments","events_url":"https://api.github.com/repos/mscdex/node-imap/issues/354/events","html_url":"https://github.com/mscdex/node-imap/issues/354","id":28673743,"number":354,"title":"Connection closes in few minutes","user":{"login":"hassansin","id":4618044,"avatar_url":"https://avatars.githubusercontent.com/u/4618044?v=3","gravatar_id":"","url":"https://api.github.com/users/hassansin","html_url":"https://github.com/hassansin","followers_url":"https://api.github.com/users/hassansin/followers","following_url":"https://api.github.com/users/hassansin/following{/other_user}","gists_url":"https://api.github.com/users/hassansin/gists{/gist_id}","starred_url":"https://api.github.com/users/hassansin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hassansin/subscriptions","organizations_url":"https://api.github.com/users/hassansin/orgs","repos_url":"https://api.github.com/users/hassansin/repos","events_url":"https://api.github.com/users/hassansin/events{/privacy}","received_events_url":"https://api.github.com/users/hassansin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-03-04T01:48:41Z","updated_at":"2015-12-10T20:56:14Z","closed_at":"2014-08-08T11:43:11Z","body":"Hello, I'm trying to listen incoming emails using IMAP. It works nicely with an outlook email. But when I change it to my dreamhost email settings, the connection automatically closes in a minute or two. Here is the log:\r\n```\r\n[connection] Connected to host\r\n<= '* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=P\r\nLAIN AUTH=LOGIN] Dovecot ready.'\r\n=> 'A0 CAPABILITY'\r\n<= '* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=\r\nDISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPA\r\nCE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES W\r\nITHIN CONTEXT=SEARCH LIST-STATUS AUTH=PLAIN AUTH=LOGIN'\r\n<= 'A0 OK Capability completed.'\r\n=> [removed]\r\n<= 'A1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT\r\nSORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NA\r\nMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCH\r\nRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in'\r\n=> 'A2 CAPABILITY'\r\n<= '* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=\r\nDISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPA\r\nCE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES W\r\nITHIN CONTEXT=SEARCH LIST-STATUS'\r\n<= 'A2 OK Capability completed.'\r\n=> 'A3 NAMESPACE'\r\n<= '* NAMESPACE ((\"INBOX.\" \".\")) NIL NIL'\r\n<= 'A3 OK Namespace completed.'\r\n=> 'A4 LIST \"\" \"\"'\r\n<= '* LIST (\\\\Noselect) \".\" \"\"'\r\n<= 'A4 OK List completed.'\r\n=> 'A5 SELECT \"INBOX\" (CONDSTORE)'\r\n<= '* FLAGS (\\\\Answered \\\\Flagged \\\\Deleted \\\\Seen \\\\Draft)'\r\n<= '* OK [PERMANENTFLAGS (\\\\Answered \\\\Flagged \\\\Deleted \\\\Seen \\\\Draft \\\\*)] Fl\r\nags permitted.'\r\n<= '* 1 EXISTS'\r\n<= '* 0 RECENT'\r\n<= '* OK [UIDVALIDITY 1393805952] UIDs valid'\r\n<= '* OK [UIDNEXT 11] Predicted next UID'\r\n<= '* OK [HIGHESTMODSEQ 3] Highest'\r\n<= 'A5 OK [READ-WRITE] Select completed.'\r\n=> 'A6 UID SEARCH UNSEEN'\r\n<= '* SEARCH'\r\n<= 'A6 OK Search completed (0.000 secs).'\r\n=> 'IDLE IDLE'\r\n<= '+ idling'\r\n[connection] Ended\r\n[connection] Closed\r\n```\r\nI suspect something to do with the dreamhost IMAP settings? But I'm not sure. Please advice.\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/mscdex/node-imap/issues/comments/163746864","html_url":"https://github.com/mscdex/node-imap/issues/354#issuecomment-163746864","issue_url":"https://api.github.com/repos/mscdex/node-imap/issues/354","id":163746864,"user":{"login":"mscdex","id":54666,"avatar_url":"https://avatars.githubusercontent.com/u/54666?v=3","gravatar_id":"","url":"https://api.github.com/users/mscdex","html_url":"https://github.com/mscdex","followers_url":"https://api.github.com/users/mscdex/followers","following_url":"https://api.github.com/users/mscdex/following{/other_user}","gists_url":"https://api.github.com/users/mscdex/gists{/gist_id}","starred_url":"https://api.github.com/users/mscdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscdex/subscriptions","organizations_url":"https://api.github.com/users/mscdex/orgs","repos_url":"https://api.github.com/users/mscdex/repos","events_url":"https://api.github.com/users/mscdex/events{/privacy}","received_events_url":"https://api.github.com/users/mscdex/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T20:56:14Z","updated_at":"2015-12-10T20:56:14Z","body":"@raoulus It's hard to say, but it could be the server closing the connection after no activity, despite the `IDLE` ? You can tweak the `keepalive` settings passed to the constructor."}}