Forum OpenACS Q&A: Re: E-mail responses to forum/bboard postings?

Collapse
Posted by Oscar Bonilla on
I've tought a little about this and there are a couple of ways
to do it. Basically they all involve the following:

1. A way to pipe the email to a script that connects to the
database and inserts it in the appropriate forum. This does
not have to be qmail (I also use qmail ;), it could be
sendmail with procmail or whatever. The important thing would
be to be able to pipe the mail to a script.

2. A way to tell to which forum the user is posting and if
this is a reply to a post. The reply part is easy since we
could set some mail headers in the original message, for
instance X-Forum-Id, and X-Reply-To-Message-Id or whatever.
If it's a new posting the forum name would have to be
embedded in the destination address and would have to be
looked up. You would have to trust the return email address
since there is no easy way (except maybe PGP) to
authenticate the user via email.

3. A way to get the content. This is really, really hard.
Having worked with email processing systems before I can
assure you there is NO standard on how email clients encode
their responses. It could be plain text, html, MIME with
tons of different charsets, Multipart MIME (think recursive
encodings) which Outlook likes a lot. Assuming you're able
to decode the email, you'd still have to find the relevant
part (the new content) since most email clients quote
original text.

I haven't seen any mail parsers for Tcl, but I've used
the Perl MIME parsers. One solution would be to write a
Perl script to do what I've described. It would
not be elegant, but it would do the job (isn't that perl's
philosophy?).

I've glanced at the forum-reply-procs.tcl file but
IMHO it doesn't look complicated enough to do the job
right ;)

Regards.