<div class="markdown">
<p dir="auto">On 7 Sep 2013, at 22:13, Benny Kjær Nielsen wrote:</p>

<blockquote>
<p dir="auto">You can enable some related debug output from MailMate like this:</p>

<pre><code>defaults write com.freron.MailMate MmDebugSecurity -bool YES
</code></pre>

<p dir="auto">Then launch MailMate from the Terminal to see the output when MailMate tries to sign a message:</p>

<pre><code>/Applications/MailMate.app/Contents/MacOS/MailMate
</code></pre>

<p dir="auto">Most importantly, MailMate outputs the <code>gpg2</code> command with arguments. Based on that you might be able to reproduce the problem in a Terminal window without using MailMate.</p>
</blockquote>

<p dir="auto">Ok, that helped! At least I know now what the problem is.</p>

<p dir="auto">The command that MailMate executes is:</p>

<pre><code>gpg2 --no-verbose --batch --no-tty --openpgp --status-fd 2 --digest-algo SHA1 --textmode --armor --detach-sign --local-user "<…>"
</code></pre>

<p dir="auto">and the full error message is:</p>

<pre><code>Result: Failure
Output string (0): ""
Detail: [GNUPG:] USERID_HINT 9C791B1A2ADC63E5 Felix Kling <…>
Detail: [GNUPG:] NEED_PASSPHRASE 9C791B1A2ADC63E5 9C791B1A2ADC63E5 17 0
Detail: [GNUPG:] GOOD_PASSPHRASE
Detail: [GNUPG:] BEGIN_SIGNING H2
Detail: gpg: DSA key 2ADC63E5 requires a 224 bit or larger hash
Detail: gpg: signing failed: General error
</code></pre>

<p dir="auto">So, the problem seems to be the option <code>--digest-algo SHA1</code> (sha1 generates a 160 bit hash). If I remove it, I can sign a file successfully. This might be because my key is 2048 bit, I don't really know though. The gpg2 documentation says about the <code>--digest-algo</code> option:</p>

<blockquote>
<p dir="auto">Use  name  as the message digest algorithm. Running the program with the command <code>--version</code> yields a list of supported algorithms. In general, you do not want to use this option as it allows you to violate the OpenPGP standard. <code>--personal-digest-preferences</code> is the safe way to accomplish the same thing.</p>
</blockquote>

<p dir="auto">I don't have enough knowledge about gpg2 to say which option really is required and which isn't. Maybe you can make it possible (somehow) to let the user modify the options that are passed to gpg2? (as hidden preference or something like that).</p>

<p dir="auto">But regardless this issue, I wanted to tell you that you did a really great job with MailMate. It's exactly what I was looking for :)</p>

</div>