[vhffs-dev] [2155] updated mx2 exim4 configuration example using the new mail database schema |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 2155
Author: gradator
Date: 2012-04-24 23:01:46 +0200 (Tue, 24 Apr 2012)
Log Message:
-----------
updated mx2 exim4 configuration example using the new mail database schema
Modified Paths:
--------------
trunk/vhffs-doc/config/exim4-mx2/exim4.conf
Modified: trunk/vhffs-doc/config/exim4-mx2/exim4.conf
===================================================================
--- trunk/vhffs-doc/config/exim4-mx2/exim4.conf 2012-04-24 20:53:45 UTC (rev 2154)
+++ trunk/vhffs-doc/config/exim4-mx2/exim4.conf 2012-04-24 21:01:46 UTC (rev 2155)
@@ -1,10 +1,11 @@
-hide pgsql_servers = PGHOST/PGDB/PGUSER/PGPASS
+#hide pgsql_servers = PGHOST/PGDB/PGUSER/PGPASS
+hide pgsql_servers = 127.0.0.1/vhffs/vhffs/vhffs
# Use these query if your MX2 directly uses VHFFS database
-PGSQL_RELAY_DOMAIN = ${lookup pgsql{SELECT mx.domain FROM vhffs_mxdomain mx INNER JOIN vhffs_object o ON o.object_id=mx.object_id WHERE o.state = 6 AND domain = '${quote_pgsql:$domain}'}}
-PGSQL_RELAY_CHECKLOCALPART = ${lookup pgsql{SELECT d.domain FROM vhffs_mxdomain d WHERE d.domain = '${quote_pgsql:$domain}' AND (d.catchall != '' OR EXISTS (SELECT domain FROM vhffs_boxes WHERE domain = '${quote_pgsql:$domain}' AND local_part = '${quote_pgsql:$local_part}' AND state = 6) OR EXISTS (SELECT domain FROM vhffs_forward WHERE domain = '${quote_pgsql:$domain}' AND local_part = '${quote_pgsql:$local_part}') OR EXISTS (SELECT domain FROM vhffs_ml WHERE domain = '${quote_pgsql:$domain}' AND (local_part = '${quote_pgsql:$local_part}' OR local_part || '-request' = '${quote_pgsql:$local_part}')))}}
+#PGSQL_RELAY_DOMAIN = ${lookup pgsql{SELECT mx.domain FROM vhffs_mx mx INNER JOIN vhffs_object omx ON omx.object_id=mx.object_id WHERE mx.domain='${quote_pgsql:$domain}' AND omx.state=6}}
+#PGSQL_RELAY_CHECKLOCALPART = ${lookup pgsql{SELECT mx.domain FROM vhffs_mx mx WHERE mx.domain='${quote_pgsql:$domain}' AND ( EXISTS (SELECT mx.domain FROM vhffs_mx mx INNER JOIN vhffs_mx_catchall ca ON mx.mx_id=ca.mx_id INNER JOIN vhffs_mx_box box ON box.box_id=ca.box_id INNER JOIN vhffs_mx_localpart lpbox ON lpbox.localpart_id=box.localpart_id INNER JOIN vhffs_mx mxbox ON mxbox.mx_id=lpbox.mx_id WHERE mx.domain='${quote_pgsql:$domain}' AND box.state=6) OR EXISTS (SELECT mx.domain FROM vhffs_mx mx INNER JOIN vhffs_mx_localpart lp ON lp.mx_id=mx.mx_id INNER JOIN vhffs_mx_box box ON box.localpart_id=lp.localpart_id WHERE mx.domain='${quote_pgsql:$domain}' AND lp.localpart='${quote_pgsql:$local_part}' AND box.state=6) OR EXISTS (SELECT mx.domain FROM vhffs_mx mx INNER JOIN vhffs_mx_localpart lp ON lp.mx_id=mx.mx_id INNER JOIN vhffs_mx_redirect redir ON redir.localpart_id=lp.localpart_id WHERE mx.domain='${quote_pgsql:$domain}' AND lp.localpart='${quote_pgsql:$local_part}') OR EXISTS (SELECT mx.domain FROM vhffs_mx mx INNER JOIN vhffs_mx_localpart lp ON lp.mx_id=mx.mx_id INNER JOIN vhffs_mx_ml ml ON ml.localpart_id=lp.localpart_id INNER JOIN vhffs_object oml ON oml.object_id=ml.object_id WHERE mx.domain='${quote_pgsql:$domain}' AND (lp.localpart='${quote_pgsql:$local_part}' OR lp.localpart||'-request' = '${quote_pgsql:$local_part}') AND oml.state=6))}}
# Use these query if your MX has a mirrored VHFFS db (using mirror-mx2.pl)
-# PGSQL_RELAY_DOMAIN = ${lookup pgsql{SELECT domain FROM vhffs_mx2domain WHERE domain = '${quote_pgsql:$domain}'}}
-# PGSQL_RELAY_CHECKLOCALPART = ${lookup pgsql{SELECT d.domain FROM vhffs_mx2domain d WHERE d.domain = '${quote_pgsql:$domain}' AND (d.catchall != '' OR EXISTS (SELECT domain FROM vhffs_mx2addresses WHERE domain = '${quote_pgsql:$domain}' AND local_part = '${quote_pgsql:$local_part}'))}}
+PGSQL_RELAY_DOMAIN = ${lookup pgsql{SELECT mx.domain FROM vhffs_mx2 mx WHERE mx.domain='${quote_pgsql:$domain}'}}
+PGSQL_RELAY_CHECKLOCALPART = ${lookup pgsql{SELECT mx.domain FROM vhffs_mx2 mx WHERE mx.domain='${quote_pgsql:$domain}' AND (mx.catchall=true OR EXISTS (SELECT mx.domain FROM vhffs_mx2 mx INNER JOIN vhffs_mx2_localpart lp ON lp.mx_id=mx.mx_id WHERE mx.domain='${quote_pgsql:$domain}' AND lp.localpart='${quote_pgsql:$local_part}'))}}
exim_path = /usr/sbin/exim4
@@ -62,6 +63,7 @@
smtp_banner = "${primary_hostname} ESMTP Vhffs4 Mailer ${tod_full}"
+
begin acl
#acl_whitelist_local_deny:
@@ -165,6 +167,7 @@
accept
+
begin routers
dnslookup_relay_to_domains:
@@ -194,11 +197,11 @@
no_more
#spamcheck_router:
-# driver = accept
-# no_verify
-# domains = PGSQL_VIRTUAL_SPAMCHECK
-# condition = "${if and { {!def:h_X-Spam-Flag:} {!eq {$received_protocol}{spam-scanned}}} {1}{0}}"
-# transport = spamcheck
+# driver = accept
+# no_verify
+# domains = PGSQL_VIRTUAL_SPAMCHECK
+# condition = "${if and { {!def:h_X-Spam-Flag:} {!eq {$received_protocol}{spam-scanned}}} {1}{0}}"
+# transport = spamcheck
system_aliases:
debug_print = "R: system_aliases for $local_part@$domain"
@@ -261,17 +264,17 @@
driver = smtp
#spamcheck:
-# debug_print = "T: spamassassin_pipe for $local_part@$domain"
-# driver = pipe
-# command = /usr/sbin/exim4 -oMr spam-scanned -bS
-# use_bsmtp
-# transport_filter = /usr/bin/spamc -d 192.168.3.50 -p 783
-# home_directory = "/tmp"
-# current_directory = "/tmp"
-# user = Debian-exim
-# group = Debian-exim
-# return_fail_output
-# headers_remove = X-Spam-Flag : X-Spam-Status : X-Spam-Level : X-Spam-Scanned
+# debug_print = "T: spamassassin_pipe for $local_part@$domain"
+# driver = pipe
+# command = /usr/sbin/exim4 -oMr spam-scanned -bS
+# use_bsmtp
+# transport_filter = /usr/bin/spamc -d 192.168.3.50 -p 783
+# home_directory = "/tmp"
+# current_directory = "/tmp"
+# user = Debian-exim
+# group = Debian-exim
+# return_fail_output
+# headers_remove = X-Spam-Flag : X-Spam-Status : X-Spam-Level : X-Spam-Scanned
address_directory:
debug_print = "T: address_directory for $local_part@$domain"
@@ -282,12 +285,14 @@
escape_string = ""
maildir_format
+
begin retry
#* quota_7d
#* quota F,2h,15m; F,3d,1h
* * F,1m,1m; F,4h,1h; G,20h,1h,1.5; F,6d,12h; F,24d,1d
+
begin rewrite
#*@+local_domains ${lookup{${local_part}}lsearch{/etc/email-addresses}\
@@ -297,6 +302,7 @@
# {${lookup{${local_part}}lsearch{CONFDIR/email-addresses}\
# {$value}fail}}fail}" Ffrs
+
begin authenticators
# plain_server: