Postfix
Hi,
let's say my domain is named "domain.tld" and the domain mails are hosted by a third party ISP so the MX record points to a ISP's public IP address.
I wanted to backup in a centralized place all the accounts incoming mails so I set an ISPConfig server in my office and configured on it the domain "domain.tld" and all the accounts also configured on the ISP mail server and then, I configured fetchmail to fetch periodically the incoming mail on the ISP accounts to te locals.
I also configured a special account where all the incoming mail are placed in by copy using the "always_bcc" postfix directive.
Now I want to use the ISPConfig server also as a SMTP Outgoing server for the clients inside my network.
To do that I provided the server with a public IP address and I configured the clients to use it.
The problem, of course, is that when a mail is sent from an internal account to another internal account, the ISPConfig server delivers it locally, without send it to the ISP, because the domain "domain.tld" is configured on ISPConfig.
I want to avoid this behavior and force postfix to send the mails to the public mx server, regardless of where the domain is hosted.
I tried to configure the domain itself inside the "mail routing" section, adding the domain as a new transport.
This actually works BUT it generates a mail loop to the ISP accounts:
The mail is sent to the ISP, then it is fetched by fetchmail and, once is fetched, it is automatically delivered again to the ISP, and so on for 5 or 6 times when the loop is blocked by the anti-loop system.
I then tried to add the lines:
-o virtual_mailbox_domains=
-o virtual_mailbox_maps=
-o relayhost=mx.mydomain.tld
to my master.cf file in the sections "smtp", "smtps" and "submission" but no luck.
Anyone can help me with this?
Thank you in advance.
|
Recent comments
9 hours 53 min ago
14 hours 52 min ago
16 hours 19 min ago
17 hours 12 min ago
18 hours 55 min ago
23 hours 18 min ago
1 day 10 min ago
1 day 2 hours ago
1 day 15 hours ago
1 day 17 hours ago