diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..c336103 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,4 @@ +postfix_postfixadmin_mysql_host: localhost +postfix_postfixadmin_mysql_database: postfixadmin +postfix_postfixadmin_mysql_username: postfix +postfix_postfixadmin_mysql_password: eiVa9aloex5fiayeepheequ7 diff --git a/templates/sql/mysql_virtual_alias_domain_catchall_maps.cf.j2 b/templates/sql/mysql_virtual_alias_domain_catchall_maps.cf.j2 index 6b5172e..8d1e037 100644 --- a/templates/sql/mysql_virtual_alias_domain_catchall_maps.cf.j2 +++ b/templates/sql/mysql_virtual_alias_domain_catchall_maps.cf.j2 @@ -1,6 +1,6 @@ # handles catch-all settings of target-domain -user = postfix -password = password -hosts = localhost -dbname = postfix +user = {{postfix_postfixadmin_mysql_username}} +password = {{postfix_postfixadmin_mysql_password}} +hosts = {{postfix_postfixadmin_mysql_host}} +dbname = {{postfix_postfixadmin_mysql_database}} query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1' diff --git a/templates/sql/mysql_virtual_alias_domain_mailbox_maps.cf.j2 b/templates/sql/mysql_virtual_alias_domain_mailbox_maps.cf.j2 index a0d6a90..fd53333 100644 --- a/templates/sql/mysql_virtual_alias_domain_mailbox_maps.cf.j2 +++ b/templates/sql/mysql_virtual_alias_domain_mailbox_maps.cf.j2 @@ -1,5 +1,5 @@ -user = postfix -password = password -hosts = localhost -dbname = postfix +user = {{postfix_postfixadmin_mysql_username}} +password = {{postfix_postfixadmin_mysql_password}} +hosts = {{postfix_postfixadmin_mysql_host}} +dbname = {{postfix_postfixadmin_mysql_database}} query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 AND alias_domain.active='1' diff --git a/templates/sql/mysql_virtual_alias_domain_maps.cf.j2 b/templates/sql/mysql_virtual_alias_domain_maps.cf.j2 index effe89f..596e928 100644 --- a/templates/sql/mysql_virtual_alias_domain_maps.cf.j2 +++ b/templates/sql/mysql_virtual_alias_domain_maps.cf.j2 @@ -1,5 +1,5 @@ -user = postfix -password = password -hosts = localhost -dbname = postfix +user = {{postfix_postfixadmin_mysql_username}} +password = {{postfix_postfixadmin_mysql_password}} +hosts = {{postfix_postfixadmin_mysql_host}} +dbname = {{postfix_postfixadmin_mysql_database}} query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1' diff --git a/templates/sql/mysql_virtual_alias_maps.cf.j2 b/templates/sql/mysql_virtual_alias_maps.cf.j2 index 394d9fb..8028fac 100644 --- a/templates/sql/mysql_virtual_alias_maps.cf.j2 +++ b/templates/sql/mysql_virtual_alias_maps.cf.j2 @@ -1,6 +1,6 @@ -user = postfix -password = password -hosts = localhost -dbname = postfix +user = {{postfix_postfixadmin_mysql_username}} +password = {{postfix_postfixadmin_mysql_password}} +hosts = {{postfix_postfixadmin_mysql_host}} +dbname = {{postfix_postfixadmin_mysql_database}} query = SELECT goto FROM alias WHERE address='%s' AND active = '1' #expansion_limit = 100 diff --git a/templates/sql/mysql_virtual_domains_maps.cf.j2 b/templates/sql/mysql_virtual_domains_maps.cf.j2 index 61e56f7..d916365 100644 --- a/templates/sql/mysql_virtual_domains_maps.cf.j2 +++ b/templates/sql/mysql_virtual_domains_maps.cf.j2 @@ -1,7 +1,7 @@ -user = postfix -password = password -hosts = localhost -dbname = postfix +user = {{postfix_postfixadmin_mysql_username}} +password = {{postfix_postfixadmin_mysql_password}} +hosts = {{postfix_postfixadmin_mysql_host}} +dbname = {{postfix_postfixadmin_mysql_database}} query = SELECT domain FROM domain WHERE domain='%s' AND active = '1' #query = SELECT domain FROM domain WHERE domain='%s' #optional query to use when relaying for backup MX diff --git a/templates/sql/mysql_virtual_mailbox_limit_maps.cf.j2 b/templates/sql/mysql_virtual_mailbox_limit_maps.cf.j2 index c2e0ad1..82b339e 100644 --- a/templates/sql/mysql_virtual_mailbox_limit_maps.cf.j2 +++ b/templates/sql/mysql_virtual_mailbox_limit_maps.cf.j2 @@ -1,5 +1,5 @@ -user = postfix -password = password -hosts = localhost -dbname = postfix +user = {{postfix_postfixadmin_mysql_username}} +password = {{postfix_postfixadmin_mysql_password}} +hosts = {{postfix_postfixadmin_mysql_host}} +dbname = {{postfix_postfixadmin_mysql_database}} query = SELECT quota FROM mailbox WHERE username='%s' AND active = '1' diff --git a/templates/sql/mysql_virtual_mailbox_maps.cf.j2 b/templates/sql/mysql_virtual_mailbox_maps.cf.j2 index 6a75a90..5712ced 100644 --- a/templates/sql/mysql_virtual_mailbox_maps.cf.j2 +++ b/templates/sql/mysql_virtual_mailbox_maps.cf.j2 @@ -1,6 +1,6 @@ -user = postfix -password = password -hosts = localhost -dbname = postfix +user = {{postfix_postfixadmin_mysql_username}} +password = {{postfix_postfixadmin_mysql_password}} +hosts = {{postfix_postfixadmin_mysql_host}} +dbname = {{postfix_postfixadmin_mysql_database}} query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1' #expansion_limit = 100