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 email@example.com it get delivered to firstname.lastname@example.org.
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.
Any ideas greatly appreciated!
Operating system: Linux
OS version: Debian 10
The “+” in an email address does NOT symbolize a separate mailbox. However, you could filter messages in the “email@example.com” mailbox to put mail for “firstname.lastname@example.org” 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:
Peter Knowles | TPN Solutions
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.
So I am still stuck.
An example email address I am trying to filter to a new mailbox is
I have promail-wrapper being called by Postfix as the following
/usr/bin/procmail-wrapper -o -a $DOMAIN -a $RECIPIENT -a $USER -d $LOGNAME
I have put together a procmail filter as follows:
* $ARG2 ?? \+
* $ARG2 \/(?<=\+)([^@]*)
The variable ARG2 is assigned $2 in the above recipe, which is the $RECIPIENT which equates to:
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:
However, procmail is skipping the nested condition all together as if it cannot find a “+” in the $ARG2:
procmail: Skipped "* $ARG2 \/(?<=\+)([^@]*)"
procmail: Skipped "$DEFAULT/$MATCH/"
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?
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.