MailNode
Category: Communication, Miscellaneous
—
Other products by this author
Current release: MailNode 0.1.0
Released Apr 28, 2006 — tested with Plone 2.1.2, Plone 2.1.1, Plone 2.1, Plone 2.0.5, Plone 2.0.4, Plone 2.0.3, Plone 2.0.2, Plone 2.0.1, Plone 2.0, Zope 2.8.4, Zope 2.8, Zope 2.7.8, Zope 2.7
Initial release
Experimental releases
There are no experimental releases available at the moment.
Project Description
- Project resources
Introduction
Mailnode is a simple Zope item that provides :
- A python module that can send mails with file attachments
- Another python module that can check an error mailbox and notify the application if the sending goes wrong
Configuration
In the 'properties tab' of the zope Mailnode object :
- from_address : expeditor email address
- charset : character encoding
- pop_server, pop_username, pop_password : error mailbox informations
- error_callback : name of the function called on error (by acquisition)
Synopsis
Call structure in Zope (return a msg-id) :
parameters = {
'to': 'receiver@mail.com',
'subject': 'Sujet du mail',
'body': """Le corps du mail
sur plusieurs lignes""",
'attachment': ['/home/user/document.pdf', fd2, 'fichier3.pdf', ...]
}
context.Mailnode.sendMail(parameters)
Errors control
In a second time, Mailnode can check periodically an 'error' POP mailbox, to take care of the sending problems.
Concept :
- Periodically, an external program calls the 'check' method on the Mailnode Item, in Zope. (cron + wget)
- This method connects to the mailserver server and pops the error messages
- For every message, the msg-id is located by text analysis.
- The 'check' method triggers the method defined in the 'error_callback' properties, giving the msg-id as an argument.