{"action":"created","issue":{"url":"https://api.github.com/repos/mscdex/node-imap/issues/459","labels_url":"https://api.github.com/repos/mscdex/node-imap/issues/459/labels{/name}","comments_url":"https://api.github.com/repos/mscdex/node-imap/issues/459/comments","events_url":"https://api.github.com/repos/mscdex/node-imap/issues/459/events","html_url":"https://github.com/mscdex/node-imap/issues/459","id":63553316,"number":459,"title":"Problem with email date search","user":{"login":"nicu","id":56295,"avatar_url":"https://avatars.githubusercontent.com/u/56295?v=3","gravatar_id":"","url":"https://api.github.com/users/nicu","html_url":"https://github.com/nicu","followers_url":"https://api.github.com/users/nicu/followers","following_url":"https://api.github.com/users/nicu/following{/other_user}","gists_url":"https://api.github.com/users/nicu/gists{/gist_id}","starred_url":"https://api.github.com/users/nicu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicu/subscriptions","organizations_url":"https://api.github.com/users/nicu/orgs","repos_url":"https://api.github.com/users/nicu/repos","events_url":"https://api.github.com/users/nicu/events{/privacy}","received_events_url":"https://api.github.com/users/nicu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-22T17:02:37Z","updated_at":"2015-03-23T08:58:30Z","closed_at":null,"body":"I'll start by saying that I'm almost sure I'm not using the API properly.\r\n\r\nIn one of my GMail accounts, I have an unread email from `March 22, 2015`.\r\nI'm trying to read its contents, but with no luck. The code is:\r\n\r\n```js\r\nvar lastDate = new Date(2015, 2, 20); // 2 days before the email's date\r\nimap.search([  ['SINCE', lastDate] ], function(err, results) {\r\n\tif (err) throw err;\r\n\r\n\tvar f = imap.seq.fetch(results, {\r\n\t\tbodies: 'TEXT'\r\n\t});\r\n\r\n\tf.on('message', function(msg, seqno) {\r\n\t\t// this never fires\r\n\t});\r\n\t[...]\r\n});\r\n```\r\nI also tried with string representation of the date, with identical results.\r\nIf I set the date long enough in the past, I can see this email in the list of few emails that belong to the time interval.\r\n\r\nAny ideas?\r\n\r\nIn the debug log, I don't see any request like the one below, which is extracted from a date filter from January until March.\r\n```\r\n'* 555 FETCH (X-GM-THRID XXXXXXXXXXXXXXXXX X-GM-MSGID XXXXXXXXXXXXXXXXX X-GM-LABELS (\"\\\\\\\\Important\" \"\\\\\\\\Sent\") UID 562 MODSEQ (XXXXX) INTERNALDATE \"31-Jan-2015 20:00:22 +0000\" FLAGS (\\\\Seen) BODY[TEXT] {14}'\r\n```\r\n\r\n\r\nDebug info:\r\n```\r\n[connection] Connected to host\r\n<= '* OK Gimap ready for requests from <IP> <HASH>'\r\n=> 'A0 CAPABILITY'\r\n<= '* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN'\r\n<= 'A0 OK Thats all she wrote! <HASH>'\r\n=> 'A1 LOGIN \"my_user@gmail.com\" \"password\"'\r\n<= '* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT'\r\n<= 'A1 OK my_user@gmail.com authenticated (Success)'\r\n=> 'A2 NAMESPACE'\r\n<= '* NAMESPACE ((\"\" \"/\")) NIL NIL'\r\n<= 'A2 OK Success'\r\n=> 'A3 LIST \"\" \"\"'\r\n<= '* LIST (\\\\Noselect) \"/\" \"/\"'\r\n<= 'A3 OK Success'\r\n=> 'A4 EXAMINE \"<NAME_OF_INBOX>\" (CONDSTORE)'\r\n<= '* FLAGS (\\\\Answered \\\\Flagged \\\\Draft \\\\Deleted \\\\Seen $Phishing $NotJunk NotJunk $NotPhishing)'\r\n<= '* OK [PERMANENTFLAGS ()] Flags permitted.'\r\n<= '* OK [UIDVALIDITY 12] UIDs valid.'\r\n<= '* 636 EXISTS'\r\n<= '* 0 RECENT'\r\n<= '* OK [UIDNEXT 660] Predicted next UID.'\r\n<= '* OK [HIGHESTMODSEQ 111910]'\r\n<= 'A4 OK [READ-ONLY] <NAME_OF_INBOX> selected. (Success)'\r\n=> 'A5 UID SEARCH SINCE 20-Mar-2015'\r\n<= '* SEARCH 659'\r\n<= 'A5 OK SEARCH completed (Success)'\r\n=> 'A6 FETCH 659 (X-GM-THRID X-GM-MSGID X-GM-LABELS MODSEQ UID FLAGS INTERNALDATE BODY.PEEK[TEXT])'\r\n<= 'A6 OK Success'\r\n=> 'IDLE IDLE'\r\n<= '+ idling'\r\n=> DONE\r\n<= 'IDLE OK IDLE terminated (Success)'\r\n=> 'A7 LOGOUT'\r\n<= '* BYE LOGOUT Requested'\r\n<= 'A7 OK 73 good day (Success)'\r\n[connection] Ended\r\n[connection] Closed\r\n```\r\n\r\nThank you"},"comment":{"url":"https://api.github.com/repos/mscdex/node-imap/issues/comments/84895516","html_url":"https://github.com/mscdex/node-imap/issues/459#issuecomment-84895516","issue_url":"https://api.github.com/repos/mscdex/node-imap/issues/459","id":84895516,"user":{"login":"nicu","id":56295,"avatar_url":"https://avatars.githubusercontent.com/u/56295?v=3","gravatar_id":"","url":"https://api.github.com/users/nicu","html_url":"https://github.com/nicu","followers_url":"https://api.github.com/users/nicu/followers","following_url":"https://api.github.com/users/nicu/following{/other_user}","gists_url":"https://api.github.com/users/nicu/gists{/gist_id}","starred_url":"https://api.github.com/users/nicu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicu/subscriptions","organizations_url":"https://api.github.com/users/nicu/orgs","repos_url":"https://api.github.com/users/nicu/repos","events_url":"https://api.github.com/users/nicu/events{/privacy}","received_events_url":"https://api.github.com/users/nicu/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T08:58:30Z","updated_at":"2015-03-23T08:58:30Z","body":"That was the problem. How embarrassing.\r\n\r\nThank you for the help."}}