I am a bit stumped with where to start as I am completely new to the world of email servers.
I am trying to work out how to configure the creation of a new mail folder and move the email into this newly created folder when I receive an email with a plus addressed format. The new mail folder should be named the string after the “+” in the address. The postfix section of this process is enabled by default and when I send an email to user+something@example.com it get delivered to user@example.com.
From my web searching I can find examples with server software not installed as standard with the virtualmin install. I also can’t seem to find a clear answer to which server to configure - Postfix, Dovecot or Procmail? I followed the example show in the dovecot wiki at https://wiki.dovecot.org/LDA/Postfix and turned my VPS into a turtle until I removed the configuration.
The “+” in an email address does NOT symbolize a separate mailbox. However, you could filter messages in the “user@example.com” mailbox to put mail for “user+something@example.com” into a separate folder using Procmail or more easily within Usermin using “Filters” (which essentially creates a Procmail filter) or even using a desktop application like Thunderbird which also has a filter feature.
An article on the topic of Plus Addressing can be found at:
I am actually after the back end info on how to filter the emails and create the folder in the appropriate maildir all on the server. I’m studying the Procmail filtering system now as a pointer to the solution. Will post a filter solution when I actually find one.
I believe that I have tested $ARG2 with a regular expression looking only for the “+” character. According to the value of the $RECIPIENT and therefor $ARG2 there is a “+” character in the variable so the nested condition should be applied next. This next condition is to strip everything from before and including the first “+” sign and after and including the “@” symbol.
If I pass the string ARG2 in a regex calculator the result is: Quotation+SAL-QTN-2021-00001-2
However, procmail is skipping the nested condition all together as if it cannot find a “+” in the $ARG2:
Procmail log:
Am I at least on the right track? I feel that someone must have set up a procmail plus or sub addressing system on virtualmin that mimics the cpanel system that create folders and nested folders if a plus/sub addressed email is received?