From ebd0e986ed11f2a34fb58cdd33efbfab192083ad Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Fri, 22 Apr 2016 05:26:17 -0400
Subject: [PATCH] Added PHP 7 check in installer and updater.

---
 install/tpl/mailfilter.master |   49 ++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/install/tpl/mailfilter.master b/install/tpl/mailfilter.master
index 6333fa1..ba0e945 100644
--- a/install/tpl/mailfilter.master
+++ b/install/tpl/mailfilter.master
@@ -5,10 +5,21 @@
 LOGNAME=tolower("$LOGNAME")
 EXTENSION="$1"
 RECIPIENT=tolower("$2")
-USER="$3"
-HOST="$4"
+USER=tolower("$3")
+HOST=tolower("$4")
 SENDER="$5"
 DEFAULT="{dist_postfix_vmail_mailbox_base}/$HOST/$USER/."
+
+# Workaround for broken tolower function in some current fedora releases
+
+if(!$USER)
+{
+  USER=$3
+}
+if(!$HOST)
+{
+  HOST=$4
+}
 
 if ( "$EXTENSION" ne "" )
 {
@@ -24,30 +35,46 @@
 # Autocreate maildir, if not existant
 #
 
-`test -e {dist_postfix_vmail_mailbox_base}/$HOST`
-if ( $RETURNCODE != 0 )
+#`test -e {dist_postfix_vmail_mailbox_base}/$HOST`
+#if ( $RETURNCODE != 0 )
+#{
+#  `mkdir {dist_postfix_vmail_mailbox_base}/$HOST`
+#}
+
+#`test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
+#if ( $RETURNCODE != 0 )
+#{
+#  `maildirmake {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
+#  `chmod -R 0700 {dist_postfix_vmail_mailbox_base}/$HOST`
+#}
+
+# Check if the user has a autoresponder enabled
+
+`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder`
+if ( $RETURNCODE == 0 )
 {
-  `mkdir {dist_postfix_vmail_mailbox_base}/$HOST`
+  include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder"
 }
 
+# Create a mailsize file
 `test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
-if ( $RETURNCODE != 0 )
+if ( $RETURNCODE == 0 )
 {
-  `maildirmake {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
-  `chmod -R 0700 {dist_postfix_vmail_mailbox_base}/$HOST`
+`echo $SIZE >> {dist_postfix_vmail_mailbox_base}/$HOST/$USER/ispconfig_mailsize`
 }
+
 
 #
-# Check that user has his own maildrop include,
+# Test if the user has his own maildrop include,
 # if not available, check if $DEFAULT is set
 # (newer maildrop get's that from the DB and updates
 # it) and deliver or fail temporarily if not available
 #
 
-`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$LOGNAME`
+`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter`
 if ( $RETURNCODE == 0 )
 {
-  include "{dist_postfix_vmail_mailbox_base}/mailfilters/$LOGNAME"
+  include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter"
 }
 else
 {

--
Gitblit v1.9.1