-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Keyring not working on MacOS #484
Comments
Awesome, feel free to join the Matrix room if you have any question. Or use GitHub Discussions.
There was a typo in the config sample. I pushed a fix, the SMTP backend config should look like this: Line 470 in 24c9e3b
To summarize, |
I am not sure to understand your issue. Could you share your IMAP config? |
I actually forgot to enable the himalaya account configure --reset myaccount which then prompted for both IMAP and SMPT passwords correctly. This is what I have in config.toml: imap.auth.keyring = "myimap"
smtp.auth.keyring = "mysmtp" However still after that when I run
and for some reason the keyring doesn't work. I wonder if I need to on OSX somehow give permissions to the himalaya binary? It did however (perhaps) correctly set the password so I would assume it could read it too. |
Yes indeed, the
Mmh I cannot reproduce your issue. Here what I tried:
The secret is correctly taken from the keyring system. Do you confirm that you did the same steps, in the same order? To check if the issue does not come from OSX, could you try to run the following test? git clone https://github.com/pimalaya/core.git pimalaya
cd pimalaya
cargo test -p secret-lib --test secret |
Running that test works.
|
Then I don't get what is happening, it should work. Could you share your whole config? |
Also, on which version and/or |
I looked at the Keychain in OSX and it seems reseting isn't creating any entries there. This shows also when I try to run the reset twice in a row: the second run doesn't find anything:
I installed himalaya like this, do I need more features by any chance? cargo install --git https://github.com/pimalaya/himalaya.git --features keyring --force himalaya |
Oh, and in March 2024 I ran an older version of himalaya and I could now see that Keyring had those entries correctly there. So this has worked on this machine before. I also tried to give access to those entries to this new self-built himalaya, but it didn't work: it can't find the entries. |
Nop, it should definitely work like this.
Interesting, I will investigate the changes. But I don't understand how the test can pass but not Himalaya CLI. They both do the same thing 🤔 Could you also try the cargo test -p keyring-lib --test keyring |
That passes fine too:
|
I suspect Himalaya CLI not to take the latest version of cargo install --git https://github.com/pimalaya/himalaya.git --features keyring --force himalaya |
Well that's odd, I ran the above but it didn't pick up the latest commit:
I then ran:
and that picked up the latest and built fine.
Unfortunately didn't work, no difference. |
I propose you a last thing, instead of using cargo uninstall himalaya
git clone https://github.com/pimalaya/himalaya.git
cd himalaya
cargo run --features keyring -- account config --reset
cargo run --features keyring -- envelope list If it still does not work, then I have no clue on what's going on, and it's gonna be hard to debug since I cannot reproduce. Tests pass so technically keyring works on your machine. I will write down a serie of tests, using different level of libs from low to high ( Meanwhile, you can use the OSX
|
I tried to compile from sources, but to no avail. Same problem. However, I did get this to work:
It uses the values that I saved in March with the old Himalaya version. So all is good at least for now! So I can continue using himalaya for emails now, which is great. Thank you! I'll close this issue. |
One more thing: it might be a security issue with different However this time I didn't get a popup once about Keychain access with my self-compiled himalaya binary. Don't really know why, but that might be the reason it can't edit/access it. |
Interesting. Now that keychain access has been asked once for this particular binary, could you try again with the keyring variant? It maybe unlocked things, somehow. If it still does not work then I will keep the issue open till I find the root cause. |
I created a new branch cd /path/to/himalaya
git fetch
git checkout keyring-debug
# first test: running the example, which should work like previous keyring and secret tests
cargo run --example keyring --features imap --features keyring
# second test: running the binary, to simulate security issues
cargo build --bin keyring --features imap --features keyring
cd target/debug
./keyring Additionally, could you try to build a |
result (there was a prompt, I inserted 1234, seemed to find it):
Same with the other. However, when I changed that "key" in the examples/keyring.rs to "himalayadebug" (for better searching) and then went to Keychain Access on OSX, I could not find anything related to that key there. So I don't think when you read the secret in the end you are actually reading it from the Keychain. Is it coming from some transient memory? |
It should definitely be the case. In fact, it could easily be tested by cloning the
I also noticed that a new major version is available, so I plan to upgrade and see if it helps. For now it is blocked due to a compilation error hwchen/keyring-rs#214. |
I think I finally understood what happened. The low-level
After that Pimalaya will be able to use the |
Hi!
Thank you for a great project, I'm very much interested in starting using himalaya, and cloned the latest git.
However, I can't seem to get my SMTP to work with IMAP. The first problem I run into is:
https://github.com/pimalaya/himalaya/blob/master/config.sample.toml#L309
and
https://github.com/pimalaya/himalaya/blob/master/config.sample.toml#L474
which fails when I try to run it with invalid TOML. After I comment out the "smtp" backend, I can read my emails via IMAP but SMTP does not seem to want to connect.
Is the master branch just in too much flux right now to be usable?
p.s. Also, on OSX, I can't get any prompt to to access the keyring, it just fails. When I try to reset the configuration, it doesn't prompt for a new password, but just exists. Also, doing a fresh configuration jams completely in the automatic searching for servers step without creating a config.toml, so I can't start from scratch either.
The text was updated successfully, but these errors were encountered: