Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 main.cf

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
Jens

share|improve this question

2 Answers 2

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

/.*foo@example.com/ foo

share|improve this answer
1  
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

 
discard

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