Thank you for your answer.
We managed to got it working by adding the following to the docker-compose.yml file, under gvmd:
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- MTA_HOST=host.docker.internal
- MTA_PORT=25
- MTA_TLS=off
- MTA_STARTTLS=off
- MTA_FROM=sender@domain.nl
- MTA_AUTH=off
We’re using Postfix on the host with the docker network added to my_networks.
We can afford to have no authentication on the MTA host because the Postfix instance on the host has a relay added to a secure Postfix server.
sendmail is a symlink for msmtp.