<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DKIM &#8211; Tjitjing Blog</title>
	<atom:link href="http://localhost/index.php/tag/dkim/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.tjitjing.com/</link>
	<description>This is my blog on technology related stuff and on occation other things too...</description>
	<lastBuildDate>Mon, 12 Mar 2012 13:58:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.16</generator>
	<item>
		<title>Guide to Install OpenDKIM for multiple domains with Postfix and Debian</title>
		<link>https://blog.tjitjing.com/index.php/2012/03/guide-to-install-opendkim-for-multiple-domains-with-postfix-and-debian.html</link>
					<comments>https://blog.tjitjing.com/index.php/2012/03/guide-to-install-opendkim-for-multiple-domains-with-postfix-and-debian.html#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Mon, 12 Mar 2012 13:58:26 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[DKIM]]></category>
		<category><![CDATA[opendkim]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">http://blog.tjitjing.com/?p=505</guid>

					<description><![CDATA[This is a guide to installing OpenDKIM for multiple domains on a Postfix-installtion on Debian. I tried some other guides but kept running into problems, so this is how I did it. Among others, Google Gmail and Yahoo mail check your email for a DKIM signature. Install and Configure OpenDKIM 1. Install OpenDKIM [code]apt-get install&#8230; <a class="more-link" href="https://blog.tjitjing.com/index.php/2012/03/guide-to-install-opendkim-for-multiple-domains-with-postfix-and-debian.html">Continue reading <span class="screen-reader-text">Guide to Install OpenDKIM for multiple domains with Postfix and Debian</span></a>]]></description>
										<content:encoded><![CDATA[<p>This is a guide to installing OpenDKIM for multiple domains on a Postfix-installtion on Debian. I tried some other guides but kept running into problems, so this is how I did it.</p>
<p>Among others, Google Gmail and Yahoo mail check your email for a DKIM signature.</p>
<h2>Install and Configure OpenDKIM</h2>
<p><strong>1. Install OpenDKIM</strong></p>
<p>[code]apt-get install opendkim[/code]</p>
<p>Comment: This will install the <a href="http://packages.debian.org/source/squeeze/opendkim" target="_blank" rel="noopener noreferrer">latest available stable Debian packaged version of OpenDKIM</a> which is currently 2.0.1. This version is already a couple of years old (2010).<br />
If you know how/want to compile sources yourself, then the <a href="http://sourceforge.net/projects/opendkim/files/" target="_blank" rel="noopener noreferrer">latest version</a> is 2.4.3 (and 2.5.0 is right around the corner)</p>
<p><strong>2. Edit the OpenDKIM config file</strong></p>
<p>[code]nano /etc/opendkim.conf[/code]</p>
<p>Add these rows:</p>
<p>[code]<br />
KeyTable           /etc/opendkim/KeyTable<br />
SigningTable       /etc/opendkim/SigningTable<br />
ExternalIgnoreList /etc/opendkim/TrustedHosts<br />
InternalHosts      /etc/opendkim/TrustedHosts<br />
[/code]</p>
<p>Note: If you run multiple instances of Postfix you need to add this to the opendkim.conf for each instance (or the ones you want to use opendkim)</p>
<p><strong>3.  Edit /etc/opendkim/TrustedHosts</strong></p>
<p>[code]nano /etc/opendkim/TrustedHosts[/code]</p>
<p>Add domains, hostnames and/or ip&#8217;s that should be handled by OpenDKIM. Don&#8217;t forget localhost.</p>
<p>[code]<br />
127.0.0.1<br />
localhost<br />
x.253.204.64<br />
x.253.204.32/27<br />
[/code]</p>
<p><strong>4. Edit /etc/default/opendkim</strong></p>
<p>[code]nano /etc/default/opendkim[/code]</p>
<p>Uncomment this row:</p>
<p>[code]SOCKET=&quot;inet:12345@localhost&quot; # listen on loopback on port 12345[/code]</p>
<h2>Generate keys</h2>
<p>Repeat these steps to generate keys for each domain you will send email from. Replace mydomain.com with your domain name in examples below.</p>
<p><strong>1. Generate key</strong></p>
<p>[code]<br />
mkdir -p /etc/opendkim/keys/mydomain.com<br />
cd /etc/opendkim/keys/mydomain.com<br />
opendkim-genkey -r -d mydomain.com<br />
chown opendkim:opendkim default.private<br />
[/code]</p>
<p><strong>2. Add domain to KeyTable /etc/opendkim/KeyTable</strong></p>
<p>[code]nano /etc/opendkim/KeyTable[/code]</p>
<p>Add line:</p>
<p>[code]default._domainkey.mydomain.com mydomain.com:default:/etc/opendkim/keys/mydomain.com/default.private[/code]</p>
<p><strong>3. Add domain to SigningTable /etc/opendkim/SigningTable</strong></p>
<p>[code]nano /etc/opendkim/SigningTable[/code]</p>
<p>Add line:</p>
<p>[code]mydomain.com default._domainkey.mydomain.com[/code]</p>
<p>Note that in OpenDKIM 2.0.1 domain names are case sensitive (supposed to be fixed from 2.3.1 but I have not tested).<br />
This means that in the above example an email from info@mydomain.com will be signed, but an email from info@MyDomain.com will not be signed. The workaround is to add one extra entry for MyDomain.com to SigningTable.</p>
<p><strong>4. Add to DKIM public key to DNS</strong></p>
<p>Add an entry for the public key to the DNS server you are using for your domain. You find the public key here:</p>
<p>[code]cat /etc/opendkim/keys/mydomain.com/default.txt[/code]</p>
<h2>Start OpenDKIM</h2>
<p>[code]/etc/init.d/opendkim start[/code]</p>
<p>In the future, if you make any changes to configuration remember to restart: /etc/init.d/opendkim restart</p>
<h2>Configure and Restart Postifx</h2>
<p><strong>1. Configure Postfix</strong></p>
<p>[code]nano /etc/postfix/main.cf[/code]</p>
<p>Add or edit these lines:</p>
<p>[code]<br />
milter_default_action = accept<br />
milter_protocol = 6<br />
smtpd_milters = inet:localhost:12345<br />
non_smtpd_milters = inet:localhost:12345<br />
[/code]</p>
<p><strong>2. Restart Postfix</strong></p>
<p>[code]/etc/init.d/postfix reload[/code]</p>
<p>Or in my case as i run postfix multi instance:</p>
<p>[code]/etc/init.d/postfix-multi restart[/code]</p>
<h2>Other</h2>
<p><strong>Log files are in the /var/log directory</strong></p>
<p>[code]<br />
cat /var/log/mail.log<br />
cat /var/log/mail.warn<br />
cat /var/log/mail.err<br />
[/code]</p>
<p><strong>Log more info</strong></p>
<p>[code]nano /etc/opendkim.conf[/code]</p>
<p>Add this line:</p>
<p>[code]LogWhy yes[/code]</p>
<p><strong>Credits</strong></p>
<p>Guides that have helped me along the way: <a href="http://www.debiantutorials.com/setup-domainkeys-identified-mail-dkim-in-postfix/" target="_blank" rel="noopener noreferrer">Debian Tutorials</a> and <a href="http://syslog.tv/2010/01/11/dkim-on-debian-with-postfix/" target="_blank" rel="noopener noreferrer">Syslog</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.tjitjing.com/index.php/2012/03/guide-to-install-opendkim-for-multiple-domains-with-postfix-and-debian.html/feed</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
			</item>
	</channel>
</rss>
