Sourcehut Mail
The Sourcehut software environment makes extensive use of email as a communication protocol.
Contents
Configuration
SMTP
To route outbound email (i.e. automated notifications), Sourcehut needs to run alongside some MTA.
If a mail server is running locally, a valid option is to connect without encryption or authentication. In the Sourcehut configuration file:
[mail] smtp-host=localhost smtp-port=25 smtp-from=root@localhost smtp-encryption=insecure smtp-auth=none
If encryption is necessary, try:
smtp-encryption=starttls
If authentication is necessary, try:
smtp-auth=plain smtp-user=myuser smtp-password=mypassword
PGP
Sourcehut requires a PGP key to send mail by SMTP. In the Sourcehut configuration file:
pgp-privkey=/etc/sr.ht/pgp.key pgp-pubkey=/etc/sr.ht/pgp.pubkey pgp-key-id=KEYID
The private key must be password-less. For instructions on exporting keys to files and removing passwords from keys, see GPG.
LMTP
For the todo.sr.ht-lmtp service to receive and process inbound mail, Sourcehut needs to run alongside some mail agent. LMTP is inherently a queue-less protocol, so either a MDA or MTA will be sufficient. Because an MTA is already necessary for administering Sourcehut, it's recommended to simply re-use it.
In the todo.sr.ht::mail section of the Sourcehut configuration file:
[todo.sr.ht::mail] sock=/tmp/todo.sr.ht-lmtp.sock sock-group=mtauser posting-domain=localhost.localdomain
As an example, if running Postfix as an MTA, set sock-group to postfix.