-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_dkim.sh
executable file
·40 lines (33 loc) · 1.15 KB
/
setup_dkim.sh
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
#!/bin/bash
# Configurar OpenDKIM
cat > /etc/opendkim.conf << 'EOL'
Syslog yes
UMask 002
Domain useblazee.com.br
KeyFile /etc/dkim/private.key
Selector default
Socket inet:8891@localhost
PidFile /var/run/opendkim/opendkim.pid
TrustAnchorFile /usr/share/dns/root.key
UserID opendkim:opendkim
EOL
# Criar diretório para chaves DKIM
mkdir -p /etc/dkim
chmod 755 /etc/dkim
# Gerar novas chaves DKIM
opendkim-genkey -b 2048 -d useblazee.com.br -D /etc/dkim -s default -v
# Ajustar permissões
chown -R opendkim:opendkim /etc/dkim
chmod 600 /etc/dkim/private.key
# Configurar Postfix para usar OpenDKIM
postconf -e "milter_protocol = 2"
postconf -e "milter_default_action = accept"
postconf -e "smtpd_milters = inet:localhost:8891"
postconf -e "non_smtpd_milters = inet:localhost:8891"
# Reiniciar serviços
systemctl restart opendkim
systemctl restart postfix
# Mostrar a chave pública para configurar no DNS
echo "Configure o seguinte registro TXT no DNS:"
echo "default._domainkey.useblazee.com.br TXT"
cat /etc/dkim/default.txt