Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl returns error 78 Remote file not found on a correct url. #4479

Closed
vlebourl opened this issue Oct 10, 2019 · 9 comments
Closed

curl returns error 78 Remote file not found on a correct url. #4479

vlebourl opened this issue Oct 10, 2019 · 9 comments
Labels

Comments

@vlebourl
Copy link

vlebourl commented Oct 10, 2019

Here's the full return message:

curl: (78) Remote file not found

I did this

curl --user "login:password" --url "imaps://imap.gmail.com:993/INBOX/;UID=1/"

I expected the following

<title>Bankin'</title> <style type=3D"text/css"> ... and the rest of the email

curl/libcurl version

curl 7.66.0 (x86_64-apple-darwin18.6.0) libcurl/7.66.0 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.2.0 libssh2/1.7.0_DEV
Release-Date: 2019-09-11
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets

operating system

macOS 10.14.5

@vlebourl
Copy link
Author

vlebourl commented Oct 10, 2019

By the way, using a custom command does find the message

curl --user "login:password" --url "imaps://imap.gmail.com:993/INBOX/" -X "fetch 1 BODY"

* 1 FETCH (BODY ("TEXT" "HTML" ("CHARSET" "utf-8") NIL NIL "QUOTED-PRINTABLE" 8109 163))

@jzakrzewski
Copy link
Contributor

I suggest you'd better change your password NOW. I've edited the comment for you.

@vlebourl
Copy link
Author

done... thanks!

@bagder bagder added the IMAP label Oct 10, 2019
@jay
Copy link
Member

jay commented Oct 10, 2019

What is the verbose output? YOu should see something like

> A004 UID FETCH 1 BODY[]
* IMAP 0x7d1590 state change from SELECT to FETCH
< * 1 FETCH (UID 1 BODY[] {6897}
* Curl_pp_readresp_ 482 bytes of trailing server response left
* Found 6897 bytes to download
MIME-Version: 1.0
...

@bagder
Copy link
Member

bagder commented Nov 23, 2019

No response. Closing.

@bagder bagder closed this as completed Nov 23, 2019
@vlebourl
Copy link
Author

vlebourl commented Dec 13, 2019

Sorry... I was away for a while... here is the end of the verbose output with 7.66

< A002 OK starqube.testemail@gmail.com authenticated (Success)
> A003 SELECT INBOX
< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing)
< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing \*)] Flags permitted.
< * OK [UIDVALIDITY 1] UIDs valid.
< * 41 EXISTS
< * 0 RECENT
< * OK [UIDNEXT 58109] Predicted next UID.
< * OK [HIGHESTMODSEQ 5415166]
< A003 OK [READ-WRITE] INBOX selected. (Success)
> A004 UID FETCH 3 BODY[]
< A004 OK Success
> A005 LOGOUT
< * BYE LOGOUT Requested
< A005 OK 73 good day (Success)
* Closing connection 0
* TLSv1.3 (OUT), TLS alert, close notify (256):

and with curl 7.54.0:

< A002 OK starqube.testemail@gmail.com authenticated (Success)
> A003 SELECT INBOX
< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing)
< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing \*)] Flags permitted.
< * OK [UIDVALIDITY 1] UIDs valid.
< * 44 EXISTS
< * 0 RECENT
< * OK [UIDNEXT 58112] Predicted next UID.
< * OK [HIGHESTMODSEQ 5415428]
< A003 OK [READ-WRITE] INBOX selected. (Success)
> A004 FETCH 3 BODY[]
< * 3 FETCH (BODY[] {1130}
* Found 1130 bytes to download

and the email downloads correctly.

@jay jay removed the needs-info label Dec 13, 2019
@jay
Copy link
Member

jay commented Dec 13, 2019

curl --user "login:password" --url "imaps://imap.gmail.com:993/INBOX/;UID=1/"
...
> A004 UID FETCH 3 BODY[]
...
> A004 FETCH 3 BODY[]

It appears curl behavior changed in 6987fce (#2789) to use UID FETCH instead of just plain FETCH when UID is specified. According to the commit message you may be able to get the old behavior by using MAILINDEX instead of UID in your URL.

@sergeevabc
Copy link

I’m here because of the same issue. Tutorials around the web mention @vlebourl’s original approach to read IMAP mails, but it does not work with the latest cURL, alas.

@bagder
Copy link
Member

bagder commented Feb 20, 2020

"Tutorials around the web" is a tricky thing...

@jay already pointed out what made curl change: we had it wrong previously but we also provide a way to retain the old behavior so whatever your situation is, it seems to me that you should be able to get it going.

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

5 participants