summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Vagelpohl <jens@netz.ooo>2004-11-15 16:16:45 +0000
committerJens Vagelpohl <jens@netz.ooo>2004-11-15 16:16:45 +0000
commit2c2420e012e82c556e8d7d781bef15c429f05889 (patch)
treefc016363bcd16c0d6d6a84240f42873bf294db3e
parent82a1f0e0226e90a84b27583ff32ae49fc1a00ad6 (diff)
downloadViewsManager-2c2420e012e82c556e8d7d781bef15c429f05889.zip
ViewsManager-2c2420e012e82c556e8d7d781bef15c429f05889.tar.gz
- Make maildrop spool directory centrally configurable
-rw-r--r--CHANGES.txt9
-rw-r--r--MaildropHost.py7
-rw-r--r--VERSION.txt2
-rw-r--r--config.py3
-rw-r--r--dtml/manageMaildropHost.dtml9
-rwxr-xr-xmaildrop/start_maildrop5
6 files changed, 27 insertions, 8 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 314baae..62c4a4a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,13 @@
MaildropHost version and change information
+
+ 1.9
+
+ * Bugs fixed:
+
+ - Remove the hardcoded spool location in favor of a configuration
+ inside config.py that can be reached/used by the rest of the
+ code. The spool location is shown in the ZMI, too. Most of the
+ work done by Jan-Wijbrand Kolman - thanks! (JTracker issue 398)
1.8
diff --git a/MaildropHost.py b/MaildropHost.py
index 8bc48ab..2edae5e 100644
--- a/MaildropHost.py
+++ b/MaildropHost.py
@@ -19,12 +19,12 @@ from AccessControl import ClassSecurityInfo
from Products.MailHost.MailHost import MailHost
# MaildropHost package imports
-from config import SMTP_HOST, SMTP_PORT, POLLING, DEBUG
+from config import MAILDROP_HOME, SMTP_HOST, SMTP_PORT, POLLING, DEBUG
-MAILDROP_SPOOL = os.path.join(package_home(globals()), 'maildrop', 'spool')
+MAILDROP_SPOOL = os.path.join(MAILDROP_HOME, 'spool')
if not os.path.isdir(MAILDROP_SPOOL):
- os.mkdir(MAILDROP_SPOOL)
+ os.makedirs(MAILDROP_SPOOL)
def makeTempPath():
""" Helper to create a temp file name safely """
@@ -60,6 +60,7 @@ class MaildropHost(MailHost):
smtp_port = SMTP_PORT
debug = DEBUG
polling = POLLING
+ spool = MAILDROP_SPOOL
manage_options = (
( { 'label' : 'Edit', 'action' : 'manage_main'
diff --git a/VERSION.txt b/VERSION.txt
index 6259340..2e0e38c 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-1.8
+1.9
diff --git a/config.py b/config.py
index 1150a6d..174d484 100644
--- a/config.py
+++ b/config.py
@@ -1,6 +1,9 @@
# This file contains configuration data, some of which may be shared
# between the maildrop daemon and the MaildropHost object.
+# The working directory keeping the spool and var directories
+MAILDROP_HOME="/tmp/maildrop"
+
# The SMTP server to be used for sending out email (e.g. smtp-relay.domain.com)
SMTP_HOST="localhost"
diff --git a/dtml/manageMaildropHost.dtml b/dtml/manageMaildropHost.dtml
index 3c28852..e9f6a32 100644
--- a/dtml/manageMaildropHost.dtml
+++ b/dtml/manageMaildropHost.dtml
@@ -87,6 +87,15 @@
<tr>
<td align="left" valign="top"><div class="form-label">
+ Spool location
+ </div></td>
+ <td align="left" valign="top"><div class="form-text">
+ &dtml-spool;
+ </div></td>
+ </tr>
+
+ <tr>
+ <td align="left" valign="top"><div class="form-label">
Spool polling interval
</div></td>
<td align="left" valign="top"><div class="form-text">
diff --git a/maildrop/start_maildrop b/maildrop/start_maildrop
index eb16d0b..6d3924d 100755
--- a/maildrop/start_maildrop
+++ b/maildrop/start_maildrop
@@ -3,10 +3,7 @@
#
# Start script to run the maildrop python process
#
-
-# Set the maildrop main directory
reldir=`dirname $0`
-MAILDROP_HOME=$reldir
# Source the main configuration file
. ../config.py
@@ -16,7 +13,7 @@ PYTHON="/usr/bin/python"
export MAILDROP_HOME SMTP_HOST SMTP_PORT POLLING BATCH PYTHON
-exec $PYTHON $MAILDROP_HOME/maildrop.py \
+exec $PYTHON $reldir/maildrop.py \
-h $MAILDROP_HOME \
-s $SMTP_HOST \
-p $SMTP_PORT \