(() => { // Encryption key management (desktop). Hidden where the platform has no key store yet. const pgpKeyMailUi = window.epMailFeatures.mail; const selectPgpKeyUi = pgpKeyMailUi.select; const selectAllPgpKeyUi = pgpKeyMailUi.selectAll; const escapePgpKeyUi = pgpKeyMailUi.escapeHtml; const toastPgpKeyUi = pgpKeyMailUi.toast; function pgpAvailable() { return Boolean(window.daybreakMail?.pgp); } async function saveAndroidPgpExport(label, value) { if (window.daybreakMail?.pgp?.platform !== 'android' || typeof value !== 'string') return value; const warning = /private|revocation/i.test(label) ? ' This contains secret key material; keep it private.' : ''; if (!confirm(`Copy this ${label.toLowerCase()} to the clipboard?${warning}`)) return { canceled: true }; if (navigator.clipboard?.writeText) await navigator.clipboard.writeText(value); else if (prompt(`Copy this ${label.toLowerCase()}:`, value) === null) return { canceled: true }; return { saved: true }; } function openEncryptionKeys() { const root = selectPgpKeyUi('#modal-root'); const account = window.epMailFeatures.mail.connectedAccount || {}; const androidPgp = window.daybreakMail?.pgp?.platform === 'android'; const serverSettings = `
Servers are disabled by default. Enable the servers you want to use; searching checks every enabled server, which can learn which email address you searched for. Discovered keys remain unverified until you check their fingerprints independently.
Publishing targets only the selected enabled server. ep-mail names the destination and asks for native confirmation before uploading.