postfix: Use pgsql functions in query templates where possible. v0.6.x
authorPascal Volk <user@localhost.localdomain.org>
Mon, 05 Dec 2011 16:17:01 +0000
branchv0.6.x
changeset 486 ccdfbbb1bb01
parent 485 10e9b4855173
child 487 fb0af82ab4af
postfix: Use pgsql functions in query templates where possible.
postfix/pgsql-relocated_maps.cf
postfix/pgsql-transport.cf
postfix/pgsql-virtual_alias_maps.cf
postfix/pgsql-virtual_mailbox_maps.cf
postfix/pgsql-virtual_uid_maps.cf
--- a/postfix/pgsql-relocated_maps.cf	Mon Dec 05 12:34:29 2011 +0000
+++ b/postfix/pgsql-relocated_maps.cf	Mon Dec 05 16:17:01 2011 +0000
@@ -11,4 +11,9 @@
 dbname = mailsys
 
 # The SQL query template used to search the database
-query = SELECT destination FROM postfix_relocated WHERE address='%s'
+# Use this VIEW-based template if you didn't create the pgsql function
+# `postfix_relocated_map'.
+#query = SELECT destination FROM postfix_relocated WHERE address='%s'
+
+# the recommended, function-based template
+query = SELECT destination FROM postfix_relocated_map('%u', '%d')
--- a/postfix/pgsql-transport.cf	Mon Dec 05 12:34:29 2011 +0000
+++ b/postfix/pgsql-transport.cf	Mon Dec 05 16:17:01 2011 +0000
@@ -11,4 +11,9 @@
 dbname = mailsys
 
 # The SQL query template used to search the database
-query = SELECT transport FROM postfix_transport WHERE address='%s'
+# Use this VIEW-based template if you didn't create the pgsql function
+# `postfix_transport_map'.
+#query = SELECT transport FROM postfix_transport WHERE address='%s'
+
+# the recommended, function-based template
+query = SELECT transport FROM postfix_transport_map('%u', '%d')
--- a/postfix/pgsql-virtual_alias_maps.cf	Mon Dec 05 12:34:29 2011 +0000
+++ b/postfix/pgsql-virtual_alias_maps.cf	Mon Dec 05 16:17:01 2011 +0000
@@ -11,4 +11,9 @@
 dbname = mailsys
 
 # The SQL query template used to search the database
-query = SELECT destination FROM postfix_alias WHERE address='%s'
+# Use this VIEW-based template if you didn't create the pgsql function
+# `postfix_virtual_alias_map'.
+#query = SELECT destination FROM postfix_alias WHERE address='%s'
+
+# the recommended, function-based template
+query = SELECT destination FROM postfix_virtual_alias_map('%u', '%d')
--- a/postfix/pgsql-virtual_mailbox_maps.cf	Mon Dec 05 12:34:29 2011 +0000
+++ b/postfix/pgsql-virtual_mailbox_maps.cf	Mon Dec 05 16:17:01 2011 +0000
@@ -11,4 +11,9 @@
 dbname = mailsys
 
 # The SQL query template used to search the database
-query = SELECT maildir FROM postfix_maildir WHERE address='%s'
+# Use this VIEW-based template if you didn't create the pgsql function
+# `postfix_virtual_mailbox_map'.
+#query = SELECT maildir FROM postfix_maildir WHERE address='%s'
+
+# the recommended, function-based template
+query = SELECT maildir FROM postfix_virtual_mailbox_map('%u', '%d')
--- a/postfix/pgsql-virtual_uid_maps.cf	Mon Dec 05 12:34:29 2011 +0000
+++ b/postfix/pgsql-virtual_uid_maps.cf	Mon Dec 05 16:17:01 2011 +0000
@@ -11,4 +11,9 @@
 dbname = mailsys
 
 # The SQL query template used to search the database
-query = SELECT uid FROM postfix_uid WHERE address='%s'
+# Use this VIEW-based template if you didn't create the pgsql function
+# `postfix_virtual_uid_map'.
+#query = SELECT uid FROM postfix_uid WHERE address='%s'
+
+# the recommended, function-based template
+query = SELECT uid FROM postfix_virtual_uid_map('%u', '%d')