Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenDKIM not signing outgoing mails; doesn't think they are authenticated #510

Closed
carljm opened this issue Mar 7, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@carljm
Copy link
Contributor

commented Mar 7, 2016

When I run vagrant up on jessie branch followed by nosetests, the test for DKIM signature fails. Looking at syslog, I see this:

Mar  7 06:03:08 sovereign opendkim[17547]: 2A6AD30068B: [172.16.100.1] [172.16.100.1] not internal
Mar  7 06:03:08 sovereign opendkim[17547]: 2A6AD30068B: not authenticated
Mar  7 06:03:08 sovereign opendkim[17547]: 2A6AD30068B: no signature data

In /etc/opendkim/TrustedHosts, I see

127.0.0.1
10.0.2.15
sovereign.local
mail.sovereign.local

But from the perspective of the Sovereign VM, sovereign.local resolves to 127.0.0.1 (because it is listed as such in /etc/hosts, and mail.sovereign.local does not resolve at all (it is listed in the /etc/hosts of the host machine, but not of the Sovereign VM. So the host machine is not a trusted host for OpenDKIM, and since the tests run from the host machine, the test email is not DKIM-signed, and the test fails.

Can others reproduce this, or am I doing something wrong?

I think the simplest fix is to add the IP address of the host machine to /etc/opendkim/TrustedHosts when running under Vagrant. I've verified that that does in fact cause the test to pass. I can submit a PR for this if other contributors are also seeing this test failure and agree that that's the right fix.

@carljm

This comment has been minimized.

Copy link
Contributor Author

commented Mar 7, 2016

Hmm, wait, I'm confused. The MUA host shouldn't need to be a trusted host; if the mail comes through the submission port with proper authentication it should be signed. Need to dig further and figure out why that's not happening in this test...

@carljm

This comment has been minimized.

Copy link
Contributor Author

commented Mar 7, 2016

Confirmed that this is an issue on my deployed server, too, so it's not just a Vagrant/tests problem; the test is indicating a real problem. The issue seems to be that the OpenDKIM milter thinks the mail was not submitted by an authenticated user (thus the "not authenticated" in the log transcript above), when in fact it was. Trying to debug why that is the case; if anyone with more OpenDKIM experience can point me in the right direction, that would be great. This is all on jessie branch, running on Debian Jessie.

@mikeashley mikeashley added the jessie label Mar 8, 2016

@carljm carljm changed the title DKIM test fails because vagrant host machine is not a DKIM TrustedHost OpenDKIM not signing outgoing mails; doesn't think they are authenticated Mar 8, 2016

@carljm

This comment has been minimized.

Copy link
Contributor Author

commented Mar 8, 2016

Found it! OpenDKIM decides whether a message is authenticated or not based on the presence or absence of the {auth_type} macro (see http://www.opendkim.org/opendkim.8.html under OPERATION). The Sovereign Postfix config is currently configured to pass the {auth_authen} macro to mail milters, but not the {auth_type} macro (see https://github.com/sovereign/sovereign/blob/jessie/roles/mailserver/templates/etc_postfix_main.cf.j2#L107). Thus OpenDKIM thinks the message is unauthenticated and chooses not to sign it. Adding {auth_type} to the list of macros passed to mail milters fixes the problem. PR on its way shortly.

@neuhaus

This comment has been minimized.

Copy link
Member

commented Mar 8, 2016

Carl, thanks for the bug report and the patch.

@neuhaus neuhaus closed this Mar 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.