diff --git a/extras/tables/table-mysql/table-mysql.5 b/extras/tables/table-mysql/table-mysql.5 index 3ed0da5..1744649 100644 --- a/extras/tables/table-mysql/table-mysql.5 +++ b/extras/tables/table-mysql/table-mysql.5 @@ -222,9 +222,9 @@ host db.example.com username postfix password PostfixOutOpenSMTPDin database postfix -query_alias SELECT destination FROM alias WHERE email=?; -query_credentials SELECT username, password FROM mailbox WHERE username=?; -query_domain SELECT domain FROM domain WHERE domain=?; +query_alias SELECT IF(goto=address, 'vmail', goto) from alias WHERE address=? AND active='1'; +query_credentials SELECT username, password FROM mailbox WHERE username=? AND active='1'; +query_domain SELECT domain FROM domain WHERE domain=? AND active='1'; .Ed The rest of the config remains the same. diff --git a/extras/tables/table-postgres/table-postgres.5 b/extras/tables/table-postgres/table-postgres.5 index 968d4cc..15aaf68 100644 --- a/extras/tables/table-postgres/table-postgres.5 +++ b/extras/tables/table-postgres/table-postgres.5 @@ -191,9 +191,9 @@ accept from any for domain virtual deliver to mbox .Ic Pa /etc/mail/postgres.conf .Bd -literal -compact conninfo host='db.example.com' user='postfix' password='PostfixOutOpenSMTPDin' dbname='postfix' -query_alias SELECT destination FROM alias WHERE email=$1; -query_credentials SELECT username, password FROM mailbox WHERE username=$1; -query_domain SELECT domain FROM domain WHERE domain=$1; +query_alias SELECT IF(goto=address, 'vmail', goto) from alias WHERE address=$1 AND active='1'; +query_credentials SELECT username, password FROM mailbox WHERE username=$1 AND active='1'; +query_domain SELECT domain FROM domain WHERE domain=$1 AND active='1'; .Ed The rest of the config remains the same.