Skip to main content

DKIM Secure mail flow

#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

Comments

Popular posts from this blog

fatal: scan_dir_push: open directory defer: Permission denied

problem:- Nov 7 18:24:18 linuxxf postfix-archive/postsuper[20555]: fatal: scan_dir_push: open directory defer: Permission denied Nov 7 18:24:19 linuxxf postfix-archive/postfix-script: fatal: Postfix integrity check failed! Nov 7 18:28:26 linuxxf postfix-archive/postsuper[21162]: fatal: scan_dir_push: open directory defer: Permission denied Nov 7 18:29:57 linuxxf postfix-archive/postsuper[21334]: fatal: scan_dir_push: open directory defer: Permission denied soloution:- To correct queues that were created outside of Postfix: postfix -c /etc/postfix-archive set-permissions
hi friends I am Brijesh singh and I am Linux system administration,I can solve your linux problem please and qmail and ldap related problem.please update your own linux problem and you have any please share with me.

we changed in transport file and when we reload file then postfix not starting

when we change in transport file and reload the file then postfix not starting. maillog:- Dec 7 15:54:37 mailxf2RelayServer postfix-out/postfix-script: fatal: Postfix integrity check failed! Dec 7 16:05:10 mailxf2RelayServer postfix-out/postfix-script: fatal: the Postfix mail system is not running Dec 7 16:05:10 mailxf2RelayServer postfix-out/postsuper[21423]: fatal: scan_dir_push: open directory bounce/A/A: Not a directory Dec 7 16:05:11 mailxf2RelayServer postfix-out/postfix-script: fatal: Postfix integrity check failed! [brijesh@mailxf2RelayServer ~]$ sol:- rm -r /var/spool/postfix-out/bounce/A /etc/init.d/postfix-out start