Version: EGroupware 26.10.20261003 (latest, Docker image, PHP 8.5.11), new JMAP mail UI
Problem
Since Autocrypt support was added to the new JMAP mail UI (recent 26.x releases), every send in the new mail compose takes 10 seconds longer than before. The time is spent in addressbook.addressbook_bo.ajax_get_pgp_keys, before the message is submitted.
Cause
MailJmap.sendNewEmail() calls buildAutocryptHeader() on every send (mail/js/jmap.ts). This calls ajax_get_pgp_keys with the sender’s own address.
If the sender has no PGP key in the addressbook (the normal case for most users), ajax_get_pgp_keys() falls back to addressbook_bo::get_pgp_keyserver().
get_pgp_keyserver() calls file_get_contents() on the hardcoded KEYSERVER = 'https://hkps.pool.sks-keyservers.net/...'. This pool was shut down in 2021 and its name no longer resolves. The request has no explicit timeout, so it waits for the DNS failure and then the connection timeout. We measured exactly 10.0 s, every time.
The lookup always finds nothing, so the mail goes out without an Autocrypt header anyway. The 10 s produce no benefit.
The same lookup also runs when a PGP-signed message is opened (signature verification, jmap.ts ~line 4105), so reading these messages is slowed as well.
nginx access log, 1-9 October: every ajax_get_pgp_keys request took between 9.4 and 10.1 s (2-25 per day)
From inside the container: gethostbyname('hkps.pool.sks-keyservers.net') takes 6-9 s to fail, and file_get_contents() fails after 10.0 s
Suggested fix
Remove the call to the public keyserver, or replace sks-keyservers.net with a live service (e.g. keys.openpgp.org or WKD). KEYSERVER_ADD and KEYSERVER_CA have the same problem.
Add a short timeout ('http' => ['timeout' => 2]) to the stream context.
Do not query any external keyserver for the sender’s own address in buildAutocryptHeader(): the addressbook is the only meaningful source for our own key.
Optionally, add a setting to disable PGP/Autocrypt lookups entirely.
Workaround we applied
extra_hosts: ["hkps.pool.sks-keyservers.net:127.0.0.1"] for the egroupware container in docker-compose.override.yml. The lookup now fails instantly.
Measured from our nginx log, request addressbook.addressbook_bo.ajax_get_pgp_keys:
before: 79 calls since 29 Sep, average 9.51 s, max 10.07 s
after: 7 calls so far, average 0.04 s, max 0.05 s
So the dead keyserver accounted for the full 10 s on every send. Having pgp_keyserver empty by default is exactly what we need.
One question: we run the Docker image egroupware/egroupware:latest (currently 26.10.20261003), updated nightly by Watchtower. The commit seems to be on master only for now. Will it be part of the next latest image, or should we wait for a backport / maintenance release? Just so we know when we can drop the workaround.
Thanks again for your support and for all the great work you put into EGroupware!