r-raymond / nixos-mailserver

A complete and Simple Nixos Mailserver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

postfix fails to deliver mail due to wrong policy_service setting

phdoerfler opened this issue · comments

postfix logs "host/service mailstore.example.com/12340 not found: Name or service not known" when delivering mail:

Feb 22 23:17:39 turtle postfix/smtpd[4194]: Anonymous TLS connection established from mx.example.com[123.123.123.123]: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Feb 22 23:17:39 turtle postfix/smtpd[4194]: fatal: host/service mailstore.example.com/12340 not found: Name or service not known
Feb 22 23:17:40 turtle postfix/master[4175]: warning: process /nix/store/xz06496qy0yfacj83qv1h750zwjbg965-postfix-3.2.5/libexec/postfix/smtpd pid 4194 exit status 1
Feb 22 23:17:40 turtle postfix/master[4175]: warning: /nix/store/xz06496qy0yfacj83qv1h750zwjbg965-postfix-3.2.5/libexec/postfix/smtpd: bad command startup -- throttling

In addition to the log message postfix is unable to deliver mail.

See #86 (comment) for details.

The offending line instructs postfix to ask the policy server at mailstore.example.com at the given port. Or it would if there was any such server at that address. This would normally allow postfix to query dovecot if the mail may be delivered (due to the quota).

This line should at least read localhost or the fqdn instead of the example URL. I'm no expert with postfix and dovecot but I would suspect one can get this information not just via a network call but perhaps via unix sockets from dovecot.

Wow, sorry about that. I have now idea how that ended up in the release. Let met try to fix this right now.

We should definitely try to create a test case that catches that error.

I think the tests got lucky there, since the domain is actually example.com

Is there a way in Nix to create a random string that could be used as domain name?

I don't know, if you find a way feel free to open a PR