Skip to main content

ZC buildout recipe to setup zope.sendmail in a Zope2 instance

Project description

Code repository: http://ingeniweb.svn.sourceforge.net/svnroot/ingeniweb/iw.recipe.sendmail

Change history

trunk (2008-05-21)

  • xxx [Ingeniweb]

0.2.3 (2008-05-20)

  • Documentation and history fixed

0.2.2 (2008-05-19)

  • Fix #60: create the package-includes directory if it doesn’t exist [encolpe].

0.2.1 (2007-02-09)

  • Auto include zope.sendmail in generated zcml [gawel].

0.2 (2007-02-09)

  • Added username / password options [gawel].

0.1 (2007-02-09)

  • Created recipe with ZopeSkel [gawel].

Detailed Documentation

Supported options

The recipe supports the following options:

zope2location

A path to a Zope2 instance

name

The name of the mail queue delivery utility. Default to iw.mailer.

host

Your smtp host. Default to localhost.

port

Yout smtp port. Default to 25.

username

Login name if required by smtp server.

password

Password if required by smtp server

mailqueue

A path to an existing directory to create a mailqueue. Default to var/. Be aware that this need to be an absolute path.

Example usage

The PyPI page for zc.buildout contains documentation about the test environment.

http://pypi.python.org/pypi/zc.buildout#testing-support

Below is a skeleton doctest that you can start with when building your own tests.

We’ll start by creating a buildout that uses the recipe:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = mailer
...
... [mailer]
... recipe = iw.recipe.sendmail
... zope2location=parts/zope2
... host = smtp.example.com
... """)

Simulate the Zope2 part:

>>> mkdir('parts','zope2')
>>> mkdir('parts','zope2','etc')

Running the buildout gives us:

>>> print system(buildout)
Installing mailer.
iw.sendmail-configure.zcml: Generated file 'iw.sendmail-configure.zcml'.

And see the results zcml stub:

>>> cat('parts','zope2','etc','package-includes',
...                           'iw.sendmail-configure.zcml')
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:zcml="http://namespaces.zope.org/zcml">
<BLANKLINE>
    <include package="zope.sendmail" file="meta.zcml" />
<BLANKLINE>
    <configure
        xmlns:mail="http://namespaces.zope.org/mail">
<BLANKLINE>
        <mail:smtpMailer
            name="iw.smtp"
            hostname="smtp.example.com"
            port="25"
            />
<BLANKLINE>
        <mail:queuedDelivery
            name="iw.mailer"
            permission="zope.Public"
            mailer="iw.smtp"
            queuePath="/sample-buildout/var/mailqueue"
            />
    </configure>
<BLANKLINE>
    <configure zcml:condition="installed iw.mailhost">
        <include package="iw.mailhost" />
    </configure>
<BLANKLINE>
</configure>

Let’s try with all parameters:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = mailer
...
... [mailer]
... recipe = iw.recipe.sendmail
... zope2location=parts/zope2
... name = mailer
... host = smtp.example2.com
... port = 50
... username = gael
... password = xxx
... mailqueue = ${buildout:directory}
... """)

Running the buildout again:

>>> print system(buildout)
Uninstalling mailer.
Installing mailer.
iw.sendmail-configure.zcml: Generated file 'iw.sendmail-configure.zcml'.

And see the results zcml stub:

>>> cat('parts','zope2','etc','package-includes',
...                           'iw.sendmail-configure.zcml')
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:zcml="http://namespaces.zope.org/zcml">
<BLANKLINE>
    <include package="zope.sendmail" file="meta.zcml" />
<BLANKLINE>
    <configure
        xmlns:mail="http://namespaces.zope.org/mail">
<BLANKLINE>
        <mail:smtpMailer
            name="iw.smtp"
            hostname="smtp.example2.com"
            port="50"
            username="gael"
            password="xxx"
            />
<BLANKLINE>
        <mail:queuedDelivery
            name="mailer"
            permission="zope.Public"
            mailer="iw.smtp"
            queuePath="/sample-buildout/mailqueue"
            />
    </configure>
<BLANKLINE>
    <configure zcml:condition="installed iw.mailhost">
        <include package="iw.mailhost" />
    </configure>
<BLANKLINE>
</configure>

Contributors

Ingeniweb, Gael Pasgrimaud Ingeniweb, Encolpe Degoute

Download

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

iw.recipe.sendmail-0.2.3.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

iw.recipe.sendmail-0.2.3-py2.4.egg (10.2 kB view details)

Uploaded Source

File details

Details for the file iw.recipe.sendmail-0.2.3.tar.gz.

File metadata

File hashes

Hashes for iw.recipe.sendmail-0.2.3.tar.gz
Algorithm Hash digest
SHA256 8e7557c1775f84a7e2a78a6895992378ed3ee811eba76268505fbd1d6be57344
MD5 61974fa856bbeb30786038b4d3b86544
BLAKE2b-256 9d2568333955aff83bf191f6365e023fc447fa21294a6dca31c585ebe7274b82

See more details on using hashes here.

File details

Details for the file iw.recipe.sendmail-0.2.3-py2.4.egg.

File metadata

File hashes

Hashes for iw.recipe.sendmail-0.2.3-py2.4.egg
Algorithm Hash digest
SHA256 8cf328547c08576df96752c4b5f9a4f08ccf10e2e073457a041d7998ca69e104
MD5 17657abfb06be8057aae94a288873606
BLAKE2b-256 0f5d3f185c2c84809166902366577d47b1cb2e5247d0b091879ec11e8c53b85d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page