How to add regex aliases in Postfix when using MySQL

1

I need to create regex based catchall aliases in Postfix setup with MySQL. I have found examples of a mysql_virtual_alias_maps_regexp.cf with this query:

query = SELECT goto FROM alias WHERE '%s' REGEXP CONCAT('^',address,'$') AND SUBSTRING(address,1,1) != '@' AND x_regexp = '1'

But I cannot find the actual structure for the table that goes with that query.

My alias table has id,domain_id,source,destination based on this guide: https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql which wasn't written to allow regex aliases.

How can I create a table / virtual_alias_maps that will support regex aliases when using MySQL? All decent guides are for non-MySQL setups using /etc/postfix/virtual

Thank you.

omniomi

Posted 2015-06-15T16:33:15.593

Reputation: 66

Answers

1

A few google searches found me this postfix-admin wiki page: http://sourceforge.net/p/postfixadmin/wiki/Regex_aliases/

Josip Rodin

Posted 2015-06-15T16:33:15.593

Reputation: 333

Nevermind... I found it... I downloaded postfixadmin and found their CREATE TABLE queries. – omniomi – 2015-06-15T20:26:22.363