NYCPHP Meetup

NYPHP.org

[nycphp-talk] An Email Architecture Puzzle

Tim Sailer sailer at bnl.gov
Mon Jan 23 09:11:15 EST 2006


On Sun, Jan 22, 2006 at 07:42:40PM -0500, Andrew Yochum wrote:
> 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.

Although not PHP based, OTRS is quite flexible, and does a lot of what
is discussed above. I've been using it for some time for my ISP, and
it works rather well. You can even set up filters to add additional
headers before you pass the email on.

Tim

-- 
Tim Sailer <sailer at bnl.gov> 
Information and Special Technologies Program
Office of Counterintelligence 
Brookhaven National Laboratory  (631) 344-3001



More information about the talk mailing list