CentOS Linux 7.9.2009
Webmin version 1.962
Virtualmin version 6.14
I need to configure mail server settings to use a remote mail exchanger for the domain. The domain concerned is the only domain hosted on the server and we have AWS SES set-up as a smarthost and email is being routed out via SES for ‘other’ recipients without issue.
The issue we have is that email generated to the domain errors like this:
NOQUEUE: reject: RCPT from localhost[::1]: 550 5.1.1 support@xxxdomainxxx.co.uk: Recipient address rejected: User unknown in local recipient table;
We need this email to be routed out as well via SES the mail is not for local delivery.
I’m not sure if I’ve overcomplicated things however I’ve tried setting up transport mapping to force external routing for a domain hosted on the server however I cannot seem to force Postfix to use AWS SES for the domain even with this extra transport mapping in place
How can I tell postfix that local delivery is not applicable for the domain and force the mail to be routed via AWS SES, as said other mail from this server is successfully being relayed via this smarthost/route?
You are not using the email features for this domain at all on the Virtualmin server?
Then you can just disable that under Edit Virtual Server → Enabled features and remove the checkbox for “Mail for domain enabled?”.
Save, and it should now send the mail out without checking Postfix virtual.db.
Thank you for your reply toreskev I actually already have that set well in this case unset however for some reason it is still using the Postfix virtual.db any ideas?
Yes as those settings have been in place for a long-time. I’ve just thought of something this server basically only hosts a series of websites (under www. and a sub-domains) for one client so we have set the overall System hostname as the clients main domain so will it be that which is causing this as the overall server thinks it is the ‘domain’?
@Joe can you help/advise me on this ideally would prefer not to have to change the System hostname which is set to the client’s primary domain can I still force email to be externally routed?
Your server is named the domain you are sending mail to. What is postfix supposed to do except deliver it to what it believes is the right destination (itself)? There are other reasons not to do this, but in your case, it is doubly problematic.
Change the name of your server, and delete the virtual map entries for this domain in /etc/postfix/virtual, and regenerate the map db if you don’t use Webmin to make that change (I don’t recall if restarting postfix will regenerate it, but the postmap command definitely will).