We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
How to autoclassify your email a la GMail or Mailcow with EXIM and Sieve [Tutorial] Topic is solved
How to autoclassify your email a la GMail or Mailcow with EXIM and Sieve [Tutorial]
Earlier I was asking how it's possible to auto tag or redirect receive email into folder like with :
- GMail do when you receive email at [email protected] (email ID using ‘+’ sign)
- Mailcow do when you receive email at [email protected] (tagging)
Basically postfix have this nice option recipient_delimiter = +
which let's you make a generic account like [email protected]
than you could receive at [email protected]
with well done configuration in dovecot it goes directly in a directory.
But how to do it with Exim ?
Thankfully @plvsouza made half of the solution by making a tutorial about Sieve and Dovecot here
Than after this I found different example on the Dovecot Wiki and in the Dovecot/Sieve jargon they call it Plus Addressed mail filtering or subaddress
So the second example which is something like this :
is the key.
I'll recommend you to add it at your user level than when it's bulletproof you could add it into
/etc/dovecot/sieve/default.sieve to make it for everyone.
- GMail do when you receive email at [email protected] (email ID using ‘+’ sign)
- Mailcow do when you receive email at [email protected] (tagging)
Basically postfix have this nice option recipient_delimiter = +
which let's you make a generic account like [email protected]
than you could receive at [email protected]
with well done configuration in dovecot it goes directly in a directory.
But how to do it with Exim ?
Thankfully @plvsouza made half of the solution by making a tutorial about Sieve and Dovecot here
Than after this I found different example on the Dovecot Wiki and in the Dovecot/Sieve jargon they call it Plus Addressed mail filtering or subaddress
So the second example which is something like this :
The following more advanced example uses the subaddress extension to handle recipient addresses structured as sales+<name>@company.com in a special way. The <name> part is extracted from the address using variables extension, transformed into a format with the first letter in upper case and subsequently used to create the folder name where the message is stored. The folder name is structured as users/<name>. If the +<name> detail is omitted from the recipient address, the message is filed in the sales folder.
Code: Select all
require ["variables", "envelope", "fileinto", "subaddress"];
if envelope :is :user "to" "sales" {
if envelope :matches :detail "to" "*" {
/* Save name in ${name} in all lowercase except for the first letter.
* Joe, joe, jOe thus all become 'Joe'.
*/
set :lower :upperfirst "name" "${1}";
}
if string :is "${name}" "" {
/* Default case if no detail is specified */
fileinto "sales";
} else {
/* For sales+joe@ this will become users/Joe */
fileinto "users/${name}";
}
}
I'll recommend you to add it at your user level than when it's bulletproof you could add it into
/etc/dovecot/sieve/default.sieve to make it for everyone.