Skip to content

Commit 8540a17

Browse files
committed
Add script to add DKIM records for a domain
1 parent 6b63e7c commit 8540a17

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

create_dkim_records.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
source config.sh
3+
echo "Enter domain:"
4+
read DOMAIN
5+
cd /etc/opendkim/keys/
6+
mkdir "$DOMAIN"
7+
cd "$DOMAIN"
8+
opendkim-genkey -t -s "$DKIM_SELECTOR" -d "$DOMAIN"
9+
chown -R opendkim:opendkim .
10+
11+
echo "${DKIM_SELECTOR}._domainkey.${DOMAIN} ${DOMAIN}:${DKIM_SELECTOR}:/etc/opendkim/keys/${DOMAIN}/${DKIM_SELECTOR}.private" >> /etc/opendkim/KeyTable
12+
13+
echo "*@${DOMAIN} ${DKIM_SELECTOR}._domainkey.${DOMAIN}" >> /etc/opendkim/SigningTable
14+
15+
service opendkim reload
16+
17+
cat /etc/opendkim/keys/${DOMAIN}/${DKIM_SELECTOR}.txt

0 commit comments

Comments
 (0)