comparison mail.py @ 324:99c81fa0f2fc

add chat.bigasterisk.com dns and dkim
author drewp@bigasterisk.com
date Mon, 20 Jan 2025 14:09:37 -0800
parents c44677a25baf
children
comparison
equal deleted inserted replaced
323:7f6244802f97 324:99c81fa0f2fc
1 from pyinfra import host 1 from pyinfra import host
2 from pyinfra.operations import apt, files, server, systemd 2 from pyinfra.operations import apt, files, server, systemd
3 3
4 if host.name == 'prime': 4 if host.name == 'prime':
5 apt.packages(packages=['postfix', 'isync', 'opendkim', 'opendkim-tools']) 5 apt.packages(packages=['postfix', 'isync', 'opendkim', 'opendkim-tools'])
6 '''
7 per domain keygen:
8 prime(pts/4):~# mkdir /etc/opendkim/keys/chat.bigasterisk.com
9 prime(pts/4):~# opendkim-genkey -b 1024 -d chat.bigasterisk.com -D /etc/opendkim/keys/chat.bigasterisk.com -s default -v
10 opendkim-genkey: generating private key
11 opendkim-genkey: private key written to default.private
12 opendkim-genkey: extracting public key
13 opendkim-genkey: DNS TXT record written to default.txt
14 prime(pts/4):~# chown opendkim /etc/opendkim/keys/*/*
15 '''
6 16
7 files.template(src='templates/mail/opendkim-KeyTable.j2', dest='/etc/opendkim/KeyTable') 17 files.template(src='templates/mail/opendkim-KeyTable.j2', dest='/etc/opendkim/KeyTable')
8 files.template(src='templates/mail/opendkim-SigningTable.j2', dest='/etc/opendkim/SigningTable') 18 files.template(src='templates/mail/opendkim-SigningTable.j2', dest='/etc/opendkim/SigningTable')
9 files.template(src='templates/mail/opendkim-TrustedHosts.j2', dest='/etc/opendkim/TrustedHosts') 19 files.template(src='templates/mail/opendkim-TrustedHosts.j2', dest='/etc/opendkim/TrustedHosts')
10 files.template(src='templates/mail/opendkim.conf.j2', dest='/etc/opendkim.conf') 20 files.template(src='templates/mail/opendkim.conf.j2', dest='/etc/opendkim.conf')