I was finally able to solve the issue. As I am using the
Synology Mail Server (
not Synology MailPlus Server!) package I would like to add my two cents here on how I was able to resolve this issue when PMG and mail server are relying on the same FQDN:
Basically, what I did, was:
- Change the Synology Mail Server's Hostname (FQDN) setting to:
mail.mydomain.local
- For Additional Domain SMTP settings on the Synology Mail Server I added:
mydomain.com
- Disable (uncheck) the Enable SPF verification security setting on Synology Mail Server.
- As the Synology Mail Server seems to do a DNS lookup for mail.mydomain.com whenever receiving an incoming e-mail, it was necessary to set my local DNS server as the primary DNS server in the network settings of the Synology DSM operating system. On that local DNS server I had to point the mail.mydomain.com to the PMG's private IP address.
After that, I was finally able to receive the e-mails from PMG to Synology Mail Server successfully. However, as all of my local e-mail clients (e.g.
Mozilla Thunderbird clients, web mail clients, ...) are resolving the
mail.mydomain.com domain via the same DNS server too, this solution was not acceptable to me, so I set the DNS entry poining back to the Synology Mail Server's IP address. As a workaround, to be DNS resolver independent, what I did, was to create a bash script on Synology DSM that is being triggered on system bootup, which adds the according required entry to the
/etc/hosts file in case the entry does not exist yet. I have attached the file for download, just unzip it and copy it to your Synology DSM system (e.g.
/var/services/homes/<myUser>/<Scripts>/add_line_if_not_exists.sh) and make it executable (
chmod +x). After that create the according automated task in your
Synolgy DSM system as follows:
Control Panel --> Task Scheduler --> Create --> Triggered Tasks --> User-defined script
Task: Give it a random task name
User: DSM admin-user that can access and run the script file and has permission to write to
/etc/hosts
Event: Boot-up
Task Settings --> Run command (replace
<myUser>, <Scripts>,
<PMG_IP_address> and
<mydomain>.<com> without the brackets with your required specific values):
Bash:
bash /var/services/homes/<myUser>/<Scripts>/add_line_if_not_exists.sh "<PMG_IP_address> mail.<mydomain>.<com>" /etc/hosts
Run the task once an check if the according line has been added to the
/etc/hosts file. If so, everything should work (you don't have to reboot the Synology DSM operating system, the hostfile change takes effect immediately).
Sounds very complicated but it's an easy and reliable task to workaround.
Hope this helps someone.