I want the outgoing messages to be signed automatically, so 'Sign messages automatically' option is enabled in KMail's Settings/Configure_Kmail/Security/Composing section. In Settings/Configure_Kmail/Security/GnuPG_settings/GPG_Agent/Expire_Cached_Pins_after_N_second option is set to 260000 (over 3 days) and it is not honoured, after a few hours (in less then one day) I'm prompted again to type the GPG PIN, even if the machine is not rebooted or restrarted. Reproducible: Always Steps to Reproduce: 1. Set 'Expire_Cached_Pins_after_N_second' option large enough in KMails settings 2. Activate 'Sign messages automatically' option in KMails settings 3. Actual Results: GPG PIN is re-requested to type before the 'Expire_Cached_Pins_after_N_second' time elapses. Expected Results: No PIN re-request before the 'Expire_Cached_Pins_after_N_second' time elapses.
Look in ~/.gnupg/gpg-agent.conf do you see a line with default-cache-ttl 260000
I read that if you want to set a timeout larger than 2 hrs (7200) then you must also set max-cache-ttl so to test that, could you please edit .gnupg/gpg-agent.conf by hand and make sure you have the 2 lines: default-cache-ttl 260000 max-cache-ttl 260000 hopefully the default-cache-ttl line is already there. you may have to restart gpg after you edit that file, I don't recall. at worst, just logout and back in again.
Wait for infos
There was no 'default-cache-ttl' line in .gnupg/gpg-agent.conf by default. After adding the parameter, it seems to work, thanks.