summaryrefslogtreecommitdiff
path: root/dkim/update
blob: 9459d55f5533545b15848177ebd3288a24e2d216 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/rc -ex

# This script combines other scripts in this directory to automatically
# generate keypairs and reconfigure relevant servers to use them

selector  = `{date +%Y%m%d}
dkimfiles = `{dkim/mkcert $selector}
rsapriv   = $dkimfiles(1)
rsatxt    = $dkimfiles(2)
edpriv    = $dkimfiles(3)
edtxt     = $dkimfiles(4)
domain    = $1
zonefile  = $2

if (test $#* -gt 2) {
	echo 'usage: dkim/update [domain] [zonefile]' >[1=2]
	exit 2
}

dkim/reconfig-smtpd $rsapriv $edpriv $domain
dkim/reconfig-dns   $rsatxt  $edtxt  $selector $domain $zonefile
dkim/purge