#yum install *dkim -y
#yum install libopendkim-devel
#grep opendkim /etc/passwd /etc/shadow /etc/group
Output:-
/etc/passwd:opendkim:x:498:498:OpenDKIM Milter:/var/run/opendkim:/sbin/nologin
/etc/shadow:opendkim:!!:17410::::::
/etc/group:mail:x:12:mail,postfix,opendkim
/etc/group:opendkim:x:498:
#ls -l /etc/opendkim /var/run/opendkim/
Output:-
drwxr-x--- 2 opendkim opendkim 4096 Dec 21 2016 keys
-rw-r----- 1 opendkim opendkim 339 Dec 21 2016 KeyTable
-rw-r----- 1 opendkim opendkim 1221 Dec 21 2016 SigningTable
-rw-r----- 1 opendkim opendkim 378 Dec 21 2016 TrustedHosts
##generate Key for Singning
# mkdir /etc/opendkim/keys/test.org
#cd /etc/opendkim/keys/test.org
#opendkim-genkey -d test.org -s groots
#chmod 640 groots.private
##Create Key Table file
vi /etc/opendkim/KeyTable
groots._domainkey.test.org test.org:groots:/etc/opendkim/keys/test.org/groots.private
##Create Singning Table file
cat /etc/opendkim/SigningTable
*@test.org groots._domainkey.test.org
###Create TrustedHosts File
#cat /etc/opendkim/TrustedHosts
#vi /etc/opendkim/TrustedHosts
127.0.0.1
test.org
mail.test.org
172.31.8.0/16
##configure dkim
vi /etc/opendkim.conf
Canonicalization relaxed/relaxed
Domain test.org
Selector groots
MinimumKeyBits 1024
KeyFile /etc/opendkim/keys/test.org/groots.private
KeyTable /etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
Mode sv
Socket inet:8891@localhost
UserID opendkim:opendkim
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
InternalHosts refile:/etc/opendkim/TrustedHosts
###Edit postfix
#vi /etc/postfix/main.cf
milter_default_action = accept
smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = $smtpd_milters
#postmap /etc/postfix/main.cf
#/etc/init.d/opendkim start
#/etc/init.d/postfix restart
#chkconfig opendkim on
#netstat -nat |grep 8891
###check public key
cat /etc/opendkim/keys/test.org/groots.txt
###Add TXT record in DNS
TXT hosts:- groots._domainkey
TXT Value:- v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBoNeFZhSMzmiZj0yriz+JOt+rgbUJzC3m2hbHa4xISV1EjHgsIh06doTz3tYg+T7mw+SukupUvgeCH/1TNppQazhGRSbl7KG7nV+YdpAALP8wuQmP9NJuhKiPQQ7S70G1bm8hNcGSe0iMF02e+IRj9B3S4BD5n+MsckJ/yVhE7QIDAQAB
TTL:- 1/2 Hour
#DMARC
TXT _dmarc v=DMARC1; p=none; sp=none; pct=100
#yum install libopendkim-devel
#grep opendkim /etc/passwd /etc/shadow /etc/group
Output:-
/etc/passwd:opendkim:x:498:498:OpenDKIM Milter:/var/run/opendkim:/sbin/nologin
/etc/shadow:opendkim:!!:17410::::::
/etc/group:mail:x:12:mail,postfix,opendkim
/etc/group:opendkim:x:498:
#ls -l /etc/opendkim /var/run/opendkim/
Output:-
drwxr-x--- 2 opendkim opendkim 4096 Dec 21 2016 keys
-rw-r----- 1 opendkim opendkim 339 Dec 21 2016 KeyTable
-rw-r----- 1 opendkim opendkim 1221 Dec 21 2016 SigningTable
-rw-r----- 1 opendkim opendkim 378 Dec 21 2016 TrustedHosts
##generate Key for Singning
# mkdir /etc/opendkim/keys/test.org
#cd /etc/opendkim/keys/test.org
#opendkim-genkey -d test.org -s groots
#chmod 640 groots.private
##Create Key Table file
vi /etc/opendkim/KeyTable
groots._domainkey.test.org test.org:groots:/etc/opendkim/keys/test.org/groots.private
##Create Singning Table file
cat /etc/opendkim/SigningTable
*@test.org groots._domainkey.test.org
###Create TrustedHosts File
#cat /etc/opendkim/TrustedHosts
#vi /etc/opendkim/TrustedHosts
127.0.0.1
test.org
mail.test.org
172.31.8.0/16
##configure dkim
vi /etc/opendkim.conf
Canonicalization relaxed/relaxed
Domain test.org
Selector groots
MinimumKeyBits 1024
KeyFile /etc/opendkim/keys/test.org/groots.private
KeyTable /etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
Mode sv
Socket inet:8891@localhost
UserID opendkim:opendkim
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
InternalHosts refile:/etc/opendkim/TrustedHosts
###Edit postfix
#vi /etc/postfix/main.cf
milter_default_action = accept
smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = $smtpd_milters
#postmap /etc/postfix/main.cf
#/etc/init.d/opendkim start
#/etc/init.d/postfix restart
#chkconfig opendkim on
#netstat -nat |grep 8891
###check public key
cat /etc/opendkim/keys/test.org/groots.txt
###Add TXT record in DNS
TXT hosts:- groots._domainkey
TXT Value:- v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBoNeFZhSMzmiZj0yriz+JOt+rgbUJzC3m2hbHa4xISV1EjHgsIh06doTz3tYg+T7mw+SukupUvgeCH/1TNppQazhGRSbl7KG7nV+YdpAALP8wuQmP9NJuhKiPQQ7S70G1bm8hNcGSe0iMF02e+IRj9B3S4BD5n+MsckJ/yVhE7QIDAQAB
TTL:- 1/2 Hour
#DMARC
TXT _dmarc v=DMARC1; p=none; sp=none; pct=100
Comments
Post a Comment