Le 26/01/2011 18:55, Andy Spiegl a écrit : > On 2011-01-11, 18:17, Victor Duchovni wrote: >> Postfix recipient validation works by locating valid user addresses >> in a suitable (address-class dependent) lookup table. Additionally, >> regardless of the address class, the virtual(5) table can alias an >> arbitrary recipient to one or more (hopefully valid) recipients. >> >> http://www.postfix.org/ADDRESS_CLASS_README.html >> http://www.postfix.org/ADDRESS_REWRITING_README.html >> http://www.postfix.org/virtual.5.html >> >> So the best way to validate "prefix.u...@example.com" is to construct >> a lookup table that will return "u...@example.com" for a lookup key >> of the form "u...@example.com", but only if the user is valid. > > Okay, I think I understood enough to do it (more or less) right. > I set: > virtual_alias_maps = regexp:/etc/postfix/virtual_alias_regexp > and this file contains patterns like these: > > /^user@example\.com$/ u...@example.com > /.*\.user@example\.com$/ u...@example.com
the two lines could be written as one /(^|\.)user@example\.com$/ u...@example.com > /^user2@example\.com$/ us...@example.com > /.*\.user2\.spiegl@example\.com$/ us...@example.com > > It works! Mails with prefixes are delivered to the right mailboxes. > > The part that doesn't work as expected is that the header line > "Delivered-To:" doesn't show the original mail address but the mapped > one (w/o the prefix). which is the purpose of Delivered-To. > I assume this has to do with dovecot as LDA > because when setting "virtual_transport = virtual" then there are > correct X-Original-To and Delivered-To headers. > you want X-Original-To. do you have enable_original_recipient = yes ? do you expand your aliases before a content_filter? ... etc. > Is there an option I forgot or maybe I am still misunderstanding something > vital? > > Thanks a lot, > Andy. >