Scoop -- the swiss army chainsaw of content management
Front Page · Everything · News · Code · Help! · Wishlist · Project · Scoop Sites · Dev Notes · Latest CVS changes · Development Activities
Scoop to Email Gateway, a Plan Feature Requests
By rusty , Section Code []
Posted on Wed Mar 07, 2001 at 12:00:00 PM PST
For a long while, there's been some call to add an email gateway of some kind to Scoop. With Digest.pl, we have a one-way feed of story summaries, at least, but I think there's call for more. For example, one scoop-using project, Opennic, maintains both a scoop site and a mailing list, which basically overlap as to content. Some people are really married to the email interface, and do not want to switch to a web-based discussion. By far the best solution all around would be to have a transparent, two-way email to Scoop gateway. Below are my ideas on how to implement this.

Surprisingly, upon giving it a little thought, the goal of having a complete, read/write interface to scoop via email would not be all that hard to implement. Submitting stuff would come down to:
  • Set a mailing address for the gateway. Something like mailbot@scoopsite.oss. Then set up the MX to pipe all incoming mail to that address to the mailbot script.
  • Define a data format for input from an email client. This will probably be XML-ish, so to reply to a comment, you'd send an email that included something like the following:

    <mb:username>rusty</mb:username>
    <mb:password>mypassword</mb:password>
    <mb:subject>Put your subject here</mb:subject>
    <mb:comment>Comment text goes here.</mb:comment>
    <mb:posttype>text</mb:posttype>

    [The following is form information to tell the mailbot what to do. Do not edit.]
    <mb:op>comments</mb:op>
    <mb:sid>10/2/2000/34/56/38975</mb:sid>
    <mb:cid>10</mb:cid>
    <mb:tool>post</mb:tool>

    So the script takes the message, and parses it for these form elements, ignoring everything else in the message text. Obviously, to submit a story, you just use different form tags. You could even vote on stories this way, with like <mb:vote>, and same with polls, if we wanted to go that far.

  • Script gets all the bits out of the message, and sees if it has everything it needs to do something. If not, it replies to the poster with (hopefully) a helpful error message.
  • If so, it grabs a page from the site you're targeting, to get a valid form key. It constructs a POST query using the formkey and the data in your email, and submits this to the web server.
  • Get back the response page, and parse it for success- or failure-indicating text.
On the other side, sending out data is easy. You could add a user pref like "subscribe to all stories" if someone really only wanted to use the site via email. This would send them every story (and possibly every story submitted, if we had voting capability), and each comment. Hopefully it's not hard to get a mailer to recognize that one mail is a reply to another, so threaded mailreaders could display a nice threaded discussion. We could also have a "subscribe" button on the website with each story (like "hotlist") to subscribe to an individual story via email. We'd also need some standard form to unsubscribe to a story, if you don't want it anymore.

There's a little bit of trickery that would need to go on to catch post throttle violations, in case people wrote a batch of messages offline and sent them all at once. but this would be easy. Obviously, the mailer can pre-populate most of the form elements in an email, so that, for example, each comment mailed out would have at the bottom a reply form, pre-filled-in with op, tool, cid, sid, username, and the user's preferred post type. You should only need to fill in subject, comment, and password, and hit send to reply to a comment.

So, that's how a transparent mail to web scoop gateway would work. I think this would make a lot of people very happy. I will no doubt get around to coding this eventually, if no one else does, if only because it's an interesting problem to me. But if anyone else is looking to help out with the project, has some solid perl knowlege, and wants to take a shot at it before me, you're absolutely encouraged to. :-)

< Please send URLs to RSS files for new sites... | Anyone interested in LDAP authentication? >

Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Login
Make a new account
Username:
Password:

Related Links
· Scoop
· Opennic
· More on Feature Requests
· Also by rusty

Story Views
  15 Scoop users have viewed this story.

Display: Sort:
Scoop to Email Gateway, a Plan | 7 comments (7 topical, 0 hidden)
neat (none / 0) (#1)
by hurstdog on Wed Mar 07, 2001 at 10:01:58 PM PST

I just spent 10 minutes, and I had a working version, with all of that support, + polls (and it formatted them neatly too :) but then PG&E yanked power, I lost the script, and I forgot what I just did simoultaneously

Seriously, though, I think we should do some sort of md5 or sum of the bottom control part of the reply comment (the part after the [The following is form information to tell the mailbot what to do. Do not edit.]), so if it was changed, it would not post, and give the reason why. That would keep people from accidentally posting to comment 12 when they wanted comment 123, etc.

Also, it would allow us to put a random form key in for each person when we send the original email, so when they reply, they already have the form key in there, md5'd with all of the reply stuff. Then allow them to use the form key only once, until it generates a new one for them, keeping them from flooding the stories. Though replying twice to the same article would not work though, so something would have to be thought up to fix that...

Hmm.. after thinking about this for a bit, I wonder how useful it would actually be.. would there be any benefit? /me ponders... Anyway, any thoughts?



-hurstdog


Some ideas.... (none / 0) (#2)
by khym on Wed Mar 07, 2001 at 11:14:40 PM PST

I don't think that any of that XML-type stuff should be necessary for replying to a story or another comment. How about this: you encode most/all of the information into the reply-to address, and append the rest of it to the subject. So you'd get something like:

Reply-To:comment_USERNAME_SID_CID_AUTH@mail-gateway.kuro5hin.org

USERNAME would be the name of the user the mail was sent to, SID and CID being obvious, and AUTH being an authorization string. AUTH could be something like a hash of the rest of email address, encrypted with using the user's password as the key. That way the user could simply respond to the message and have it accepted, without having to enter their username or password; if that particular message was intercepted by someone malicious, they'd only be able to forge a response to that particular comment or story.

If you don't want the AUTH string to be in the email address, you could append it to the subject line, and then strip it out before putting the comment up.

With this setup, a user would only have to deal with the XML-type stuff if s/he was submitting a story.

Also, you might want to try and automatically detect whether a message is text or HTML: if it contains any common HTML stuff (<P>, <, and so on), it's considered HTML, otherwise it's text; then you'd only need to give an posttype directive if the auto-detect is likely to get it wrong.





Forcing Preview and more.. (none / 0) (#5)
by Mystic on Sat Mar 10, 2001 at 07:46:10 AM PST

Will it be fair for the scoop admins to force a person to preview a story submission if he is submitting via the web interface, while allowing a person to post directly if he is using the email interface?

One will also have to take care of cases where the user tries to write into a story that has been rejected. The system will have to send an email back sayin that the user had tried to submit comments to a rejected story.

More issues as and when I can think of them.. but generally I do not like the idea of aloowing an email interface. It is a good technical challenge, but not a good interface to be given to an user.



usacheckcashingstore.com/carson (none / 0) (#6)
by Pervez on Sat Apr 21, 2018 at 04:15:52 AM PST

Awesome write-up! I will be thus pleased. Can by no means consider this kind of factor is achievable from it. I do believe there is fantastic information specifically although negotiations together with these kinds of subject matter. Today follow-up usacheckcashingstore.com/carson Thank you regarding great submits.



best bathroom remodeling queens (none / 0) (#7)
by Pervez on Sun Apr 07, 2019 at 12:19:02 PM PST

Outstanding record! Be thankful meant for placement which within live concert! It's only one great write-up. Be thankful using the valuable details along with abilities you might have and thus offered in the following paragraphs. Currently just click right here best bathroom remodeling queens Be thankful plenty in your write-up.



Scoop to Email Gateway, a Plan | 7 comments (7 topical, 0 hidden)
Display: Sort:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest © 1999 The Management

create account | faq | search