Pretty email

| No Comments

You may or may not remember that for a while we converted the all faculty/staff email list to a system of multiple categorized list that people could opt out of. The mechanism basically grabbed email out of the allfacstaff@wou.edu inbox, turned it into plain text, wiped out attachments and replaced them with links to copies of those same files on the website, and put the messages into a database where certain people could approve and categorize them. Another process then searched for approved emails and sent them to the lists belonging to the right categories.

This system turned out not to work well enough, especially the part where it converted everything to plain text. Email messages can have all kinds of cruft in them, including buckets of formatting codes from MS Word, weirdly encoded characters from odd email systems, forwarded messages with attachments, messages forwarded AS attachments, etc. So we had too many messages coming through the system all messed up, and we had to switch back to the old way of doing things.

Since then I've been working on a better system and it's finally coming together. Instead of converting to plain text, I'm converting to the standard multipart/alternative format that contains an HTML body to be used in HTML-capable email systems like the WOU webmail, and also a plaintext body for email programs that can't display HTML (or where people don't like HTML and have turned it off.)

It's a pain because I still need to parse an unknown number of attachments, forwarded messages, etc. The attachments have to be removed and copied to the webserver so we don't have to cram each one through the mailserver a thousand times. I need to replace image links within the email with links to the website copies, and remove various kinds of custom formatting... blah, I'm tired. More later.

Leave a comment

About this Entry

This page contains a single entry by published on March 18, 2010 11:07 PM.

Blarg was the previous entry in this blog.

Freakin' Spammers! is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.