From dc48ab33efda6f56c30d408182cfec868ef4d91f Mon Sep 17 00:00:00 2001
From: xaver <xaver@ispconfig3>
Date: Sat, 24 Mar 2012 09:01:29 -0400
Subject: [PATCH] Bug #2143, wrong filter url

---
 server/scripts/run-getmail.sh |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/server/scripts/run-getmail.sh b/server/scripts/run-getmail.sh
index 998ecab..0ab8cc5 100644
--- a/server/scripts/run-getmail.sh
+++ b/server/scripts/run-getmail.sh
@@ -1,13 +1,20 @@
 #!/bin/sh
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
 set -e
 cd /etc/getmail
 rcfiles=""
 for file in *.conf ; do
-if [ $file != "*.conf" ]; then
-rcfiles="$rcfiles -r $file"
-fi
+  if [ $file != "*.conf" ]; then
+    rcfiles="$rcfiles -r $file"
+  fi
 done
 #echo $rcfiles
-if [ "$rcfiles" != "" ]; then
-exec /usr/bin/getmail -n -v -g /etc/getmail $rcfiles
-fi
\ No newline at end of file
+if [ -f /tmp/.getmail_lock ]; then
+  echo 'Found getmail lock file /tmp/.getmail_lock, we quit here.'
+else
+  touch /tmp/.getmail_lock
+  if [ "$rcfiles" != "" ]; then
+    /usr/bin/getmail -v -g /etc/getmail $rcfiles
+  fi
+  rm -f /tmp/.getmail_lock
+fi

--
Gitblit v1.9.1