> Hi,
> We (NIP - in the form of Chris Withers, Stephen Harrison, and Simon 
> Coles) have put some thought into the question of how to get emails 
> into Zope, and have come up with a design which we thought we'd pass 

Excellent idea. I was thinking about this just the other day.  We have
a mailing list for a project, and it would be nice to drop in an
email archive into the zope site we are using internally.

> by the list before we start doing something.
> The problem we are trying to solve is basically being to email 
> "[EMAIL PROTECTED]" and that email ends up in the Zope ZODB 
> processed in whatever way is appropriate.
> We aren't worried about sending email, that's done well at the 
> moment. We also wanted to keep things as simple and quick as possible 
> :-) This means trying to avoid getting involved with mail systems as 
> much as we can.
> Most MTAs can be setup to pass an email to the stdin of a program. 
> Sendmail will do this, and Exim (http://www.exim.org/) will also pay 
> attention to what that program returns and queue the message for 
> re-try later if it fails. So using Exim, we don't have to get into 
> any messy stuff about queuing mails if the Zope server is down.
> Some alternatives we considered and didn't go for:
>       - write something in Zope to listen for SMTP connections, effectively
>         large portions of an MTA. This would be cool but painful.

I'd have to agree.

>       - pull mail from a POP or IMAP server. This had the downside that it
>         introduced polling into the system (slow) and also required something
>         to happen on a schedule, which doesn't happen in Zope yet.

Here I'd have to disagree.  I would definately include polling of a
POP box as a way to get mail into the system.  Not everyone has a 24x7
internet connection with a fixed ip address and a dns entry, so for
them polling a POP box would be a great way to handle things.  Plus it
is great for those people picky about security that don't let anything
inward across the firewall.

Ok, so you could set up fetchmail to poll the pop box and redeliver
locally, but that is a lot of setup.

And isn't there a ZScheduler that will schedule operations in the
future?  And there is that nice python pop client interface.

> So:
>       - Within Exim, use the "pipe" transport to get email for a particular
>         host sent to a program on the standard input. If the program called
>         returns certain codes then Exim will queue the message and try again.

I think you can do this with sendmail by putting "|command" in .forward.

>       - This program takes the email message and puts it into Zope, probably
>         by calling a DTML Method or something. This would probably be
>         configured by objects in the Zope ZODB which say effectively "When
>         you get email for this address, then call this Method".
>       - The DTML Method is responsible for doing the right things to get
>         the email message into the ZODB in whatever form is appropriate.

One thing I don't understand is how many processes can access a live ZODB.  How
does the locking work?  Otherwise you'd need to have your mail processor
command do an html get or post to get the information into Zope.

> We haven't yet figured out how to make sure the above mail handling 
> program can find all the relevant configuration documents. Is there 
> some way of efficiently finding all instances of a particular ZClass?
> (Chris W. still isn't sure that's how the configuration will work but 
> that's the plan for the moment, so any thoughts would be appreciated)
> What we'll do is a first version that hard codes everything in the 
> above script and prove the principle of the thing, and then move onto 
> the configuration.
> Does this sound like what people need? Any thoughts, comments, warnings?

The nice thing would be have a nice class for storing mail (either
in the ZODB or an RDBMS), and a couple of ways to feed it (.forward
with a pipe for sendmail, whatever for exim..).  That way people
can work with mail no matter how it was dumped into the system.

An advantage is that adding a POP client would allow you to create
a POP mail reader using zope also.  Just a thought.

-- cary

> I don't know yet what kind of schedule we'll be able to do this on 
> but drop me a mail and when there's something to play with we'll let 
> you know.
> Simon
> -- 
> --------- My opinions are my own, NIP's opinions are theirs ----------
> Simon J. Coles                                 Email: [EMAIL PROTECTED]
> New Information Paradigms                  Work Phone: +44 1344 753703
> http://www.nipltd.com/                     Work Fax:   +44 1344 753742
> =============== Life is too precious to take seriously ===============

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to