<?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>Postfix &#8211; Tjitjing Blog</title>
	<atom:link href="http://localhost/index.php/category/postfix-2/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>Tue, 28 Feb 2012 11:13:46 +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>OpenDKIM: error loading key `default._domainkey.mydomain.com&#8217;</title>
		<link>https://blog.tjitjing.com/index.php/2012/02/opendkim-error-loading-key-default-_domainkey-mydomain-com.html</link>
					<comments>https://blog.tjitjing.com/index.php/2012/02/opendkim-error-loading-key-default-_domainkey-mydomain-com.html#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Tue, 28 Feb 2012 11:13:46 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opendkim]]></category>
		<category><![CDATA[postix]]></category>
		<guid isPermaLink="false">http://blog.tjitjing.com/?p=510</guid>

					<description><![CDATA[I have been pulling my hair with getting OpenDKIM to work on a Debian machine with Postfix. I have been changing my KeyTable, SigningTable, ExternalIgnoreList, InternalHosts files and references like a madman. I have kept getting errors like this in /var/log/mail.log [code]Feb 28 11:21:43 06-135-D2 opendkim[27826]: 5EADD532313: dkim_eom(): resource unavailable: d2i_PrivateKey_bio() failed Feb 28 11:24:00&#8230; <a class="more-link" href="https://blog.tjitjing.com/index.php/2012/02/opendkim-error-loading-key-default-_domainkey-mydomain-com.html">Continue reading <span class="screen-reader-text">OpenDKIM: error loading key `default._domainkey.mydomain.com&#8217;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I have been pulling my hair with getting <a href="http://opendkim.org/" target="_blank" rel="noopener noreferrer">OpenDKIM</a> to work on a Debian machine with Postfix. I have been changing my KeyTable, SigningTable, ExternalIgnoreList, InternalHosts files and references like a madman.</p>
<p>I have kept getting errors like this in /var/log/mail.log</p>
<p>[code]Feb 28 11:21:43 06-135-D2 opendkim[27826]: 5EADD532313: dkim_eom(): resource unavailable: d2i_PrivateKey_bio() failed</p>
<p>Feb 28 11:24:00 06-135-D2 opendkim[27955]: D2560532313 error loading key `default._domainkey.mydomain.com'[/code]</p>
<p>Unfortunately OpenDKIM does not give more info than this and Googling did not provide many hints mor than possibly being a directory access problem. I checked directory and file access and realized that the key file was only readable by root.</p>
<p>[code]-rw&#8212;&#8212;- 1 root root 891 Feb 28 00:14 default.private[/code]</p>
<h2><strong>Testing Permissions<br />
(you can skip straight to Solution below)</strong></h2>
<p><em>[Edit: Renamed this part from &#8220;Solution&#8221; to &#8220;Testing Permissions&#8221; and added a better Solution below. Thanks to Andreas Schultze on the <a href="http://lists.opendkim.org/" target="_blank" rel="noopener noreferrer">OpenDKIM mailing list</a> for getting me on the right track to finding the correct solution]</em></p>
<p>As I used <a href="http://www.opendkim.org/opendkim-genkey.8.html" target="_blank" rel="noopener noreferrer">opendkim-genkey</a> to generate my key I would have thought permissions would be set ok from the start but I anyway tried doing <a href="http://www.thinkplexx.com/learn/article/unix/command/chmod-permissions-flags-explained-600-0600-700-777-100-etc" target="_blank" rel="noopener noreferrer">chmod </a>644 on the key file</p>
<p>[code]chmod 644 default.private[/code]<br />
[code]-rw-r&#8211;r&#8211; 1 root root 891 Feb 28 00:14 default.private[/code]</p>
<p><strong>And finally &#8211; success!<br />
</strong>In /var/log/mail.log:</p>
<p>[code]Feb 28 11:30:28 06-135-D2 opendkim[27955]: 5E811532313 &quot;DKIM-Signature&quot; header added[/code]</p>
<p>To me it seems a little unsecure to do chmod 644 on the file as this means anyone with access to the system can read the private key. <del>In my case I consider my system secure as it is only used for SMTP/Postfix so I am happy that is working.</del><br />
<del> <em></em></del></p>
<p><del>As I am all new to Debian, OpenDKIM and Postfix (The last time I touched Unix was when I worked with IBM&#8217;s AIX on their RS/6000 systems in the early 90s&#8230;) so I would be happy to hear any thoughts on this.</del></p>
<h2>Solution</h2>
<p>To set permissions to allow OpenDKIM but no unauthorized users to access the private key, change owner of the private key file to user and group opendkim with the following command:</p>
<p>[code]chown opendkim:opendkim default.private[/code]</p>
<p>(To check what user opendkim is running as, check the running processes once you have started opendkim: ps -f -A<br />
This command shows what groups the user opendkim belongs to: group opendkim)</p>
<p>Maybe this is fixed to set file permissions correctly in a later version of opendkim-genkey, I am running the old <a href="http://packages.debian.org/source/squeeze/opendkim" target="_blank" rel="noopener noreferrer">2.0.1 apt-get package</a> that is currently available for Debian.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.tjitjing.com/index.php/2012/02/opendkim-error-loading-key-default-_domainkey-mydomain-com.html/feed</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
	</channel>
</rss>
