{"action":"created","issue":{"url":"https://api.github.com/repos/curl/curl/issues/3398","repository_url":"https://api.github.com/repos/curl/curl","labels_url":"https://api.github.com/repos/curl/curl/issues/3398/labels{/name}","comments_url":"https://api.github.com/repos/curl/curl/issues/3398/comments","events_url":"https://api.github.com/repos/curl/curl/issues/3398/events","html_url":"https://github.com/curl/curl/issues/3398","id":392701940,"node_id":"MDU6SXNzdWUzOTI3MDE5NDA=","number":3398,"title":"imap fetch broken","user":{"login":"MonkeybreadSoftware","id":1464807,"node_id":"MDQ6VXNlcjE0NjQ4MDc=","avatar_url":"https://avatars2.githubusercontent.com/u/1464807?v=4","gravatar_id":"","url":"https://api.github.com/users/MonkeybreadSoftware","html_url":"https://github.com/MonkeybreadSoftware","followers_url":"https://api.github.com/users/MonkeybreadSoftware/followers","following_url":"https://api.github.com/users/MonkeybreadSoftware/following{/other_user}","gists_url":"https://api.github.com/users/MonkeybreadSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/MonkeybreadSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MonkeybreadSoftware/subscriptions","organizations_url":"https://api.github.com/users/MonkeybreadSoftware/orgs","repos_url":"https://api.github.com/users/MonkeybreadSoftware/repos","events_url":"https://api.github.com/users/MonkeybreadSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/MonkeybreadSoftware/received_events","type":"User","site_admin":false},"labels":[{"id":282653573,"node_id":"MDU6TGFiZWwyODI2NTM1NzM=","url":"https://api.github.com/repos/curl/curl/labels/IMAP","name":"IMAP","color":"f7c6c7","default":false},{"id":698723912,"node_id":"MDU6TGFiZWw2OTg3MjM5MTI=","url":"https://api.github.com/repos/curl/curl/labels/not-a-bug","name":"not-a-bug","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-12-19T17:21:01Z","updated_at":"2018-12-20T08:37:56Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"\r\n./curl --verbose --url \"imap://imap.macsw.de/INBOX/\" -u xxx:yyy --request \"FETCH 1:* (FLAGS BODY[HEADER.FIELDS (Message-Id)])\" --output test.txt\r\n\r\nWhen I run this the output of fetch goes to debug messages and not to the file.\r\n\r\nThe file only contains:\r\n\r\n* 1 FETCH (FLAGS (\\Seen) BODY[HEADER.FIELDS (MESSAGE-ID)] {77}\r\n* 2 FETCH (FLAGS (\\Seen) BODY[HEADER.FIELDS (MESSAGE-ID)] {75}\r\n* 3 FETCH (FLAGS (\\Seen) BODY[HEADER.FIELDS (MESSAGE-ID)] {77}\r\n* 4 FETCH (FLAGS (\\Seen) BODY[HEADER.FIELDS (MESSAGE-ID)] {88}\r\n\r\nBut the debug log shows the message IDs:\r\n\r\nA004 FETCH 1:* (FLAGS BODY[HEADER.FIELDS (Message-Id)])\r\n< * 1 FETCH (FLAGS (\\Seen) BODY[HEADER.FIELDS (MESSAGE-ID)] {77}\r\n< Message-Id: <6F3B718F-8427-4EFB-B291-106A8ABFC1AA@monkeybreadsoftware.de>\r\n< \r\n< )\r\n< * 2 FETCH (FLAGS (\\Seen) BODY[HEADER.FIELDS (MESSAGE-ID)] {75}\r\n< Message-Id: <20180513143045.88FCF186080F@quake.server.clever-zoeger.de>\r\n< \r\n< )\r\n< * 3 FETCH (FLAGS (\\Seen) BODY[HEADER.FIELDS (MESSAGE-ID)] {77}\r\n< Message-Id: <CD138D19-86B0-4EC6-921B-0D7CB0C861A9@monkeybreadsoftware.de>\r\n< \r\n< )\r\n< * 4 FETCH (FLAGS (\\Seen) BODY[HEADER.FIELDS (MESSAGE-ID)] {88}\r\n< Message-ID: <620169242.91311542275549379@filemaker-jc-t-wa02.dynphx1.jivehosted.com>\r\n< \r\n< )\r\n< A004 OK Fetch completed (0.001 + 0.000 secs).\r\n\r\n\r\nDoes anyone know why this output goes to log instead of file?\r\n\r\nWe see this in curl command line tool and our own software using libcurl.\r\n\r\n\r\ncurl 7.63.0 (x86_64-apple-darwin17.7.0) libcurl/7.63.0 OpenSSL/1.1.0e zlib/1.2.11 libssh2/1.8.0\r\nRelease-Date: 2018-12-12\r\nProtocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp \r\nFeatures: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/curl/curl/issues/comments/448916971","html_url":"https://github.com/curl/curl/issues/3398#issuecomment-448916971","issue_url":"https://api.github.com/repos/curl/curl/issues/3398","id":448916971,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODkxNjk3MQ==","user":{"login":"MonkeybreadSoftware","id":1464807,"node_id":"MDQ6VXNlcjE0NjQ4MDc=","avatar_url":"https://avatars2.githubusercontent.com/u/1464807?v=4","gravatar_id":"","url":"https://api.github.com/users/MonkeybreadSoftware","html_url":"https://github.com/MonkeybreadSoftware","followers_url":"https://api.github.com/users/MonkeybreadSoftware/followers","following_url":"https://api.github.com/users/MonkeybreadSoftware/following{/other_user}","gists_url":"https://api.github.com/users/MonkeybreadSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/MonkeybreadSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MonkeybreadSoftware/subscriptions","organizations_url":"https://api.github.com/users/MonkeybreadSoftware/orgs","repos_url":"https://api.github.com/users/MonkeybreadSoftware/repos","events_url":"https://api.github.com/users/MonkeybreadSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/MonkeybreadSoftware/received_events","type":"User","site_admin":false},"created_at":"2018-12-20T08:37:56Z","updated_at":"2018-12-20T08:37:56Z","author_association":"CONTRIBUTOR","body":"I got a workaround. In case of error 78, we replace UID with MAILINDEX to fix transparently:\r\n\r\n\r\n```\r\nCURLcode curl_easy_performX(CURL *curl)\r\n{\r\n\tCURLcode e = _curl_easy_perform(curl);\r\n\t\r\n\tif (e == CURLE_REMOTE_FILE_NOT_FOUND)\r\n\t{\r\n\t\tchar *effectiveURL = nil;\r\n\t\tCURLcode e2 = _curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &effectiveURL);\r\n\t\tDebugMessage(\"curl_easy_getinfo returns\", e2);\r\n\t\t\r\n\t\tif (e2 == CURLE_OK)\r\n\t\t{\r\n\t\t\tDebugMessage(\"effectiveURL\", effectiveURL);\r\n\t\t\tif (effectiveURL)\r\n\t\t\t{\r\n\t\t\t\tif (strncasecmp(effectiveURL, \"imap\", 4) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t// is IMAP\r\n\t\t\t\t\tconst char* UID = \";UID=\";\r\n\t\t\t\t\tsize_t UIDlen = strlen(UID);\r\n\t\t\t\t\tconst char* pos = strstr(effectiveURL, UID);\r\n\t\t\t\t\tif (pos != NULL)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// found UID, so replace with MAILINDEX\r\n\t\t\t\t\t\tsize_t len = strlen(effectiveURL);\r\n\t\t\t\t\t\tchar* newURL = (char*) AllocateClearMemory(len + 12);\r\n\t\t\t\t\t\tFreeMemoryLater(newURL);\r\n\t\t\t\t\t\tif (newURL)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tconst char* MailIndex = \";MAILINDEX=\";\r\n\t\t\t\t\t\t\tsize_t MailIndexLen = strlen(MailIndex);\r\n\t\t\t\t\t\t\tsize_t PrefixLen = pos-effectiveURL;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tmemcpy(newURL, effectiveURL, PrefixLen);\r\n\t\t\t\t\t\t\tmemcpy(newURL + PrefixLen, \";MAILINDEX=\", MailIndexLen);\r\n\t\t\t\t\t\t\tmemcpy(newURL + PrefixLen+MailIndexLen, pos + UIDlen, len - PrefixLen - UIDlen);\r\n\t\t\t\t\t\t\tDebugMessage(\"newURL\", newURL);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\te = _curl_easy_setopt(curl, CURLOPT_URL, newURL);\r\n\t\t\t\t\t\t\tDebugMessage(\"_curl_easy_setopt CURLOPT_URL returns\", e);\r\n\r\n\t\t\t\t\t\t\tif (e == CURLE_OK)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\te = _curl_easy_perform(curl);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn e;\r\n}\r\n```"}}
{"actor":{"display_login":"MonkeybreadSoftware"}}