Skip to main content

Recipe to install and setup maildrophost server

Project description

infrae.maildrophost is used to configure a maildrophost server and MaildropHost product using the same configuration, and create a management script for the maildrophost server.

In addition to those tasks, it used to download and install MaildropHost when it was not distributed as an egg. If you are looking for those features, please have a look at the version 1.x of this recipe.

Example in buildout:

parts =

recipe = infrae.maildrophost
smtp_host = localhost
smtp_port = 25

eggs +=
zope-conf-additional +=
<product-config maildrophost>
  config-path-application ${maildrophost:maildrophost.cfg}

This will create the configuration file maildrophost.cfg for the daemon, and put a start/stop script in the bin directory of the buildout tree.

Spool and PID files are put by default in the var/maildrop directory, so data is preserved when update (if there is any data).


You can customize some of settings of MaildropHost:

Directory to use as home directory for the deamon. By default it’s ${buildout:directory}/var/maildrop It will be created if it doesn’t exists.
Directory to use as a spool. By default it will be ${mail_dir}/spool. The directory will be created if it doesn’t exist already.
PID file to use for the daemon. By default it will be ${mail_dir}/
SMTP server to use. Default to localhost.
Port to use. Default to default SMTP port, 25.
If the SMTP server require authentication, login to use.
If the SMTP server require authentication, password to use.
If 1, MaildropHost will be speaking to a TLS enabled SMTP server.
Add a message id to the sent mail.
Must be an integer which define the interval in seconds between two check for new mail in the spool directory. Default is 120 seconds.
Must be an interger or float which say how much time the daemon should wait between sending two mails to the mail server.
If 1, the internal maildrop script will remain running in the foreground. This is mostly useful when you start the main maildrophost script itself on the foreground with bin/maildrophost fg. See the Configuration for supervisor section.
Specify an alternative path for storing the generated maildrophost.cfg file. Note that this file gets rewritten each time you run buildout. The default value is ${buildout:directory}/maildrophost.cfg.

Configuration for supervisor

Buildout generates a bin/maildrophost script (if you use maildrophost as the name of the buildout section). When calling bin/maildrophost start this script does some checks and basically calls python maildrophost.cfg and quits, without waiting to for the script to exit properly. The script creates a fork of itself and exits.

This is not helpful when you want to use maildrophost in combination with supervisor. If you want to do that you should enable the supervised_daemon option and let supervisor start the maildrophost script on the foreground. Sample config would be this:

recipe = infrae.maildrophost
smtp_host = localhost
smtp_port = 25
supervised_daemon = 1

recipe = collective.recipe.supervisor
programs =
    40 maildrop ${buildout:directory}/bin/maildrophost [fg] true

Latest version

The latest version is available in a Subversion repository.


2.2 (2013-10-07)

  • Add fg command line option to start the script on the foreground. For best results, combine this with enabling the supervised_daemon option. Patch provided by Maurits van Rees from Zest Software.

2.1 (2013-08-19)

  • Update recipe to include the deamon script itself and update it to work with Python 2.6 and 2.7. This script used to require Python 2.4.
  • Update the start/stop script to be more reliable with the help of psutil.

2.0 (2012-08-23)

  • Update recipe to work with the egg distribution of MaildropHost, still creating the configuration and start/stop script for the daemon in buildout.

1.2 (2009-02-13)

  • Fix download-cache vs download-directory. Don’t assume the user already set it.
  • Add options wait_interval, add_messageid, batch, tls, pid_file, spool_dir, mail_dir.
  • Remove the relative to buildout directory option mail-dir which was almost useless.
  • Improve the control script.

1.1 (2009-01-23)

  • Added support for MaildropHost >= 1.22 (added a version option, so the recipe can guess the config file name)


  • Fix the config file for Windows paths.


  • Define the location in options, so you could refer to the product folder with ${maildrophost:location} for exemple.
  • Add the target option to use a specific destination folder for the product.
  • Add maildrophost options login, password, and poll_interval.


  • First release, download and install MaildropHost product, make a and create simple script for start and stop purpose.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

infrae.maildrophost-2.2.tar.gz (12.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page