Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash -eux
source /etc/environment
function provision_dkim () {
docker exec mailindiehost_postfix_1 /add_domain.sh ${arg_u}
}
function configure_dns () {
domain_key=`cat /data/domains/mail.indie.host/opendkim/keys/${arg_u}/mail.txt | cut -d\" -f2 | sed 'N;s/\n//g' | sed 's/ //g'`
info "Configuring DNS."
arguments="&Command=namecheap.domains.dns.setHosts\
&DomainName=${arg_u}\
&SLD=$(SLD)\
&TLD=$(TLD)\
&HostName1=@\
&RecordType1=A\
&Address1=${IP}\
&HostName2=www\
&RecordType2=CNAME\
&Address2=${arg_u}\
&HostName3=mail\
&RecordType3=CNAME\
&Address3=${mail_hostname}\
&HostName4=@\
&RecordType4=MX\
&Address4=mail.${arg_u}\
&MXPref4=10\
&HostName5=@\
&RecordType5=TXT\
&Address5=v=spf1%20include:${mail_hostname}\
&HostName6=mail._domainkey\
&RecordType6=TXT\
&Address6=${domain_key}\
&HostName7=autoconfig\
&RecordType7=CNAME\
&Address7=autoconfig.`echo $mail_hostname | cut -d. -f2,3`\
&EmailType=mx"
call_API ${arguments}
}