Mew icon indicating copy to clipboard operation
Mew copied to clipboard

Failed to get IMAP folder information at initialization

Open juntakei opened this issue 4 years ago • 8 comments

Emacs ver: This is GNU Emacs 27.1 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.7 (Build 19H114)) of 2020-12-27 Mew ver: from Github on Jan 11, 2021 Server: Gmail IMAP server via stunnel

Situation:

  • Emacs27.1 on OSX (10.15.7) with latest Mew.
  • .emacs, .mew.el and other configuration files are working configuration on the other machine.
  • Folder initilization run C-uZ to get IMAP folder information from the server.
  • When I run C-uZ, the process complete without any error but nothing happen.
  • IMAP communication includes auth worked well which was checked by sending email (tcpdump and log) (confirmed successful copy the email in Sent folder via IMAP port which means stunnel is working over IMAP)
  • Looks some process doesn't work or skip in mew.el between line 241 and 262.
  • There is no message when running with mew-debug flag
  • I guess the process returned before accessing IMAP since there is no packet confirmed by C-uZ

Please let me know if anything I should check.

Thank you!

juntakei avatar Jan 13 '21 22:01 juntakei

  • .emacs, .mew.el and other configuration files are working configuration on the other machine.
  • When I run C-uZ, the process complete without any error but nothing happen.

To compare behaviors in your environments, evaluate (setq mew-debug 'net), go to %inbox, type C-u Z, and then look in the *Messages* buffer and the *Mew debug* buffer.

  • Looks some process doesn't work or skip in mew.el between line 241 and 262.

See the condition (consp arg) in mew-status-update() for C-u Z. mew-imap-update() should be invoked, and finally the message "Collecting mailbox list...done" should be displayed by mew-imap-sentinel().

tats avatar Jan 14 '21 10:01 tats

I can reproduce this:

<=SEND=>
isqu5990 LOGIN "kazu..." "...."

<LOGIN>
isqu5990 NO [ALERT] Application-specific password required: https://support.google.com/accounts/answer/185833 (Failure)

Probably, two factor authentication is necessary.

kazu-yamamoto avatar Jan 15 '21 00:01 kazu-yamamoto

@yoshinari-nomura Would you summarize the status of authentication on gmail? Japanese is OK.

kazu-yamamoto avatar Jan 15 '21 00:01 kazu-yamamoto

<=SEND=> isqu5990 LOGIN "kazu..." "...."

isqu5990 NO [ALERT] Application-specific password required: https://support.google.com/accounts/answer/185833 (Failure) ```

Probably, two factor authentication is necessary.

On the other machine, I can get access my inbox through another version of mew with same configuration files. Mew version 6.7 GNU Emacs 25.1.2 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G1004)) of 2016-10-07

I will post debug message later today. Thanks.

juntakei avatar Jan 15 '21 00:01 juntakei

@tats, I set debug flag you mentioned and also did (setq mew-debug t), there is no useful message in Message buffer.

mew-imap-namespace: Type ’M-x universal-argumentZ’ to collect IMAP folders! command-execute: Buffer is read-only: #<buffer %inbox> debug ****Updating status... 8888Updating status...done

Then I added some debug message in the source to check your suggestions.In my case, the program skips the block line 227-237. But after adding debug message next to the line226. All the sudden it starts working. After the first folder check, now Mew is working fine now. If it may help for the community, I can erase my local folder and check the phenomenon again. Anyway thank you for all the suggestion and advises. I'm happy to be back Mew community. Thanks > @kazu-yamamoto

juntakei avatar Jan 15 '21 03:01 juntakei

@juntakei

mew-imap-namespace: Type ’M-x universal-argumentZ’ to collect IMAP folders!

Your Emacs seems to lost the key binding C-u to universal-argument, so C-u Z cannot pass the argument to mew-status-update().

It should normally be:

(mew-substitute-for-summary "Type '\\[universal-argument]\\[mew-status-update]' to collect IMAP folders!")
"Type ’C-uZ’ to collect IMAP folders!"

(substitute-command-keys "\\<mew-summary-mode-map>\\[universal-argument]")
"C-u"

(substitute-command-keys "\\<global-map>\\[universal-argument]")
"C-u"

tats avatar Jan 15 '21 10:01 tats

@tats, you are right. It was caused by my local key binding. I remember I had same issue long time ago, may be in 90s. Kazu found it during a camp. Let me ask primitive question. When I manually typed M-x universal-argument [space] Z (it's replaced to "universal-argument-Z" )or M-x universal-argumentZ, emacs just say "no match". Anyway, now I can use Mew again and thank you for your advice.

@kazu-yamamoto , your issue posted above can be solved by using "Google App specific password". Please check this page. https://support.google.com/accounts/answer/185833?hl=en

Thank you, all!

juntakei avatar Jan 15 '21 17:01 juntakei

@yoshinari-nomura Would you summarize the status of authentication on gmail? Japanese is OK.

My IMAP XOAUTH2 branch is here: https://github.com/yoshinari-nomura/Mew/tree/mew-support-xoauth2 and some comments on the branch: https://groups.google.com/g/mew-ja/c/Hn9L27ll-eY/m/RBEYHOwqAwAJ

It works well for my daily use, but unfortunately, this would not be helpful for this issue.

By the way, Google is planning to turn off less secure app access to G Suite accounts: https://workspaceupdates.googleblog.com/2019/12/less-secure-apps-oauth-google-username-password-incorrect.html

I recomment G Suite users to migrate to OAuth2 authentication.

yoshinari-nomura avatar Jan 16 '21 10:01 yoshinari-nomura