mail from internal mail to external mail

I have hosted several domains on 1 server.
domain1 uses the internal e-mail server
and domain2 uses google workspace.

If I want to send mail from domain 1 to 2, it does not arrive. I can see in the rspam module that it is being sent. but domain2 does not receive it. domain2 does not have e-mail on the internal server. but does have google workspace.

How can I make sure that the e-mail still arrives?

https://kb.apiscp.com/email/mail-sent-hosted-domain-not-arrive-third-party-mx-records/

Thanks for your response :slight_smile:

I have already set this up, domain 1 internal domain 2 no email service.

Still no email arrives from domain 1 to domain 2.

Compared the settings at domain 3 (internal mail on) and this goes well to domain 2 (internal mail off).

If the recipient’s domain is not listed in Mail > Mail Routing in the control panel, then you’d want to consult /var/log/maillog to determine the final disposition of the message.

grep RECIPIENT /var/log/maillog

The recipient’s domain is listed, but turned off / not enabled.

In the maillog i see for example;

Apr 11 20:59:01 cloud postfix/error[4123033]: 93F30C16CB1C: to=<emailadres>, relay=none, delay=0.08, delays=0.05/0.02/0/0.01, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=<domeinname> type=MX: Host not found, try again)

DNS for the domain cannot be resolved. It’s either missing both an MX and A record for the domain itself or the MX target does not resolve to an A or AAAA address.

DNS is performed by querying the resolver in /etc/resolv.conf. You should be able to reproduce the issue by running dig MX domain, then getent hosts DOMAIN-MX-VALUE. The MX value is invalid.

host -t a <domainname>
<domainname> has address <ip>

host -t mx <domainname>
Host <domainname> not found: 2(SERVFAIL)

OK. There’s your issue :+1:. Here’s an appropriate response:

host -t mx apisnetworks.com
apisnetworks.com mail is handled by 20 mail.apisnetworks.com.
apisnetworks.com mail is handled by 10 mail.apisnetworks.com.

True.
I’m not sure what and where should i set now.

You’ll need to get in touch with the service provider who handles mail for the domain to determine what appropriate DNS records to add for the domain.

The mx records are present. On the external DNS servers.

The sending domein is hosting mail and website on the same server as de receiving domain. But only de website is on the same server as the sending one. Mail for the receipts mail is Google Workspace external mail provider.

For the receipts mail domain:

DNS is not enabled. For that domain on the server.
Mail is not enabled. For that domain on the server.

PM me the recipient’s domain. There is almost certainly a typo or omission somewhere.

Caused by user-configured DNS override on a multihomed NIC. The DNS server configured, 192.168.11.1, does not resolve the record correctly.

As a reminder, ApisCP will not modify your network settings since there’s dozens of ways to configure a network and each has its peculiarities.

resolvectl status
Global
       LLMNR setting: yes
MulticastDNS setting: yes
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes
  Current DNS Server: 1.0.0.1
         DNS Servers: 1.0.0.1
                      1.1.1.1
          DNS Domain: ~.
          DNSSEC NTA: in-addr.arpa

Link 3 (wlp0s20f3)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes

Link 2 (eno1)
      Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes
  Current DNS Server: 192.168.11.1
         DNS Servers: 192.168.11.1