Mailcow-dockerized: [Question] Admin filters for catch-all subdomains filtering (like tagging)

Created on 28 Aug 2019  路  2Comments  路  Source: mailcow/mailcow-dockerized

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

Most helpful comment

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.

All 2 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

poldixd picture poldixd  路  3Comments

a3li picture a3li  路  3Comments

starcraft0429 picture starcraft0429  路  3Comments

Braintelligence picture Braintelligence  路  3Comments

lgleim picture lgleim  路  3Comments