NYCPHP Meetup

NYPHP.org

[nycphp-talk] An Email Architecture Puzzle

Andrew Yochum andrew at plexpod.com
Sun Jan 22 19:42:40 EST 2006


On Sat, Jan 21, 2006 at 11:13:17AM -0500, csnyder wrote:
> On 1/13/06, Andrew Yochum <andrew at plexpod.com> wrote:
> 
> > Configure your SMTP server or procmail to filter all email through a PHP
> > script.  Parse, munge (like adding a tracking number to the subject),
> > store it in your DB & pass it through to the recipient.  This is much
> > the same way many spam filters and email-based help desk apps work...
> > and CLEW.
> >
> > HTH,
> > Andrew
> 
> Sorry to jump in so late on this, had my head down this week.
> 
> I like this approach because it adds a header which can be used by the
> recipient of the email to verify that it was assigned to the proper
> job. You could also add a footer to "unassigned" messages, to include
> a link to the assignment interface.
> 
> For efficiency's sake, I might opt for a different system, using an
> IMAP mailbox so that the messages could queue under heavy load without
> affecting the timely delivery of mail. Your PHP app would simply read
> its inbox every so often, process any new messages, and either delete
> them or move them to one or more folders within the mailbox based on
> how they are assigned (or not assigned).
> 
> There is a nice tradeoff here which can help you decide: pass-through
> SMTP has fewer moving parts, whereas IMAP queueing has fault tolerance
> and a built-in message store.

I like the IMAP idea.  However, the delayed/queuing nature of it has the
downside of not allow you to drop in the connective tissue (header
and/or body tags) to messages on-the-fly before they're delivered.

Regular subjects and message IDs/in-reply-to headers can help
thread stuff for the IMAP config, but from what I've seen it helps to
build in your own for these kinds of apps.

If you're dealing with high volumes, speed is a concern and the setup
time of your mail filter is a hinderance... run it as a daemon.  Your
actual filter can be very light weight and just connect to the daemon
over unix or tcp sockets.  And you get a way to scale the app at the
same time.

Andrew

-- 
Andrew Yochum
Plexpod
andrew at plexpod.com
718-360-0879



More information about the talk mailing list