[Zope3-dev] SMTP Service

Steve Alexander steve@cat-box.net
Tue, 22 Apr 2003 16:01:03 +0200


> On remark about Zwiki and mailing. I was surprised that the notification
> worked out of the box, i didn't need to specify a MailHost. In wikipage.py
> 
>         server = smtplib.SMTP(self.host, self.port)
>         server.set_debuglevel(0)
>         server.sendmail('wiki@zope3.org', emails, msg)
>         server.quit()
> 
> I think Zope 3 should also use a component for (asynchronous) sending
> e-mail, rather than letting each application use smtplib. The
> component can then be configured to use a mailhost, and to use an
> appropriate domainname.

Yep. We need a "Sending mail out" service.

There was an SMTP Service in CVS several months ago, but it was removed 
because the whole thing needed more thinking about.


I think an SMTP Service for Zope 3 should be a global service, and 
should be configured per-process by ZConfig.
So, if I have several ZEO storage clients in different locations, each 
can be configured to use an SMTP server that is local to its process.

Ideally and SMTP service should work "transactionally", so that mail is 
only sent out on a successfully committed transaction.

It should be queued, so that sending the mail out need not be completed 
before the transaction is completed. Pending mail could be cached on the 
filesystem using a MailDir-style system to make things work 
transactionally, and to make things recoverable when bad things happen.

The API for the SMTP Service should have two parts: A "dead simple" API 
for use from simple scripts that offers the simple things people most 
often need.
Also, a "complete" API that looks a lot like the 'email' package from 
the Python standard library.

It might be nice to allow the default SMTP Service to be replaced with 
one that uses MailMan for sending mail, and also has ZConfig options to 
make this easy.

--
Steve Alexander