Error on mail relay

Hello everybody,
We are trying to do mail relay with an external SMTP gateway but we are getting error. Bellow are some details on our configuration plus the error from log

  1. domain is called mydomain.com
  2. UCR variables
    –> mail/relayhost mx1.mydomain.com
    –> mail/relayauth (not set)
    –> mail/postfix/mynetworks 127.0.0.0/8
  3. DNS service record
    –>service SMTP, protocol TCP, priority 10, Weighting 10, port 25, server mx1.mydomain.com
    DNS host record mx1.mydomain.com = Public IP
  4. restart of postfix
    –> systemctl restart postfix
  5. The icmp resolution of mx1.mydomain.com is working and incoming mails also working though our external smtp gateway.

The log from /var/log/mail.log show host record not found but there are present.

 Sep 11 23:52:28 intranet postfix/smtp[17752]: warning: relayhost configuration problem
 Sep 11 23:52:28 intranet postfix/smtp[17751]: 1F6D0F06125: to=<firstname.lastname@gmail.com>, relay=none, delay=2446,  delays=2446/0.03/0/0, dsn=4.3.5, status=deferred (Host or domain name not found. Name service error for   name=mx1.mydomain.com.mydomain.com type=A: Host not found)

We don’t find where we should modify the host from “mx1.mydomain.com.mydomain.com” to “mx1.mydomain.com”.

Many thanks,
Jean-Raoul

Hey,

Postfix does not DNS lookups of type SRV, only of types MX, A and AAAA. So what’s actually interesting is the output of the following two commands:

host -t mx $( postconf relayhost | awk -F= '{print $2}' )
host -t a $( postconf relayhost | awk -F= '{print $2}' )

Kind regards
mosu

I had the same issue recently on my private system.

Univention brings its own dns and uses it by default for dns Lookups. Since your relayhost uses a subdomain of the same domain your UCS is using, UCS is looking up the domain in its local DNS, where no entry for mx1 exists.

One solution would be to manually mirror the dns entries in the local dns of UCS. In the end I went with simply not using the local nameserver, but an external one. e.g. ucr set nameserver1=8.8.8.8

Hi,

I had change nameserver1 and it is now working fine.
Many thanks to all of you.
Kind regards,

Mastodon