Created
November 18, 2015 23:30
-
-
Save jhass/5a35270785ce5077ad02 to your computer and use it in GitHub Desktop.
VMM (http://vmm.localdomain.org/) DKIM configuration (only relevant parts shown)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo pacman -S opendkim | |
sudo cp /etc/opendkim/opendkim.conf{.sample,} | |
sudo mkdir /var/lib/dkim | |
sudo chown opendkim:mail /etc/opendkim/opendkim.conf /var/lib/dkim | |
sudo chmod 700 /var/lib/dkim | |
sudo chgrp mail /var/spool/postfix/private | |
sudo -u opendkim opendkim-genkey -D /var/lib/dkim -b 2048 -s mail | |
sudo usermod -a -G mail postfix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add | |
-o smtpd_milters=unix:private/opendkim | |
# to each of your mail submission smtpds (smtp inet, smtps inet, submission inet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Domain dsn:pgsql://opendkim:password@localhost/mailsys/table=opendkim_domains?keycol=domainname?datacol=domainname | |
KeyFile /var/lib/dkim/mail.private | |
Selector mail | |
Socket local:/var/spool/postfix/private/opendkim | |
UserID opendkim | |
UMask 0117 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# As superuser | |
CREATE USER opendkim WITH IN ROLE mailsys PASSWORD 'password'; | |
# As vmm | |
ALTER TABLE service_set ADD COLUMN dkim BOOLEAN NOT NULL DEFAULT true; | |
ALTER TABLE service_set DROP CONSTRAINT ukey_service_set; | |
ALTER TABLE service_set ADD CONSTRAINT ukey_service_set UNIQUE (smtp, pop3, imap, sieve, dkim); | |
INSERT INTO service_set(smtp, pop3, imap, sieve, dkim) | |
SELECT smtp, pop3, imap, sieve, false FROM service_set; | |
CREATE VIEW opendkim_domains AS | |
SELECT domainname | |
FROM domain_name | |
JOIN domain_data ON domain_name.gid = domain_data.gid | |
JOIN service_set ON service_set.ssid = domain_data.ssid | |
WHERE dkim = true; | |
GRANT SELECT ON opendkim_domains TO opendkim; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment