Am 13.11.2011 15:04, schrieb David Mehler:
> For my virtual alias maps should I put them all under the mysql
> database or have them mixed?

if you have something with mysql you should do all with mysql
because mixing is confusing over the long and with database
baclends you get some benefits:

* changes are directly active
* writing webinterfaces is simple
* queries are much more flexible

remind you can do views and complex queries if needed and
mostly use the same source-tables for very different things
to get postfix seeing a "flat-table" without have to know
anything about the underlying structures
______________________

one nice example working on a view to provide a simple list
of valid users while they are coming from different tables
including "domain aliases"

some tables of the views are refreshed by webui-php-functions while
making changes and on the postfix-side it is one simple list

[root@srv-rhsoft:~]$ cat /etc/postfix/mysql-recipients.cf
user     = dbmail
password = **********************
dbname   = dbmail
hosts    = unix:/var/lib/mysql/mysql.sock inet:127.0.0.1:3307
query    = select alias from dbma_recipients where alias='%s';

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW 
`dbma_recipients` AS select
`dbmail_aliases`.`alias` AS `alias` from `dbmail_aliases` union (select 
concat('@',`dbma_mta`.`mydestination`) AS
`alias` from `dbma_mta` where (`dbma_mta`.`transport` <> 
'dbmail-lmtp:127.0.0.1:24')) union (select
`dbma_recipient_relay`.`mydestination` AS `alias` from `dbma_recipient_relay`) 
union (select
`dbma_aliases_global`.`alias` AS `alias` from `dbma_aliases_global`)



Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to