pimalaya / himalaya

CLI to manage emails
https://pimalaya.org
MIT License
3.17k stars 95 forks source link

Error: cannot find session from pool at cursor 0 #442

Closed edwardedmonds closed 1 year ago

edwardedmonds commented 1 year ago

I'm getting this error when I first run the himalaya command:

Error: cannot find session from pool at cursor 0

This is my config, and I also verified pass is showing the correct password.

display-name = "Edward Edmonds"
downloads-dir = "~/Downloads"
signature = "\nEdward"
email-listing-page-size = 50

[gmail]
default = true
email = "edward.edmonds@gmail.com"

backend = "imap"
imap-host = "imap.gmail.com"
imap-port = 993
imap-login = "edward.edmonds@gmail.com"
imap-passwd-cmd = "pass show gmail"

sender = "smtp"
smtp-host = "smtp.gmail.com"
smtp-port = 465
smtp-login = "edward.edmonds@gmail.com"
smtp-passwd-cmd = "pass show gmail"

[gmail.folder-aliases]
sent = "[Gmail]/Sent Mail"
drafts = "[Gmail]/Drafts"
codingsenpi commented 1 year ago

I too ran it for the first time and configured through it's wizard. I am getting the same error Error: cannot find session from pool at cursor 0

This is my config

backend = "imap"
email = "codingsenpi@gmail.com"
default = true
display-name = "senpi"
sender = "smtp"
smtp-host = "smtp.gmail.com"
smtp-port = 465
smtp-ssl = true
smtp-login = "codingsenpi@gmail.com"
smtp-passwd-cmd = "pass show cli-tools/gmail"
sync = false
imap-host = "imap.gmail.com"
imap-port = 993
imap-ssl = true
imap-login = "codingsenpi@gmail.com"
imap-passwd-cmd = "pass show cli-tools/gmail"
soywod commented 1 year ago

You are both using Gmail accounts, right? Did you set up a 3rd party app password (see https://github.com/soywod/himalaya/wiki/Configuration:gmail)? Because Gmail does not allow the use of your regular password, you need to create a specific one.

codingsenpi commented 1 year ago

That was the issue. Creating an App Password and using it instead solved the issue. Thank you so much

soywod commented 1 year ago

That was the issue. Creating an App Password and using it instead solved the issue. Thank you so much

We will try to improve the documentation to avoid those kind of situation in the future. Thank you for your feedback!

kmaasrud commented 1 year ago

I'll also make sure to add a note on this if a user enters a Gmail account in the wizard. We can use this issue for tracking it.

You can assign it to me, @soywod 👍

kmaasrud commented 1 year ago

...or rather: maybe mirror it to Sourcehut and assign it to me there 😅

edwardedmonds commented 1 year ago

The app password was the issue. Thank you for the quick response.

a1ecbr0wn commented 1 year ago

Interesting that the wiki link (https://github.com/soywod/himalaya/wiki/Configuration:gmail) is not visible to me. Is there a Wiki that is only open to some people? Is that an accident?

kmaasrud commented 1 year ago

Is there a Wiki that is only open to some people?

@a1ecbr0wn we've moved the docs out of GitHub. See https://pimalaya.org/himalaya/docs/cli/configuration/gmail.html for the corresponding page.

iacs commented 1 year ago

I'm getting this error, but I'm trying it with a yahoo account, not Gmail

This is my config:

[Yahoo]
backend = "imap"
email = "xxx@yahoo.es"
default = true
display-name = "MyName"
sender = "smtp"
smtp-host = "smtp.mail.yahoo.com"
smtp-port = 465
smtp-ssl = true
smtp-login = "xxx@yahoo.es"
smtp-passwd-cmd = "pass show email/xxx"
sync = false
imap-host = "imap.mail.yahoo.com"
imap-port = 993
imap-ssl = true
imap-login = "xxx@yahoo.es"
imap-passwd-cmd = "pass show email/xxx"
kmaasrud commented 1 year ago

I'm getting this error, but I'm trying it with a yahoo account, not Gmail

@iacs Does Yahoo use OAuth or some sort of two-factor authentication? If so, then there's probably a similar workaround needed. I have no Yahoo account to test this out with though...

I get the need for extra security layers, but it's pretty frustrating that the big actors in the email world refuse to fully comply with established standards (or at least not without hacky workarounds.) It makes software like this very difficult to use/develop.

iacs commented 1 year ago

Seems that there is a not so evident option to generate app passwords yes. Found it. If you log in using that password it actually works

kmaasrud commented 1 year ago

Seems that there is a not so evident option to generate app passwords yes.

That's great! Could you share the method with us, so we can add it to the docs?