Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install smtp2zope

How to install smtp2zope

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install smtp2zope
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.1
1.2Never BuiltWhy not?
1.1 Available View build log
Windows (64-bit)
1.1
1.2Never BuiltWhy not?
1.1 Available View build log
Mac OS X (10.5+)
1.1
1.2Never BuiltWhy not?
1.1 Available View build log
Linux (32-bit)
1.2 Available View build log
1.1 Available View build log
Linux (64-bit)
1.2 Available View build log
1.1 Available View build log
 
License
GPL
Dependencies
Imports
Lastest release
version 1.2 on Nov 28th, 2012

Introduction

smtp2zope is a script that takes an email as input, does some transformation, and submits it to a backend server using a url. Traditionally, Zope is expected to be the receiving server, hence the name, but should work fine for other servers too.

Originally, the code here comes from the MailBoxer product for Zope.

Usage

When installing this package, a smtp2zope script is generated. The script reads from standard input and expects a url and optional maximum number of bytes as arguments:

smtp2zope URL [MAXBYTES]

URL:

call this URL with the email as a post-request. Authentication can be included in URL: http://username:password@example.org/some-page

MAXBYTES:

optional: only forward mails with a size of less than MAXBYTES to the URL

So a test run could look like this:

cat testmail.txt > /path/to/smtp2zope http://admin:secret@example.org/my-mail-handler
Mail server integration

Mail comes in through a mail server. So when you want mail for mailme@example.org to be handled by smtp2zope and sent to your web server, you should add an alias in your smtp server configuration. Something like this probably works (there might be slight differences depending on which mail server you use):

mailme@example.org "|/path/to/smtp2zope http://admin:secret@example.org/my-mail-handler 1000000"

The number at the end restricts the maximum size of a message; this is optional, but highly recommended.

Debugging

Please note: output is logged to maillog per default on unices. See your maillog (e.g. /var/log/mail.log) to debug problems with the setup.

Buildout

If you like setting up your project with zc.buildout (I myself do), this simple snippet is enough to create the bin/smtp2zope script:

[script]
recipe = zc.recipe.egg
eggs = smtp2zope
Credits
  • Original implementation: Maik Jablonski
  • Packaging: Maurits van Rees

Changelog

1.2 (2012-10-14)
1.1 (2011-05-05)
  • Use a better way to determine the basic authentication information that is passed in the url so the logic does not fail when the url has an @ sign somewhere else. [maurits]
  • Fixed error "local variable 'AUTHORIZATION' referenced before assignment" when not using basic authentication (http://user:pw@example.com). [maurits]
1.0 (2011-05-04)
  • Initial release

Subscribe to package updates

Last updated Nov 28th, 2012

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.