File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 47
47
# Build the arguments
48
48
gen_args=" --restrict"
49
49
gen_args=" $gen_args --domain '$domain '"
50
- gen_args=" $gen_args --bits 1024 "
50
+ gen_args=" $gen_args --bits 2048 "
51
51
gen_args=" $gen_args --selector=$selector "
52
52
gen_args=" $gen_args --note='DKIM key for $hostname on $domain '"
53
53
@@ -72,7 +72,7 @@ if test -f "nsupdate-$selector.conf"; then
72
72
else
73
73
74
74
# Build arguments list
75
- ns_args=" -d $domain -F -M -u -T 86400 -o nsupdate-$selector .conf"
75
+ ns_args=" -d $domain -C hostmaster@ $domain -N 127.1.1.53 - F -M -u -T 86400 -o nsupdate-$selector .conf"
76
76
77
77
if ! opendkim-genzone $ns_args ; then
78
78
echo " DNS record generation failed, exiting"
86
86
chown opendkim:opendkim " /etc/opendkim/keys/$selector .private"
87
87
chmod 0600 " /etc/opendkim/keys/$selector .private"
88
88
89
- echo " Successfully created DNS record "
89
+ echo " Successfully created DNS update file "
90
90
91
91
fi
92
92
@@ -98,5 +98,16 @@ if ! nsupdate "nsupdate-$selector.conf"; then
98
98
99
99
fi
100
100
101
- echo " DNS update success."
101
+ echo " DNS record created."
102
+
103
+ cd /etc/opendkim
104
+
105
+ # Enforce the use of the new key in the configuration
106
+ last_year=$(( year - 1 ))
107
+
108
+ sed -i " s/$last_year /$year /g" keytable
109
+ sed -i " s/$last_year /$year /g" signingtable
110
+
111
+ systemctl restart opendkim
112
+
102
113
exit $SUCCESS
You can’t perform that action at this time.
0 commit comments