Take the 2-minute tour ×

I am trying to setup an DKIM email signing for a postfix SMTP server.

This server is to be used by different services on the local network.

I have generated DKIM key pair, added it to my domain and was able to successfully send emails out from the server itself as seen here:

me@server:~$ telnet localhost 25
Connected to localhost.
Escape character is '^]'.
220 server.lan ESMTP Postfix (Ubuntu)
HELO example.com
250 server.lan
MAIL FROM: service@example.com
250 2.1.0 Ok
RCPT TO: me@example.com
250 2.1.5 Ok
Subject:Testing from server

250 2.0.0 Ok: queued as AAD604EA1CC2

That message is received with the correct DKIM signature.

But, if I do the exact same (only with telnet server.lan 25) thing on another machine on the local network, the DKIM signature is not included and the recipient doesn't know who sent the email.

I have found that this entry in /var/log/mail.log is relevant to it:

Jul 30 04:28:16 server opendkim[25664]: AAD604EA1CC2: can't determine message sender; accepting

So I have figured that postfix is not setting the FROM address properly. So why is it not doing it and how can I fix it?

Thanks in advance...

The entire log during transaction from the workstation is this:

Jul 30 15:56:29 server postfix/smtpd[6795]: warning: database /etc/aliases.db is older than source file /etc/aliases
Jul 30 15:56:29 server postfix/smtpd[6795]: connect from workstation.lan[]
Jul 30 15:57:24 server postfix/smtpd[6795]: 2C35E4EA1DD1: client=workstation.lan[]
Jul 30 15:58:18 server postfix/cleanup[6799]: 2C35E4EA1DD1: message-id=<>
Jul 30 15:58:18 server opendkim[25664]: 2C35E4EA1DD1: can't determine message sender; accepting
Jul 30 15:58:18 server postfix/qmgr[25810]: 2C35E4EA1DD1: from=<service@example.com>, size=272, nrcpt=1 (queue active)
Jul 30 15:58:19 server postfix/smtp[6802]: 2C35E4EA1DD1: to=<me@example.com>, relay=ASPMX.L.GOOGLE.COM[]:25, delay=67, delays=66/0.02/0.26/1.1, dsn=2.0.0, status=sent (250 2.0.0 OK 1343656739 a59si1127667wel.70)
Jul 30 15:58:19 server postfix/qmgr[25810]: 2C35E4EA1DD1: removed
share|improve this question
Are you using multiple postfix instances? –  xpepermint Jun 26 at 6:19

2 Answers 2

Do you have both smtpd_milters and non_smtpd_milters set in your main.cf?

I tried an dkim milter with just smtpd_milters pointing to it and it wouldn't work, even though I was telnetting to smtpd, but when I added the configuration for non_smtpd_milters it started to work. Something very screwy there, but that's what made it go.

share|improve this answer

The MTA is never responsible for setting message headers; this is a problem with your mail client or MUA.

That said, if postfix detects a message without ANY From: headers, it adds the MAIL FROM sender address as a From: header; this is very well documented.

share|improve this answer
The only thing that remotely resembles an MUA or mail client here is telnet. Surely telnet cannot be blamed for anything going wrong. I have posted the entire transaction with the MTA. No if postfix usually adds the From: automatically into the DATA block, why not in this case? And why is it still not signed when I add that header myself? –  d_inevitable Jul 30 '12 at 13:28
Please include the entire log of one of these tests; that will show conclusively what happens. –  adaptr Jul 30 '12 at 13:39
ok done. Thanks for looking into this. :) –  d_inevitable Jul 30 '12 at 14:03

Your Answer


