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 would like to allow email addresses that have an unique id as prefix. For example U123456_bla@bla.tld and U654321_bla@bla.tld would be accepted and send to one users email box.

Postfix works fine on my box and I tried to add to my

recipient_canonical_maps = regexp:/etc/postfix/recipient_canonical-regexp

and defined in /etc/postfix/recipient_canonical-regexp

/\wbla@bla.tld$/        myuser

But I had no luck with it. How can this be done?
Any help very very appreciated
Thanks in advance

share|improve this question

I would do it using a virtual map, not a recipient_canonical map. Try that, along with a pattern like:

/.* foo

share|improve this answer
Thanks a lot! I tried your suggestion in my virtual alias map and still the emails were rejected. However after I used your regexp in my /etc/postfix/recipient_canonical-regexp it wokred out fine. Thanks again and have a nice day Jens – user23613 Oct 22 '09 at 10:44

I know it's possible to use a suffix after the username with Postfix and an MDA like Procmail - this is how my ticketing system does email-to-ticket. But I don't remember the exact setup.

I'd look around for Address Extensions in the Postfix docs. I have a feeling you can only use a suffix, not a prefix.

share|improve this answer
I think you're thinking of "recipient_delimiter". According to the docs it only allows suffixing. Setting recipient_delimiter to "-" would let you use the form bla-U123456@bla.tld – Gerald Combs Oct 21 '09 at 19:30
Oops. Yeah, that's what I meant... – Jason Antman Oct 22 '09 at 2:59

Your Answer


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