<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7094179091483884850</id><updated>2024-09-12T03:55:55.543+05:30</updated><title type='text'>DomainKeys with Sendmail</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sendmail-domainkeys.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7094179091483884850/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sendmail-domainkeys.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Manoj K Samtani</name><uri>http://www.blogger.com/profile/10523064467243501756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7094179091483884850.post-4267944048860631043</id><published>2008-05-01T12:12:00.001+05:30</published><updated>2011-03-09T15:35:05.752+05:30</updated><title type='text'>Domain Keys With Sendmail</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;Hi All,&lt;br /&gt;
&lt;br /&gt;
I want to share something with of you. In previous days I was facing problems with my mail server. The problem was sometimes mails were going into the spam/bulk folder of yahoo and gmail sites. Then I found that it is domain keys problems.&lt;br /&gt;
Actually the Domain keys are the pair of ssl keys where private keys is to be placed on mail server and public keys placed in DNS with &lt;span style=&quot;font-weight: bold;&quot;&gt;txt&lt;/span&gt; record, which tells other servers that the mail is coming through authenticated mail server.&lt;br /&gt;
&lt;br /&gt;
Required Packages&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;Sendmail full package like sendmail, sendmail-devel etc..&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;(should be 8.13 or above version)&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;OpenSSL&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;SASL Packages&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Download the Package of dk-milter (dk-milter-1.0.0.tar.gz)&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;tar zxvf dk-milter-1.0.0.tar.gz&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;cd dk-milter-1.0.0&lt;br /&gt;
cd devtools/Site&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;and add/modify the following lines to &lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;site.config.m4&lt;br /&gt;
APPENDDEF(`conf_sendmail_ENVDEF&#39;, `-DMILTER&#39;)&lt;br /&gt;
APPENDDEF(`confENVDEF&#39;,`-DSASL -DSTARTTLS&#39;)&lt;br /&gt;
APPENDDEF(`confLIBS&#39;, `-lsasl -lssl -lcrypto&#39;)&lt;br /&gt;
APPENDDEF(`confINCDIRS&#39;, `-I/usr/local/ssl/include &#39;)&lt;br /&gt;
APPENDDEF(`confLIBDIRS&#39;, `-L/usr/local/ssl/lib &#39;)&lt;br /&gt;
APPENDDEF(`confENVDEF&#39;, `-D_FFR_ANTICIPATE_SENDMAIL_MUNGE &#39;)&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;Add the following lines to dk-milter-1.0.0/dk-filter/Makefile.m4&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #330099; font-family: trebuchet ms; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt;APPENDDEF(`confLIBS&#39;, `-lssl -lcrypto&#39;)&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #330099; font-family: trebuchet ms; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt; dnl Enable and edit these paths as per your configuration:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #330099; font-family: trebuchet ms; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 100%;&quot;&gt; APPENDDEF(`confINCDIRS&#39;, `-I/usr/local/ssl/include &#39;)&lt;br /&gt;
APPENDDEF(`confLIBDIRS&#39;, `-L/usr/local/ssl/lib &#39;)&lt;br /&gt;
bldPUSH_SMLIB(`dk&#39;)&lt;br /&gt;
APPENDDEF(`confINCDIRS&#39;, `-I../libdk/ &#39;)&lt;br /&gt;
bldPUSH_SMLIB(`sm&#39;)&lt;br /&gt;
APPENDDEF(`confINCDIRS&#39;, `-I/usr/local/sendmail/include&#39;)&lt;br /&gt;
APPENDDEF(`confLIBDIRS&#39;, `-L/usr/local/sendmail/libmilter&#39;)&lt;br /&gt;
APPENDDEF(`confLIBDIRS&#39;, `-L/usr/local/sendmail/libsm&#39;)&lt;br /&gt;
APPENDDEF(`confLIBDIRS&#39;, `-L/usr/local/sendmail/libsmdb&#39;)&lt;br /&gt;
APPENDDEF(`confLIBDIRS&#39;, `-L/usr/local/sendmail/libsmutil&#39;)&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;And add the following line(s) to sendmail.mc&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;INPUT_MAIL_FILTER(`dk-filter&#39;, `S=inet:5000@localhost&#39;)&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;dk-filter is domain key filter and 5000 is port on which dk-filter daemon will listen...&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
Then goto the &lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;dk-milter-1.0.0&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt; directory and run the following commands&lt;br /&gt;
1) ./Build&lt;br /&gt;
2) ./Build install&lt;br /&gt;
&lt;br /&gt;
Now create servers public/private key pair for the domain using the following command:&lt;br /&gt;
1) openssl genrsa -out rsa.private 1024&lt;br /&gt;
2) openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;Now change private key name to like test.com_key.pem&lt;br /&gt;
&lt;br /&gt;
Now time to DNS TXT record entry with public key&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;mail._domainkey.test.com. 1D IN TXT &quot;k=rsa; t=y;&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;p=MHwwDQYJKoZIhvcNAQEBBQADawAwaA&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;JhAJUf/A69N7tYPcoursysqYFzBl3+yzCCUsNQA&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;Y6TIcD02OEix1xETOOubJ1Z5i7UrR3E36aEeeH&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;A9tdDu1P+xvQ6PoQEXeevGWfs61j4lVRQErx4K&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;m+KKcqja6nSgZbflQIDAQAB&quot;&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Replace test.com with your domain, and *mail* in the DNS record *mail*._domainkey.test.com. is selector to  select the key.&lt;br /&gt;
&lt;br /&gt;
Create a user for dk-milter like dkuser and run the following command to start dk-milter for your server.&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;dk-filter -l -p inet:5000@localhost -c nofws -d test.com -D -H -s&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%; font-weight: bold;&quot;&gt;/usr/share/ssl/private/test.com_key.pem -S mail -u dkuser -m MTA&lt;/span&gt;&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
restart sendmail service.&lt;br /&gt;
&lt;br /&gt;
Send mail to any Yahoo!/GMail ID and check to see whether the&lt;br /&gt;
authentication-results header shows result as pass or fail.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #330099; font-family: &#39;trebuchet ms&#39;; font-size: 100%;&quot;&gt;-----&lt;br /&gt;
Manoj&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sendmail-domainkeys.blogspot.com/feeds/4267944048860631043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7094179091483884850/4267944048860631043' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7094179091483884850/posts/default/4267944048860631043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7094179091483884850/posts/default/4267944048860631043'/><link rel='alternate' type='text/html' href='http://sendmail-domainkeys.blogspot.com/2008/04/domain-keys-with-sendmail.html' title='Domain Keys With Sendmail'/><author><name>Manoj K Samtani</name><uri>http://www.blogger.com/profile/10523064467243501756</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>