keepassxc-mail icon indicating copy to clipboard operation
keepassxc-mail copied to clipboard

First password prompt not handled

Open kkapsner opened this issue 2 years ago • 12 comments

The first primary password prompt and (sometimes) the normal first prompt are not handled by keepassxc-mail.

Expected Behaviour

All passwords prompts are handled.

Current Behaviour

The first primary password prompt is never handled. If no primary password is set the first normal password prompt is sometimes (depending on a racing condition)

Possible Solution

For the "normal" prompts Thunderbird could be set into offline upon shutdown and then set online when keepassxc-mail is ready. The primary password prompt problem has to be handled by Thunderbird code.

Steps to Reproduce (for bugs)

  1. create a fresh Thunderbird profile
  2. set a primary password
  3. install keepassxc-mail
  4. restart Thunderbird -> the first primary password prompt is not handled

Context

Always reproducible with the master password. Without it's dependent on the amount of installed extensions and the specific accounts.

Your Environment

  • KeePassXC-mail version used: 1.4
  • Thunderbird version: 102.9.1

Issues mentioning this:

  • https://github.com/kkapsner/keepassxc-mail/issues/45#issuecomment-865758494
  • https://github.com/kkapsner/keepassxc-mail/issues/53#issuecomment-1010440124
  • https://github.com/kkapsner/keepassxc-mail/issues/62#issuecomment-1484047938

kkapsner avatar Apr 07 '23 07:04 kkapsner

Todo:

  • [ ] create change request at bugzilla.mozilla.org
  • [x] check if and how Thunderbird can be set in online/offline mode

kkapsner avatar Apr 07 '23 08:04 kkapsner

  • Services.io.offline = state can change the mode
  • Preference offline.startup_state handles how Thunderbird starts
  • Preference network.online stores the last state

Remaining:

  • [x] execute code when Thunderbird is shut down - but do not execute when the extension is disabled/uninstalled

kkapsner avatar Apr 11 '23 12:04 kkapsner

@mdonz and @johannes-hafner: please try keepassxc-mail-1.5.1.zip

kkapsner avatar Apr 15 '23 21:04 kkapsner

Seems to be working. I installed that version, opened and closed thunderbird a few times and so far, the issue did not occur again. I'll post an update in case the issue reappears, otherwise, consider this solved. Thank you for looking into it and providing a fix so soon!

johannes-hafner avatar Apr 15 '23 22:04 johannes-hafner

Ok, after a bit more testing, I am not sure wether IMAP connections are established at all after startup. I have KeePass set up to prompt me if a password is requested using native messaging, and I do not get one after stating thunderbird.

I also tested if I receive new emails after startup and the answer is no - I only get them when I click the UI button to check for new messages.

So apparently, after swichting thunderbird back to online mode, IMAP accounts are not connected immediately.

johannes-hafner avatar Apr 15 '23 22:04 johannes-hafner

Hm, strong side effects here. My CalDav based calendars (three) are not accessible, each showing an exclamation mark in the calendar pane. They are usable again if I untick the "Enable this calendar" and then tick it again but will end in the same unusable state after a next Thunderbird start. I has to revert back to the previous Keepassxc version (1.4.1 I am using, installed this on top of 1.5.1 ) but unfortunately the Caldav calendars are not not working at all. Will try to uninstall Keepassxc and start fresh with 1.4.1 and hope to get calendars working again.

mdonz avatar Apr 16 '23 05:04 mdonz

After uninstall/re-install, Thunderbird is now in offline mode when starting up so there is some of the functionality left over from the Keepassxc 1.5.1. installation as it look like. This impacts all Caldav calendars badly. I hope to find that setting or otherwise appreciate some advice here where to disable going into offline mode when closing Thunderbird.

mdonz avatar Apr 16 '23 05:04 mdonz

Searched for offline mode settings and reset back to default. Have my previous behaviour for Keepassxc 1.4.1 back as it was before. The Caldav calendars did not handle the offline mode well hence 1.5.1 would not work for me.

mdonz avatar Apr 16 '23 07:04 mdonz

Thanks for testing. It's the preference "offline.startup_state" that I tried to utilize.

So I have some things to figure out:

  • [ ] handle de-installation and downgrade better
  • [ ] check for new mails after switching to online mode again
  • [ ] figure out what is wrong with calDav calendars

kkapsner avatar Apr 16 '23 08:04 kkapsner

CalDav calenders actually do work for me, though they don't sync after startup.

johannes-hafner avatar Apr 16 '23 09:04 johannes-hafner

I seem to have the same Issue... tried to work around with autotype but it does not work for me since KeePassXC is not regonizing the window title of the popup promt window (to enter master PW).... once opened the connection is fine.

yoshi-12321 avatar Aug 27 '23 20:08 yoshi-12321

I did not have time to work on this for a long time... but my schedule should allow some progress on it soon hopefully.

kkapsner avatar Mar 27 '24 16:03 kkapsner