My employer has given me an email address,
email@example.com. My employer's outgoing mail server only allows connections from inside their network (rather like an ISP who insists you connect through them to use their smtp server). So when I pop out to the cafe for lunch and an email from my boss arrives on my phone, I can't respond to it until I get back to the office. Also, I can't respond to work emails when I'm travelling or working in the field.
I'm not allowed to reconfigure the main mail server, but I have a small separate Postfix server which I can control. I have a number of virtual domains set up on there, and I added
myemployersdomain.com as an additional virtual domain, and
firstname.lastname@example.org as a virtual user. This works, and I can send outgoing mail through this server to anywhere in the world, EXCEPT to other users on myemployersdomain.com (which is all I really want).
When I try to send to email@example.com I get
NOQUEUE: reject: RCPT from... 550 5.1.1 ... Recipient address rejected: User unknown in virtual mailbox table
The Postfix server thinks it controls all of myemployersdomain.com, and if I don't set up a virtual user for the recipient on this domain, then it doesn't allow it. I can make the error go away by setting a catchall alias in the virtual file
but of course all the email I send then comes straight back to me!
I tried setting the transport file to relay all mail for myemployersdomain.com through, say, gmail like this:
example.com : myemployersdomain.com smtp:[smtp.gmail.com]:587
but it makes no difference. (The relaying works as expected for recipient addresses on other (external) domains, but for this virtual domain, Postfix doesn't allow you to get as far as this - the 5.1.1 error comes first.)
Is it possible to configure Postfix to send mail destined for a locally-defined virtual domain out into the big wide internet and let DNS sort it out?