EMail Tagging with Postfix and Dovecot

· 233 words · 2 minute read

I’m using Postfix and Dovecot for the EMail service on wreiner.at and all hosted domains.

Often you need an EMail address on websites to get their services but sometimes you are not sure what happens to this EMail address, will it get sold, or sometimes you want to just add a filter which moves the invoices of your hosting provider automatically into a specific folder. Certainly you don’t want to create aliases for everything, so the good people defining the EMail standards thought of that as well - EMail Tagging.

“How can I use this incredible feature?” you may ask. It’s fairly easy, just add your tag lead by “-” to your EMail address which is hosted on wreiner.at - for example the EMail address you’ll use would look like:

username-mytag@wreiner.at

How to use it on your own mailsystem setup will be shown now.

First of, let’s be clear, “-” is only one possible tagging delimiter. Some sites use “+” and it’s some kind of religious dispute. Nevertheless, Postfix needs to be aware of it.

In the file main.cf add the following line:

# address tagging
recipient_delimiter = -

To forward it to Dovecots LDA add or change the line which does this in your master.cf:

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

Reload Postfix and test it - for example with swaks.