summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Vagelpohl <jens@netz.ooo>2005-02-21 15:40:44 +0000
committerJens Vagelpohl <jens@netz.ooo>2005-02-21 15:40:44 +0000
commit7639cba86be7adbae390d10aa942479f5ab3ff75 (patch)
tree4adf9cf0d42f8cd8b93f07f4a83ee42281e300fa
parent3318c5a37f8d694337ccf9d142b981b470dcc10b (diff)
downloadZoftware-7639cba86be7adbae390d10aa942479f5ab3ff75.zip
Zoftware-7639cba86be7adbae390d10aa942479f5ab3ff75.tar.gz
- Complete revamp of the way the maildrop daemon is run to make it
a little more "enterprise-ready"
-rw-r--r--CHANGES.txt8
-rw-r--r--INSTALL.txt21
-rw-r--r--README.txt68
-rw-r--r--config.py5
-rw-r--r--maildrop/bin/README61
-rw-r--r--maildrop/bin/maildrop-suse4
-rwxr-xr-xmaildrop/bin/start_maildrop4
7 files changed, 122 insertions, 49 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index f8ed95d..fbee253 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -12,6 +12,14 @@ MaildropHost version and change information
- The maildrop daemon now supports both TLS (Transport Layer Security)
and authenticated SMTP.
+ - The maildrop daemon script no longer stays attached to the
+ controlling terminal by default. It detaches correctly unless you
+ set the DEBUG flag inside config.py to 1.
+
+ - Start scripts for RedHat and SuSE are now provided. They work
+ correctly with chkconfig/Yast2 and can be linked into /etc/rc.d
+ (SuSE) or /etc/rc.d/init.d (RedHat)
+
* Bugs fixed:
- More small improvements to the start_maildrop and stop_maildrop
diff --git a/INSTALL.txt b/INSTALL.txt
index 84e3944..d6b6177 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -1,6 +1,6 @@
Installing the MaildropHost Product
- You will need Zope version 2.5.0 beta 4 or higher!
+ You will need Zope version 2.5.0 or higher!
First, you will need to unzip and untar the compressed surce
file into a place where Zope can find it, namely the
@@ -13,15 +13,16 @@ Installing the MaildropHost Product
Do not forget to restart Zope afterwards.
- You will find a shell file named "start_maildrop" in the "maildrop"
- folder inside the MaildropHost product directory. This file contains
- all site-specific settings and it must be executed to start the
- mail spool handler. Without launching this script the mail will simply
- accumulate in the MaildropHost/maildrop/spool folder and never be sent.
+ You will find a file named "config.py" in the toplevel MaildropHost
+ folder. This file contains all site-specific settings and you must
+ edit it to suit your needs. IMPORTANT: Since this file is also
+ sourced by a few shell scripts you must not put any whitespace
+ around equal (=) signs!
- There is a start_maildrop.bat Windows startup script as well, but it
- is not guaranteed to work correctly. It does not read settings out
- of config.py like "start_maildrop". I don't use Windoze and don't
- know how to make it work exactly the same way. You have been warned.
+ Startup scripts for the standalone maildrop daemon, which processes
+ mail items generated by the MaildropHost Zope product, can be found
+ inside the <MaildropHost>/maildrop/bin-folder. What these scripts
+ do and how to use them is described in a separate README inside that
+ folder.
See README.txt for any other dependencies and requirements.
diff --git a/README.txt b/README.txt
index 004ddee..812db7a 100644
--- a/README.txt
+++ b/README.txt
@@ -12,17 +12,22 @@ Maildrop Host
Maildrop Host uses a separate Python process to monitor the mail
spool inside the product and handle mail in intervals that can be
- set by the administrator. There is a separate start script included
+ set by the administrator. There are separate start scripts included
with the product which can be used to start this monitor process.
Mails that cannot be sent successfully stay in the internal spool.
Every attempt to send email is logged to a log file kept by the
- monitor process.
+ monitor process. This log file is closed after each maildrop run,
+ so it is safe to rotate it without sending any special signals to
+ the maildrop daemon.
+
+ The maildrop daemon that delivers mail supports StartTLS and even
+ authenticated SMTP.
**Requirements**
- - a working SMTP server that does not require authentication
+ - a working SMTP server
- python 2.1 or higher
@@ -33,45 +38,40 @@ Maildrop Host
**Usage**
- Follow these steps to use the product after you followed the
- procedures outlined in INSTALL.txt:
-
- - edit the "start_maildrop" script in the maildrop folder to
- adjust the location of the Python binary if needed (the
- default is /usr/local/bin/python).
+ Follow these steps to use the product after you followed the
+ procedures outlined in INSTALL.txt:
- - edit config.py in the top level folder to adjust settings
- such as the SMTP host, polling interval or debug level, these
- settings are used by the maildrop daemon and also read by the
- MaildropHost module during initialization to show them in the
- Zope Management Interface (ZMI).
+ - edit the "config.py" configuration script in the toplevel
+ MaildropHost folder to reflect your particular needs.
- - start the mail spool checker by running the "start_maildrop"
- script.
+ - start the mail spool checker by running the "start_maildrop"
+ script or with the other start scripts included in the package,
+ which can be found in maildrop/bin underneath the toplevel
+ MaildropHost folder.
- - instantiate a Maildrop Host instance in your ZODB
+ - instantiate a Maildrop Host instance in your ZODB
- - Now you can create emails using e.g. the dtml-sendmail tag and
- point the sendmail tag to the Maildrop Host instance using the
- mailhost="XYZ" argument inside the sendmail tag.
+ - Now you can create emails using e.g. the dtml-sendmail tag and
+ point the sendmail tag to the Maildrop Host instance using the
+ mailhost="XYZ" argument inside the sendmail tag, or by using
+ the MailHost API (see the Zope Help System).
- Instead of using dtml-sendmail and a Maildrop Host instance you
- can create email messages any way you like. As long as the formatting
- is correct (so that the mail spool checker can parse it, see
- the file SAMPLE_MAIL.txt for an example) and you write it to the spool
- directory which is located at
- <Zope>/lib/python/Products/MaildropHost/maildrop/spool then the
- mail spool checker will pick it up and try to deliver it.
+ Instead of using dtml-sendmail and a Maildrop Host instance you
+ can create email messages any way you like. As long as the formatting
+ is correct (so that the mail spool checker can parse it, see
+ the file SAMPLE_MAIL.txt for an example) and you write it to the spool
+ directory which is at $MAILDROP_HOME/spool then the mail spool checker
+ will pick it up and try to deliver it.
**Mail file format**
- The format for a mail file (see SAMPLE_MAIL.txt) is very simple. The
- first line contains the recipient address, prefixed by "##To:". The
- second line is the sender address, prefixed by "##From:".
+ The format for a mail file (see SAMPLE_MAIL.txt) is very simple. The
+ first line contains the recipient address, prefixed by "##To:". The
+ second line is the sender address, prefixed by "##From:".
- The next few lines are headers that become part of the message body,
- they are "To: <recipient>", "From: <sender>" and "Subject: <subject>".
-
- The actual message is separated from the headers by a blank line.
+ The next few lines are headers that become part of the message body,
+ they are "To: <recipient>", "From: <sender>" and "Subject: <subject>".
+
+ The actual message is separated from the headers by a blank line.
diff --git a/config.py b/config.py
index 3f4f3b3..e0d8df4 100644
--- a/config.py
+++ b/config.py
@@ -1,11 +1,14 @@
# This file contains configuration data, some of which may be shared
# between the maildrop daemon and the MaildropHost object.
#
-# IMPORTANT NOTE: This file is also sourced by a could shell scripts,
+# IMPORTANT NOTE: This file is also sourced by a couple shell scripts,
# which means you must not have any whitespace around
# equal (=) signs!
#
+# Which python interpreter to use for running the maildrop daemon
+PYTHON="/usr/bin/python"
+
# The working directory keeping the spool and var directories
MAILDROP_HOME="/tmp/maildrop"
diff --git a/maildrop/bin/README b/maildrop/bin/README
new file mode 100644
index 0000000..f7df627
--- /dev/null
+++ b/maildrop/bin/README
@@ -0,0 +1,61 @@
+Start/Stop scripts for the standalone maildrop daemon
+
+ This README explains what the files in this folder do and how to use them.
+ All these scripts depend on you having edited config.py in the toplevel
+ MaildropHost folder to reflect your environment. Some of them require
+ additional editing before use!
+
+ start_maildrop
+
+ Basic start script to start up the maildrop daemon. All configuration
+ is taken from config.py, no additional editing needed.
+
+ stop_maildrop
+
+ Basic stop script to stop the maildrop daemon. No additional editing
+ needed.
+
+ start_maildrop.bat
+
+ Startup script suitable for Windows. Its correctness or working order
+ cannot be guaranteed since I do not use Windows.
+
+ maildrop-redhat
+
+ Combined start/stop script that interoperates with the RedHat way of
+ controlling services and daemons. This script *needs editing* at the
+ top so it knows where to locate the maildrop files when run at
+ startup and it knows what user account to run under.
+
+ Edit the MAILDROP_USER and SOFTWARE_HOME values at the top of the script.
+ Then all you need to do is copy or link it into /etc/rc.d/init.d and
+ ensure that it gets run on system start/system shutdown by using
+ the chkconfig utility, like so::
+
+ $ /sbin/chkconfig --add maildrop-redhat
+
+ This will take care of all activation. You can, as root, use this::
+
+ $ /sbin/service maildrop-redhat {start|stop|restart}
+
+ to control the service.
+
+ maildrop-suse
+
+ Combined start/stop script that interoperates with the SuSE way of
+ controlling services and daemons. This script *needs editing* at the
+ top so it knows where to locate the maildrop files when run at
+ startup and it knows what user account to run under.
+
+ Edit the MAILDROP_USER and SOFTWARE_HOME values at the top of the script.
+ Then all you need to do is copy or link it into /etc/rc.d and
+ ensure that it gets run on system start/system shutdown by using
+ the chkconfig utility, like so::
+
+ $ /sbin/chkconfig --add maildrop-suse
+
+ This will take care of all activation. You can, as root, use this::
+
+ $ /etc/rc.d/maildrop-suse {start|stop|restart}
+
+ to control the service.
diff --git a/maildrop/bin/maildrop-suse b/maildrop/bin/maildrop-suse
index fdf7ef4..fda6845 100644
--- a/maildrop/bin/maildrop-suse
+++ b/maildrop/bin/maildrop-suse
@@ -10,7 +10,7 @@
# Required-Stop: $remote_fs
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
-# Description: This shell script takes care of starting and stopping a ZEO client
+# Description: maildrop daemon start/stop script
### END INIT INFO
############################################################
@@ -34,7 +34,7 @@ SOFTWARE_HOME="/home/zope/opt/MaildropHost-HEAD"
name=Maildrop
conf="$SOFTWARE_HOME/config.py"
-test -x $conf || exit 5
+test -f $conf || exit 5
. /etc/rc.status
rc_reset
diff --git a/maildrop/bin/start_maildrop b/maildrop/bin/start_maildrop
index b0f5865..499f88f 100755
--- a/maildrop/bin/start_maildrop
+++ b/maildrop/bin/start_maildrop
@@ -16,7 +16,7 @@ MAILDROPHOME=`dirname $reldir`
parent=`dirname $MAILDROPHOME`
CONFIG="$parent/config.py"
-# Where is the python executable?
-PYTHON="/usr/bin/python"
+# Get the configuration (esp. $PYTHON)
+. $CONFIG
exec $PYTHON $MAILDROPHOME/maildrop.py "$CONFIG"