0

I recently configured my mailserver. Everything is working for my accounts. I used the tutorial of Thomas Leister for setting up the Mailserver and the Database.

Now I want to add different catchall aliases

my current accounts are:

admin@example.com
prename.name@example.com
otherprename.name@example.com

what I would want is a catchall that catches everything sent to

/whatever/.prename.name@example.com to spam.prename.name@example.com
/whatever/.otherprename.name@example.com to spam.otherprename.name@example.com

(the dot is just an example)

different examples are: facebook.name@example.com, google.name@example.com, facebook.othername@example.com

it should discard random adresses like team@example.com etc.

I know that i could use a global catch all, but thats not what I need. (the configuration for that would be:

query = SELECT concat(destination_username, '@', destination_domain) as destinations FROM aliases WHERE source_username ='%u' and  source_domain ='%d' and enabled = true UNION ALL SELECT concat(destination_username, '@', destination_domain) as destinations FROM aliases WHERE source_username is null and  source_domain ='%d' and enabled = true AND not exists (SELECT id FROM aliases WHERE source_username ='%u' and  source_domain ='%d' and enabled = true);

current aliases.cf

user = vmail
password = vmaildbpass
hosts = 127.0.0.1
dbname = vmail
query = select concat(destination_username, '@', destination_domain) as destinations from aliases where source_username = '%u' and source_domain = '%d' and enabled = true;

Is there anything I could do to achieve this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.