Hello,
I have a question about Mailcow and filters for subdomains.
I would like to create email addresses for subdomains:
catch-all@user1.test.com
catch-all@user2.test.com
Thanks to the great admin interface, this works without any problems.
But now I would like to filter all incoming eMail by the catch-all address. The mails should then be moved automatically into subfolders (as with tagging). If the subfolder does not exist yet, it should be created.
For example:
catvideos@user1.test.com -> Inbox / Catvideos (from user 1)
catvideos@user2.test.com -> Inbox / Catvideos (from user 2)
dogvideos@user1.test.com -> Inbox / Dogvideos (from user 1)
And so on.
Is there a way to create such a filter (e.g. in the Administratons menu)? What can I do?
Many greetings
L
Hi,
You need to filter on "To", as the envelope will be changed to the final mailbox. It tested the following:
require "fileinto";
require "mailbox";
require "variables";
require "subaddress";
require "envelope";
if address :matches :localpart "to" "*"
{
set :lower :upperfirst "name" "${1}" ;
if mailboxexists "INBOX/${name}" {
fileinto "INBOX/${name}";
} else {
fileinto :create "INBOX/${name}";
}
}
You can create this filter in mailcow UI.
Awesome! Thank you very much. The filter works perfectly.
You helped me a lot.
Many greetings
L
Most helpful comment
Hi,
You need to filter on "To", as the envelope will be changed to the final mailbox. It tested the following:
You can create this filter in mailcow UI.