Setting up DKIM-milter with sendmail
10:44 PMWhat is DKIM?
DomainKeys Identified Mail (DKIM) is a method for associating a domain name to an email message, thereby allowing a person, role, or organization to claim some responsibility for the message. The association is set up by means of a digital signature which can be validated by recipients. Responsibility is claimed by a signer by adding a DKIM-Signature: field to the message's header. The verifier recovers the signer's public key using the DNS, and then verifies that the signature matches the actual message's content.Enabling DKIM in Sendmail
- Generate a private key
openssl genrsa -out default . private 1024 |
- Generate a public key for this private key
openssl rsa -in default . private -pubout -out default . public -outform PEM |
---BEGIN PUBLIC KEY---
...
---END PUBLIC KEY---
It will be used to create a DNS TXT record. See next step.
- Create a DNS record of type TXT
TXT record name default ._domainkey TXT record value v=DKIM1; g=*; k=rsa; p=<content of default . public > |
- Install dkim-milter in Linux
yum install dkim-milter |
- Enable dkim-milter to run on start-up
chkconfig dkim-milter on |
- Move private key to appropriate location
mkdir /etc/dkim-milter/ mv default . private /etc/dkim-milter/ default chown dkim-milter.dkim-milter /etc/dkim-milter/ default |
- Add an entry to the keylist for dkim-milter to read
*:<domain.com>:/etc/dkim-milter/ default |
- Configure dkim-milter
Canonicalization relaxed/relaxed Domain domain.com KeyFile /etc/dkim-milter/ default Selector default Userid dkim-milter PeerList /etc/mail/dkim-milter/peerlist InternalHosts /etc/mail/dkim-milter/internalhosts |
/etc/mail/dkim-milter/peerlist can have list of hosts whose connections should be accepted without processing by dkim filter.
- Add dkim to sendmail.mc dd to sendmail.mc
INPUT_MAIL_FILTER(`dkim-filter
', `S=inet:8891@localhost'
)
- Restart dkim milter and sendmail
/etc/init.d/dkim-milter restart /etc/init.d/sendmail restart |
0 comments