[vhffs-dev] [1913] now check if mail domain is enabled, prevents bounced mails if users request wrong domains name

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1913
Author:   gradator
Date:     2011-12-11 16:19:24 +0100 (Sun, 11 Dec 2011)
Log Message:
-----------
now check if mail domain is enabled, prevents bounced mails if users request wrong domains name

Modified Paths:
--------------
    branches/vhffs-4.3/vhffs-doc/config/exim4-mx1/00_vhffs-main
    branches/vhffs-4.3/vhffs-doc/config/exim4-mx1/exim4.conf
    branches/vhffs-4.3/vhffs-doc/config/exim4-mx2/00_vhffs
    branches/vhffs-4.3/vhffs-doc/config/exim4-mx2/exim4.conf
    trunk/vhffs-doc/config/exim4-mx1/00_vhffs-main
    trunk/vhffs-doc/config/exim4-mx1/exim4.conf
    trunk/vhffs-doc/config/exim4-mx2/00_vhffs
    trunk/vhffs-doc/config/exim4-mx2/exim4.conf

Modified: branches/vhffs-4.3/vhffs-doc/config/exim4-mx1/00_vhffs-main
===================================================================
--- branches/vhffs-4.3/vhffs-doc/config/exim4-mx1/00_vhffs-main	2011-11-12 23:55:05 UTC (rev 1912)
+++ branches/vhffs-4.3/vhffs-doc/config/exim4-mx1/00_vhffs-main	2011-12-11 15:19:24 UTC (rev 1913)
@@ -3,7 +3,7 @@
 VHFFS_MAIL_HOME=/data/mail/boxes
 
 # Domains handled by VHFFS (no matter if it is by forwarding, mailing listing or local delivering)
-VHFFS_LOCAL_DOMAINS = ${lookup pgsql{SELECT domain FROM vhffs_mxdomain WHERE domain = '${quote_pgsql:$domain}'}}
+VHFFS_LOCAL_DOMAINS = ${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}'}}
 
 # Used to determine if we perform local delivery for the mail we're processing
 VHFFS_VIRTUAL_LOCAL_DOMAINS = ${lookup pgsql{select vhffs_boxes.domain from vhffs_boxes where local_part = '${quote_pgsql:$local_part}' and vhffs_boxes.domain = '${quote_pgsql:$domain}' and vhffs_boxes.state = 6}}

Modified: branches/vhffs-4.3/vhffs-doc/config/exim4-mx1/exim4.conf
===================================================================
--- branches/vhffs-4.3/vhffs-doc/config/exim4-mx1/exim4.conf	2011-11-12 23:55:05 UTC (rev 1912)
+++ branches/vhffs-4.3/vhffs-doc/config/exim4-mx1/exim4.conf	2011-12-11 15:19:24 UTC (rev 1913)
@@ -1,6 +1,6 @@
 hide pgsql_servers = PGHOST/PGDB/PGUSER/PGPASS
 MAIL_HOME=/data/mail/boxes
-PGSQL_LOCAL_DOMAINS = ${lookup pgsql{SELECT DISTINCT domain FROM vhffs_mxdomain WHERE domain = '${quote_pgsql:$domain}'}}
+PGSQL_LOCAL_DOMAINS = ${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_VIRTUAL_LOCAL_DOMAINS = ${lookup pgsql{select vhffs_boxes.domain from vhffs_boxes, vhffs_mxdomain where local_part = '${quote_pgsql:$local_part}' and vhffs_boxes.domain = vhffs_mxdomain.domain and vhffs_mxdomain.domain = '${quote_pgsql:$domain}' and vhffs_boxes.state = 6}}
 PGSQL_VIRTUAL_LOCAL_DIR = MAIL_HOME/${lookup pgsql{select boxes_path from vhffs_mxdomain where domain = '${quote_pgsql:$domain}'}{$value}fail}/${lookup pgsql{select mbox_name from vhffs_boxes where domain = '${quote_pgsql:$domain}' and local_part = '${quote_pgsql:$local_part}'}{$value}fail}/Maildir
 PGSQL_VIRTUAL_FORWARD_DATA = ${lookup pgsql{select remote_name from vhffs_forward, vhffs_mxdomain where local_part = '${quote_pgsql:$local_part}' and vhffs_forward.domain = vhffs_mxdomain.domain and vhffs_mxdomain.domain = '${quote_pgsql:$domain}'}}

Modified: branches/vhffs-4.3/vhffs-doc/config/exim4-mx2/00_vhffs
===================================================================
--- branches/vhffs-4.3/vhffs-doc/config/exim4-mx2/00_vhffs	2011-11-12 23:55:05 UTC (rev 1912)
+++ branches/vhffs-4.3/vhffs-doc/config/exim4-mx2/00_vhffs	2011-12-11 15:19:24 UTC (rev 1913)
@@ -1,7 +1,7 @@
 hide pgsql_servers = 127.0.0.1/vhffs/exim/astrongpass
 
 # Domains to be relayed
-VHFFS_RELAY_DOMAINS = ${lookup pgsql{SELECT domain FROM vhffs_mxdomain WHERE domain = '${quote_pgsql:$domain}'}}
+VHFFS_RELAY_DOMAINS = ${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}'}}
 
 # Checks localparts (to avoid forwarding mail to non-existent boxes).
 VHFFS_VALID_LOCALPARTS = ${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}')))}}

Modified: branches/vhffs-4.3/vhffs-doc/config/exim4-mx2/exim4.conf
===================================================================
--- branches/vhffs-4.3/vhffs-doc/config/exim4-mx2/exim4.conf	2011-11-12 23:55:05 UTC (rev 1912)
+++ branches/vhffs-4.3/vhffs-doc/config/exim4-mx2/exim4.conf	2011-12-11 15:19:24 UTC (rev 1913)
@@ -1,6 +1,6 @@
 hide pgsql_servers = PGHOST/PGDB/PGUSER/PGPASS
 # Use these query if your MX2 directly uses VHFFS database
-PGSQL_RELAY_DOMAIN = ${lookup pgsql{SELECT domain FROM vhffs_mxdomain WHERE domain = '${quote_pgsql:$domain}'}}
+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}')))}}
 # 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}'}}

Modified: trunk/vhffs-doc/config/exim4-mx1/00_vhffs-main
===================================================================
--- trunk/vhffs-doc/config/exim4-mx1/00_vhffs-main	2011-11-12 23:55:05 UTC (rev 1912)
+++ trunk/vhffs-doc/config/exim4-mx1/00_vhffs-main	2011-12-11 15:19:24 UTC (rev 1913)
@@ -3,7 +3,7 @@
 VHFFS_MAIL_HOME=/data/mail/boxes
 
 # Domains handled by VHFFS (no matter if it is by forwarding, mailing listing or local delivering)
-VHFFS_LOCAL_DOMAINS = ${lookup pgsql{SELECT domain FROM vhffs_mxdomain WHERE domain = '${quote_pgsql:$domain}'}}
+VHFFS_LOCAL_DOMAINS = ${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}'}}
 
 # Used to determine if we perform local delivery for the mail we're processing
 VHFFS_VIRTUAL_LOCAL_DOMAINS = ${lookup pgsql{select vhffs_boxes.domain from vhffs_boxes where local_part = '${quote_pgsql:$local_part}' and vhffs_boxes.domain = '${quote_pgsql:$domain}' and vhffs_boxes.state = 6}}

Modified: trunk/vhffs-doc/config/exim4-mx1/exim4.conf
===================================================================
--- trunk/vhffs-doc/config/exim4-mx1/exim4.conf	2011-11-12 23:55:05 UTC (rev 1912)
+++ trunk/vhffs-doc/config/exim4-mx1/exim4.conf	2011-12-11 15:19:24 UTC (rev 1913)
@@ -1,6 +1,6 @@
 hide pgsql_servers = PGHOST/PGDB/PGUSER/PGPASS
 MAIL_HOME=/data/mail/boxes
-PGSQL_LOCAL_DOMAINS = ${lookup pgsql{SELECT DISTINCT domain FROM vhffs_mxdomain WHERE domain = '${quote_pgsql:$domain}'}}
+PGSQL_LOCAL_DOMAINS = ${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_VIRTUAL_LOCAL_DOMAINS = ${lookup pgsql{select vhffs_boxes.domain from vhffs_boxes, vhffs_mxdomain where local_part = '${quote_pgsql:$local_part}' and vhffs_boxes.domain = vhffs_mxdomain.domain and vhffs_mxdomain.domain = '${quote_pgsql:$domain}' and vhffs_boxes.state = 6}}
 PGSQL_VIRTUAL_LOCAL_DIR = MAIL_HOME/${lookup pgsql{select boxes_path from vhffs_mxdomain where domain = '${quote_pgsql:$domain}'}{$value}fail}/${lookup pgsql{select mbox_name from vhffs_boxes where domain = '${quote_pgsql:$domain}' and local_part = '${quote_pgsql:$local_part}'}{$value}fail}/Maildir
 PGSQL_VIRTUAL_FORWARD_DATA = ${lookup pgsql{select remote_name from vhffs_forward, vhffs_mxdomain where local_part = '${quote_pgsql:$local_part}' and vhffs_forward.domain = vhffs_mxdomain.domain and vhffs_mxdomain.domain = '${quote_pgsql:$domain}'}}

Modified: trunk/vhffs-doc/config/exim4-mx2/00_vhffs
===================================================================
--- trunk/vhffs-doc/config/exim4-mx2/00_vhffs	2011-11-12 23:55:05 UTC (rev 1912)
+++ trunk/vhffs-doc/config/exim4-mx2/00_vhffs	2011-12-11 15:19:24 UTC (rev 1913)
@@ -1,7 +1,7 @@
 hide pgsql_servers = 127.0.0.1/vhffs/exim/astrongpass
 
 # Domains to be relayed
-VHFFS_RELAY_DOMAINS = ${lookup pgsql{SELECT domain FROM vhffs_mxdomain WHERE domain = '${quote_pgsql:$domain}'}}
+VHFFS_RELAY_DOMAINS = ${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}'}}
 
 # Checks localparts (to avoid forwarding mail to non-existent boxes).
 VHFFS_VALID_LOCALPARTS = ${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}')))}}

Modified: trunk/vhffs-doc/config/exim4-mx2/exim4.conf
===================================================================
--- trunk/vhffs-doc/config/exim4-mx2/exim4.conf	2011-11-12 23:55:05 UTC (rev 1912)
+++ trunk/vhffs-doc/config/exim4-mx2/exim4.conf	2011-12-11 15:19:24 UTC (rev 1913)
@@ -1,6 +1,6 @@
 hide pgsql_servers = PGHOST/PGDB/PGUSER/PGPASS
 # Use these query if your MX2 directly uses VHFFS database
-PGSQL_RELAY_DOMAIN = ${lookup pgsql{SELECT domain FROM vhffs_mxdomain WHERE domain = '${quote_pgsql:$domain}'}}
+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}')))}}
 # 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}'}}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/