How to store imap password when using kmail

I created an imap account using kmail. It works fine and can receive emails.

The problem is that it keeps poping up a window asking for password to connect to my email account.

Some time ago I had to input the password everytime after I reboot. Now it becomes worse. It pops up window very frequently and keeps bugging me. Is there a way to store the password?

Not specific to kmail,
Buf I’ve found that what you describe happens because the stored password is incorrect.

I suggest you re-inspect your normal mail account settings.
Maybe your AD credentials (Password) changed. Enforced password policy may require frequent changes.
Although I haven’t tried specifically in kmail, normally you only need to pass your AD credentials in a way that’s acceptable to the Server, common syntax are one of the following when the app wasn’t written specifically to support an AD login

Domain\User:Password
User:Password@Domain

HTH,
TSU

Kmail stores its passwords in Kwallet; if you chose not to use this option, you will always have to put in the passwords, in the case of IMAP every time Kmail interrogates the server. As tsu2 says, if you have put in an incorrect password, Kmail will ask you to input the correct password and then pass that to Kwallet - but, if it is incorrect, it will again ask you next time to input the correct password.

Once everything is correct, you only have to input the Kwallet password when you log in; thereafter Kmail reads the password from Kwallet every time it needs to interrogate the server. Note that, with an IMAP account, Kmail will interrogate the server even if you have not opened Kmail and you will get notifications of new mail even if Kmail is not open.

Thanks for reply. I think my password is correct, because I can check for new mails and Kmail can receive them.

The other day my network is unstable, which causes Kmail asking for password each time I disconnect from the internet.

Maybe I’m not using kwallet for kmail. How do I enable this option? I’m not very familiar with kwallet and don’t know how to use it.

If you are not using Kwallet, I suggest you open the Kwallet Manager and then, in Settings>Configure wallet, ensure that Kwallet is enabled. I am not sure what will happen next because I have not done it this way but I suspect you will be asked to provide a password and that, when Kmail next runs, it may ask you whether you want to store your passwords in Kwallet. If it does not do that, there is an option in Kwallet Manager to set up access control for particular programs and I assume you can add Kmail to that.