Add Gerrit email account and send-email configuration
We'll have to store Gerrit's email credentials in plain text. Protecting
from outside connections using these in case they'd ever leak is tricky.
We match the account `gerrit@...` in `user.access` and then the local IP
address of the gerrit container in `gerrit-client.access`, only allowing
authenticated users (`permit_sasl_authenticated`) from this IP.
Alternatively, we could use `permit` which would allow the whole gerrit
container to send emails from `gerrit@...` without login. Then the setup
would also allow more efficient, plain-text communication between Gerrit
and Postfix. The password would still be needed to login to IMAP (assu-
ming no further, invasive changes).
diff --git a/mail/config/postfix-main.cf b/mail/config/postfix-main.cf
new file mode 100644
index 0000000..378644a
--- /dev/null
+++ b/mail/config/postfix-main.cf
@@ -0,0 +1,3 @@
+gerrit_sender_check = check_client_access hash:/tmp/docker-mailserver/gerrit-client.access, reject
+smtpd_restriction_classes = gerrit_sender_check
+dms_smtpd_sender_restrictions = check_sender_access hash:/tmp/docker-mailserver/user.access, permit_sasl_authenticated, permit_mynetworks, reject_unknown_sender_domain