summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Vagelpohl <jens@dataflake.org>2011-12-18 22:22:05 +0100
committerJens Vagelpohl <jens@dataflake.org>2011-12-18 22:22:05 +0100
commitc6e2ba03ae2cd78b03c1e257049bcf4c8f4cde88 (patch)
treec76bd215d521ceb392050292688f7ae891d1f3ec
parent2a74950907551f2994c243740207936a1e2d7323 (diff)
downloadProducts.MaildropHost-master.zip
Products.MaildropHost-master.tar.gz
- Miscellaneous: The code is now hosted in a Git repositoryHEADmaster
- Refactoring: All documentary text files have moved to the egg root. - Refactoring: Added a simple buildout configuration
-rw-r--r--CHANGES.txt (renamed from Products/MaildropHost/CHANGES.txt)6
-rw-r--r--COPYRIGHT.txt (renamed from Products/MaildropHost/COPYRIGHT.txt)0
-rw-r--r--HISTORY.txt (renamed from Products/MaildropHost/HISTORY.txt)0
-rw-r--r--INSTALL.txt (renamed from Products/MaildropHost/INSTALL.txt)0
-rw-r--r--LICENSE.txt (renamed from Products/MaildropHost/LICENSE.txt)0
-rw-r--r--Products/MaildropHost/README.txt119
-rw-r--r--Products/MaildropHost/VERSION.txt1
-rw-r--r--README.txt111
-rw-r--r--SAMPLE_MAIL.txt (renamed from Products/MaildropHost/SAMPLE_MAIL.txt)0
-rw-r--r--bootstrap.py121
-rw-r--r--buildout.cfg12
-rw-r--r--setup.py29
12 files changed, 268 insertions, 131 deletions
diff --git a/Products/MaildropHost/CHANGES.txt b/CHANGES.txt
index f4b68f4..7268464 100644
--- a/Products/MaildropHost/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,12 @@ MaildropHost change log
2.4 (unreleased)
----------------
+- Miscellaneous: The code is now hosted in a Git repository
+
+- Refactoring: All documentary text files have moved to the
+ egg root.
+
+- Refactoring: Added a simple buildout configuration
- Bug: Convert imports from Globals to silence deprecation
warnings under Zope 2.12
diff --git a/Products/MaildropHost/COPYRIGHT.txt b/COPYRIGHT.txt
index 4e275c2..4e275c2 100644
--- a/Products/MaildropHost/COPYRIGHT.txt
+++ b/COPYRIGHT.txt
diff --git a/Products/MaildropHost/HISTORY.txt b/HISTORY.txt
index 2928326..2928326 100644
--- a/Products/MaildropHost/HISTORY.txt
+++ b/HISTORY.txt
diff --git a/Products/MaildropHost/INSTALL.txt b/INSTALL.txt
index 7f12187..7f12187 100644
--- a/Products/MaildropHost/INSTALL.txt
+++ b/INSTALL.txt
diff --git a/Products/MaildropHost/LICENSE.txt b/LICENSE.txt
index 89be00b..89be00b 100644
--- a/Products/MaildropHost/LICENSE.txt
+++ b/LICENSE.txt
diff --git a/Products/MaildropHost/README.txt b/Products/MaildropHost/README.txt
deleted file mode 100644
index 10ec744..0000000
--- a/Products/MaildropHost/README.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-=======================
- Products.MaildropHost
-=======================
-
-.. contents::
-
-The MaildropHost product provides support for sending email from
-within the Zope environment using MaildropHost objects. Unlike the
-built-in MailHost object, the sending is done asynchronously from
-a separate process. Furthermore, MaildropHost can optionally
-integrate with the Zope transaction machinery to ensure that
-retried transactions do not lead to multiple emails being created.
-
-The advantage is that sending mail from within web pages becomes
-much faster because invoking the mail machinery can be slow. With
-MaildropHost the web page will return immediately.
-
-MaildropHost 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 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. 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.
-
-Starting with Zope version 2.11.0-beta the standard MailHost
-implementation does asynchronous mail handling as well. If you run
-Zope 2.11 and up you should look at the standard MailHost product
-first and see if it fits your requirement before installing the
-MaildropHost product.
-
-Bug tracker
-===========
-
-Please post questions, bug reports or feature requests to the bug tracker
-at http://www.dataflake.org/tracker/
-
-SVN version
-===========
-
-You can retrieve the latest code from Subversion using setuptools or
-zc.buildout via this URL:
-
-http://svn.dataflake.org/svn/Products.MaildropHost/trunk#egg=Products.MaildropHost
-
-
-Usage
-=====
-
-Follow these steps to use the product after installation:
-
-- edit the "config" configuration script in the toplevel
- MaildropHost folder to reflect your particular needs, or
- (optionally) add your own config file in a different location
- on the filesystem. See below for how to use a configuration
- file from a non-standard location.
-
-- 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. Edit the startup script to point to your
- chosen configuration file.
-
-- instantiate a MaildropHost instance in your ZODB; if you
- created a config file in a different location, specify the
- filesystem path using the 'Configuration file path' setting
- on the ZMI 'Edit' tab.
-
-- Now you can create emails using e.g. the dtml-sendmail tag and
- point the sendmail tag to the MaildropHost 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 MaildropHost 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 (or $MAILDROP_SPOOL if
-defined) then the mail spool checker will pick it up and try to
-deliver it.
-
-To add more choices to the 'Configuration file path' option in
-the ZMI, you need to add them to your Zope instance configuration
-file, zope.conf. You need to create a section named 'product-config
-maildrophost' and list paths as keys starting with 'config-path'::
-
- <product-config maildrophost>
- config-path-1 /tmp/myconfig
- config-path-2 /usr/local/mail/maildropconfig
- </product-config>
-
-The keys must be unique since ZConfig does not allow duplicate keys in
-a 'product-config' configuration section. You have to restart Zope
-for those changes to be visible in the ZMI.
-
-If you use different MaildropHost configurations you will need to
-copy the start/stop scripts found in maildrop/bin and adjust the
-configuration file path accordingly.
-
-
-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:". These are
-equivalent to the "envelope" sender and receiver addresses.
-
-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/Products/MaildropHost/VERSION.txt b/Products/MaildropHost/VERSION.txt
deleted file mode 100644
index c7659c1..0000000
--- a/Products/MaildropHost/VERSION.txt
+++ /dev/null
@@ -1 +0,0 @@
-2.4dev
diff --git a/README.txt b/README.txt
index b046fc1..84d767c 100644
--- a/README.txt
+++ b/README.txt
@@ -1 +1,110 @@
-(See Products/MaildropHost/README.txt).
+=======================
+ Products.MaildropHost
+=======================
+
+.. contents::
+
+The MaildropHost product provides support for sending email from
+within the Zope environment using MaildropHost objects. Unlike the
+built-in MailHost object, the sending is done asynchronously from
+a separate process. Furthermore, MaildropHost can optionally
+integrate with the Zope transaction machinery to ensure that
+retried transactions do not lead to multiple emails being created.
+
+The advantage is that sending mail from within web pages becomes
+much faster because invoking the mail machinery can be slow. With
+MaildropHost the web page will return immediately.
+
+MaildropHost 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 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. 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.
+
+Starting with Zope version 2.11.0-beta the standard MailHost
+implementation does asynchronous mail handling as well. If you run
+Zope 2.11 and up you should look at the standard MailHost product
+first and see if it fits your requirement before installing the
+MaildropHost product.
+
+Bug tracker
+===========
+
+Please post questions, bug reports or feature requests to the bug tracker
+at http://www.dataflake.org/tracker/
+
+Usage
+=====
+
+Follow these steps to use the product after installation:
+
+- edit the "config" configuration script in the toplevel
+ MaildropHost folder to reflect your particular needs, or
+ (optionally) add your own config file in a different location
+ on the filesystem. See below for how to use a configuration
+ file from a non-standard location.
+
+- 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. Edit the startup script to point to your
+ chosen configuration file.
+
+- instantiate a MaildropHost instance in your ZODB; if you
+ created a config file in a different location, specify the
+ filesystem path using the 'Configuration file path' setting
+ on the ZMI 'Edit' tab.
+
+- Now you can create emails using e.g. the dtml-sendmail tag and
+ point the sendmail tag to the MaildropHost 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 MaildropHost 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 (or $MAILDROP_SPOOL if
+defined) then the mail spool checker will pick it up and try to
+deliver it.
+
+To add more choices to the 'Configuration file path' option in
+the ZMI, you need to add them to your Zope instance configuration
+file, zope.conf. You need to create a section named 'product-config
+maildrophost' and list paths as keys starting with 'config-path'::
+
+ <product-config maildrophost>
+ config-path-1 /tmp/myconfig
+ config-path-2 /usr/local/mail/maildropconfig
+ </product-config>
+
+The keys must be unique since ZConfig does not allow duplicate keys in
+a 'product-config' configuration section. You have to restart Zope
+for those changes to be visible in the ZMI.
+
+If you use different MaildropHost configurations you will need to
+copy the start/stop scripts found in maildrop/bin and adjust the
+configuration file path accordingly.
+
+
+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:". These are
+equivalent to the "envelope" sender and receiver addresses.
+
+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/Products/MaildropHost/SAMPLE_MAIL.txt b/SAMPLE_MAIL.txt
index c8e2b10..c8e2b10 100644
--- a/Products/MaildropHost/SAMPLE_MAIL.txt
+++ b/SAMPLE_MAIL.txt
diff --git a/bootstrap.py b/bootstrap.py
new file mode 100644
index 0000000..929bdad
--- /dev/null
+++ b/bootstrap.py
@@ -0,0 +1,121 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id$
+"""
+
+import os, shutil, sys, tempfile, urllib2
+from optparse import OptionParser
+
+tmpeggs = tempfile.mkdtemp()
+
+is_jython = sys.platform.startswith('java')
+
+# parsing arguments
+parser = OptionParser()
+parser.add_option("-v", "--version", dest="version",
+ help="use a specific zc.buildout version")
+parser.add_option("-d", "--distribute",
+ action="store_true", dest="distribute", default=False,
+ help="Use Distribute rather than Setuptools.")
+
+parser.add_option("-c", None, action="store", dest="config_file",
+ help=("Specify the path to the buildout configuration "
+ "file to be used."))
+
+options, args = parser.parse_args()
+
+# if -c was provided, we push it back into args for buildout' main function
+if options.config_file is not None:
+ args += ['-c', options.config_file]
+
+if options.version is not None:
+ VERSION = '==%s' % options.version
+else:
+ VERSION = ''
+
+USE_DISTRIBUTE = options.distribute
+args = args + ['bootstrap']
+
+to_reload = False
+try:
+ import pkg_resources
+ if not hasattr(pkg_resources, '_distribute'):
+ to_reload = True
+ raise ImportError
+except ImportError:
+ ez = {}
+ if USE_DISTRIBUTE:
+ exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
+ ).read() in ez
+ ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True)
+ else:
+ exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+ if to_reload:
+ reload(pkg_resources)
+ else:
+ import pkg_resources
+
+if sys.platform == 'win32':
+ def quote(c):
+ if ' ' in c:
+ return '"%s"' % c # work around spawn lamosity on windows
+ else:
+ return c
+else:
+ def quote (c):
+ return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws = pkg_resources.working_set
+
+if USE_DISTRIBUTE:
+ requirement = 'distribute'
+else:
+ requirement = 'setuptools'
+
+if is_jython:
+ import subprocess
+
+ assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
+ quote(tmpeggs), 'zc.buildout' + VERSION],
+ env=dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse(requirement)).location
+ ),
+ ).wait() == 0
+
+else:
+ assert os.spawnle(
+ os.P_WAIT, sys.executable, quote (sys.executable),
+ '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse(requirement)).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout' + VERSION)
+import zc.buildout.buildout
+zc.buildout.buildout.main(args)
+shutil.rmtree(tmpeggs)
diff --git a/buildout.cfg b/buildout.cfg
new file mode 100644
index 0000000..93990a5
--- /dev/null
+++ b/buildout.cfg
@@ -0,0 +1,12 @@
+# This buildout is used for development of Products.MaildropHost
+# It gets the necessary eggs and creates a test runner and a python
+# interpreter.
+
+[buildout]
+develop = .
+parts = test
+
+[test]
+recipe = zc.recipe.testrunner
+defaults = ['-cv']
+eggs = Products.MaildropHost
diff --git a/setup.py b/setup.py
index 3ef1a98..1a84992 100644
--- a/setup.py
+++ b/setup.py
@@ -1,24 +1,33 @@
-""" Setup info for Products.MaildropHost
+#############################################################################
+#
+# Copyright (c) 2009-2011 Jens Vagelpohl and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
-$Id$
-"""
+__version__ = '2.4dev'
import os
from setuptools import find_packages
from setuptools import setup
-NAME = 'MaildropHost'
+NAME = 'Products.MaildropHost'
here = os.path.abspath(os.path.dirname(__file__))
-package = os.path.join(here, 'Products', NAME)
def _read(name):
- f = open(os.path.join(package, name))
+ f = open(os.path.join(here, name))
return f.read()
_boundary = '\n' + ('-' * 60) + '\n\n'
-setup(name='Products.%s' % NAME,
- version=_read('VERSION.txt').strip(),
+setup(name=NAME,
+ version=__VERSION__,
description="Asynchronous transaction-aware MailHost replacement for Zope 2",
long_description=( _read('README.txt')
+ _boundary
@@ -48,11 +57,11 @@ setup(name='Products.%s' % NAME,
include_package_data=True,
zip_safe=False,
install_requires=[
- # Zope >= 2.8
'setuptools',
+ 'Zope2',
],
entry_points="""
[zope2.initialize]
- Products.%s = Products.%s:initialize
+ %s = %s:initialize
""" % (NAME, NAME),
)