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.

on my server, I would like Postfix to be MTA, to accept mails and to apply a virtual-mailbox-mapping like this (of course with my domain instead of example.org):

in /etc/postfix/main.cf:
virtual_mailbox_maps = hash:/etc/postfix/virtual

/etc/postfix/virtual:
test@example.org mymailbox/

Then the Mail shall be "delivered" by Dovecot (as MDA) to a user directory in /var/mail/vhosts/username. I therefore configured Postfix and Dovecot like in the Dovecot-Wiki: http://wiki2.dovecot.org/LDA and added as explained the following to the /etc/postfix/master.cf:

dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}

The problem I have is, that Postfix seems to validate incoming emails over the virtual mapping (test@example.com is delivered, anothername@example.com not), but Postfix does not send the mapping result ("mymailbbox") to deliver, but the original adress ("test@example.org").
My first idea was, that there is another variable, that I could use in master.cf instead of ${recipient} (you can look them up via "man pipe"), but I did not find any which seems to do what I want.

So my Question: Is it possible to use the virtual mapping in Postfix AND the delivery by Dovecot together? If not, is there a possibilty to do something like a virtual mailbox mapping in Dovecot as easy as in Postfix?

Thanks in Advance!

share|improve this question
2  
Post the output of postconf -n and your complete master.cf file. –  joschi Dec 6 '10 at 7:10

2 Answers 2

Try setting up your dovecot LDA with the following parameters:

argv=/usr/libexec/dovecot/deliver -f ${sender}
           -d ${user}@${nexthop} -a ${recipient} -n -m ${extension}

I use this to support extensions in the local part (like test+xyz@example.com). You may want to try ${mailbox} in place of ${user}@${nexthop}. Have a look at man 8 pipe for all possible substitutions.

BTW: This is used by me for a working virtual mapping which maps email adresses for multiple domains into virtual mailboxes. On dovecot's side I'm using the same tables (via dovecot's SQL configuration) to do authentication for each virtual mail user. Not sure if you can map virtual mail addresses to real system users this way.

share|improve this answer
    
hurikhan77, that should work. At least after I configured my "main" domain, the one my mail servers hostname belongs to, as a virtual domain, system users can now be contacted via {systemusername}@{domainname} and virtual mapping of mailboxes and virtual aliases between all my virtual domains works great. Including the technically "real" domain. –  Georg Bretschneider Jan 25 '12 at 7:56
    
@GeorgBretschneider please vote my answer if it was helpful to you... Thank you. –  hurikhan77 Jan 30 '12 at 9:01

If you are using Dovecot as the MDA, all virtual_mailbox settings in postfix are ignored, as these apply only to the provided virtual(8) delivery agent.

share|improve this answer

Your Answer

 
discard

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.