Super User is a question and answer site for computer enthusiasts and power users. 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

Gmail users can get virtually unlimited email addresses by using $name+$ ("plus addressing").

I'd like to have that for my own mail server, which is running Postfix. The mailbox and alias data are stored in a MySQL database.

I suspect that the alias configuration needs to be modified, so that gets mapped to the mailbox, but I fail to find out how.

So, is it possible? How?

share|improve this question
up vote 7 down vote accepted

Apart from setting

recipient_delimiter = +

I also had to modify, so that maildrop gets not only the recipient passed, but the real user:

maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=Debian-exim argv=/usr/bin/maildrop -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop}

Blog post:

share|improve this answer
You asked about postfix, yet this mentions exim, which is different SMTP server. BTW, note that if you have real IMAP server (not just mailbox), using LMTP is much faster than maildrop. And if you use LMTP with Cyrus, you will not need this. – mvp Apr 25 '13 at 10:44
the user is debian-exim, but it's still postfix. – cweiske Apr 25 '13 at 10:49
Saved my day with {nexthop}. I didn't even knew that existed. Thank you. – TCB13 Jan 2 at 23:46

You did not say what mail server is storing your emails. These days, it should be one of the IMAP servers - like Cyrus, Dovecot, Courier, ...

I personally like Cyrus IMAP. It supports this with relative ease:

Plus addressing - allows direct delivery to a particular mailbox (other than an INBOX). This is done via an address of the form: username+mailfolder@domain, which will deliver to the user's INBOX.mailfolder folder (or altnamespace equivalent). This submailbox must allow the posting user the 'p' right.

Adding 'p' right is important step - otherwise all mail (using + or not) will be delivered to username INBOX.

Note that you should use LMTP (local mail transport protocol) to deliver your mail from postfix to IMAP server and also need to configure postfix recipient_delimiter (or recipient_delimiters) as described here:

recipient_delimiter = +
share|improve this answer
as long as the mails do not reach the user/maildrop because the mail address is not recognized by the receiving server, IMAP server support does not matter. – cweiske Apr 25 '13 at 10:10
thanks for giving the hint about "plus adressing". with that name, I found the solution. – cweiske Apr 25 '13 at 10:30

The line for Dovecot:

dovecot   unix  -       n       n       -       -       pipe
flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver
 -f ${sender} -a ${recipient} -d ${user}@${domain}

With Postfix 2.4 and earlier, use ${nexthop} instead of ${domain}

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .