Dovecot GSSAPI: enable the mechanism and authenticate Thunderbird by ticket #291
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos#291
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #266. Enable the GSSAPI mechanism in Dovecot and let Thunderbird on
nbauthenticate to IMAP with the Kerberos ticket from the desktop login.This is a deliberate experiment with known limits
Recorded so nobody later mistakes it for a general SSO story. All three are accepted:
fw.dominik.polakovics@cloonar.comcan use it;office@cloonar.com,dominik@superbros.tv,office@scana11y.comanddominik.polakovics@epicenter.workscannot. A second mailbox would need Dovecot's master-user/authzid mechanism — out of scope.authMethodis one value per account, so an account set to GSSAPI fails outright off-VPN rather than reverting to password.Because of the third point, do not change the primary account. Use one of the existing secondary Thunderbird profiles (
cloonar/work) so everyday mail is untouched.Scope —
hosts/mail/modules/dovecot.nixauth_mechanisms = plain gssapi. Keepplain— the other four accounts, every other tenant, and all off-VPN access depend on it.auth_krb5_keytabpointing at a keytab under/var/lib/dovecot/, owned by the dovecot user, mode 0400. It sits inside borg's wholesale/varsweep.dominik.polakovics@CLOONAR.COMlowercases todominik.polakovics@cloonar.com, exactly themailattribute thatuser_filterkeys on (dovecot.nix:18). Check Dovecot 2.3's defaultauth_username_formatbefore setting it — it may already be%Lu, making the mapping free. If you do set it, note that it applies toplainas well; harmless, since those usernames are already lowercase email.Nothing about the LDAP passdb,
auth_bind, oruserPasswordchanges. Kerberos stays additive per ADR-0022.The service principal — hostname matters
The SPN derives from the host the client connects to. Thunderbird's IMAP host is
imap.cloonar.com(hosts/nb/users/dominik.nix:410):Not
imap/mail.cloonar.com. SMTP is a different host entirely (mail.cloonar.com:587) and would need its ownsmtp/principal plus Postfix SASL changes — out of scope; sending keeps its stored password.Out of scope
userPasswordHuman steps
On
mail— it is the KDC, so the keytab is generated locally and there is nothing for sops:ktaddonce only — a second run rotates the key and silently invalidates the keytab.On
nb, in a secondary Thunderbird profile only: set that account's auth method to Kerberos/GSSAPI (authMethod = 5).Verification
scripts/pre-commitdry-buildsmail.Human, after deploy:
systemctl status dovecot2clean — agssapimechanism Dovecot cannot provide is fatal at startup, so a clean start is itself the first signal.dominik.polakovicssession with a valid TGT, the test profile authenticates with no password prompt.klistshows a service ticket forimap/imap.cloonar.com@CLOONAR.COM.Rollback is reverting the commit; the keytab and principal can stay, harmless, or be removed with
delprinc.