Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get postfix to forward email to my domain which is hosted by gmail. As I don't have any users on my server nor do I want to.

Here's how I have things set up. Let's say you and I have a domain called

The registrar has MX records pointing to gmail. Everything works for like a year.

Now we set up a server to host a website.

Then we create a mail account called and send mail locally from the server using roundcube.

This works.

We can send mail to, to or to any/everyone.

BUT we cannot send mail to our own domain,

So I cannot email to, to or to

It gives the following error:

SMTP Error (450): Failed to add recipient "" (4.1.1 <>: Recipient address rejected: User unknown in virtual mailbox table).

I'm guessing because it is looking at the local server to find the mailbox, which doesn't exist.

So how to I tell the server for any mail going to for to send to my external mail server, and not to lookup on the local www box we set up with zpanel?

Any ideas?

share|improve this question

You can use transport for that (

put in /etc/postfix/transport

Don't forget to run postmap /etc/postfix/transport after that.

share|improve this answer
tried that.. but no luck. Added the line to transport and then did the postmap.. – orlandoresorts Mar 28 '13 at 13:27
error was Mar 28 09:24:51 server postfix/pickup[10079]: DC00615A20D7: uid=0 from=<> Mar 28 09:24:51 server postfix/cleanup[10094]: DC00615A20D7: message-id=<> Mar 28 09:24:51 server postfix/qmgr[10080]: DC00615A20D7: from=<>, size=322, nrcpt=1 (queue active) Mar 28 09:24:52 server postfix/pipe[10085]: DC00615A20D7: to=<>, relay=dovecot, delay=0.18, delays=0.12/0/0/0.07, dsn=4.1.1, status=SOFTBOUNCE (user unknown) – orlandoresorts Mar 28 '13 at 13:28
You could leave local_recipient_maps empty in but this would not be a good idea because it will forward to gmail all emails for your domain, even if recipients does not exist. If this server is is exposed in internet it could be a big problem. You could list all existing recipients in a file and use this file in local_recipient_maps (something like local_recipient_maps = hash:/etc/postfix/usernames). – Laurentiu Roescu Mar 28 '13 at 13:51
You could also change mydomain in to something like This way the server will not think that mails for are for itself and it will forward them to MX. – Laurentiu Roescu Mar 28 '13 at 13:58
I did try that too beforehand! (changing the mydomain to I made up.. and no luck :( ) The local recipent maps is already blank. (the email addresses are fixed.. 4 addresses . But I don't want to staticly assign addresses just in case I add more people.. but the usernames wouldn't work cuz I have no local mailboxes... right? – orlandoresorts Mar 28 '13 at 14:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.