Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have a development server, and at the moment email is disabled on it, so we can do whatever we need to with the system without worrying about accidentally emailing clients' customers.

I'd like to set up Postfix (or something similar) to route all email from that machine to a specific, single address, no matter who it is addressed to or which domain name they are using.

I've tried this, with no success (the BCC works, but the email still goes to the original recipient):

local_recipient_maps =
luser_relay =
always_bcc =

I'm using Ubuntu server 10.04, pretty standard LAMP setup.

share|improve this question
up vote 4 down vote accepted

You will need to do address mapping in the canonical table. Add the following to /etc/postfix/canonical:


and run postmap afterwards

postmap canonical

This should do it.

share|improve this answer
I'm probably doing this wrong, but I didn't get very far. There was no /etc/postfix/canonical file, so I created one with the text above. I then ran "postmap canonical", but got this error: "postmap: fatal: open canonical: No such file or directory" – Dave Child Feb 11 '11 at 12:13
Before running "postmap canonical" cd into /etc/postfix or run "postmap /etc/postfix/canonical" . – rems Feb 11 '11 at 12:22
Also, in /etc/postfix/ you should have a line "canonical_maps = hash:/etc/postfix/canonical" . – rems Feb 11 '11 at 12:23
All sorted - thanks rems! I had a couple of issues, which I'll outline here in case anyone else comes looking for this. I didn't realise what postmap was doing, first. So to do the above, I created a text file (/etc/postfix/canonical) with the first line from rems. I then ran postmap from the postix directory, and that generated a database file used by postfix (canonical.db). The line added to doesn't use the .db extension, but does look for the .db file. Finally you need regexp: instead of hash: if using a regex pattern as above. – Dave Child Feb 11 '11 at 12:52
ups, sorry, yes, it should have been a "regexp:" not a "hash:". I did copy & paste from the wrong – rems Feb 11 '11 at 14:30

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.