Development Seed Blog
Reply ABOVE this LINE to POST a COMMENT to a Drupal Site
Plug In Gives You the Best of Both Email and Web Forum Features
Plug In Gives You the Best of Both Email and Web Forum Features
"Reply ABOVE this LINE to POST a COMMENT." This is how automatic email notifications from the teams' intranet blog posts look these days. And it's true! Now I can just reply to any email notification I receive and my comment will appear on our intranet. The only bad thing is that I don't have an excuse anymore for not replying right away ;-)
Typically there are two ways to carry on online discussions and to keep up with the replies - mailing lists (that may have a web interface) and web forums (that may have email subscriptions). Though each of one has its own advantages and drawbacks, trying to mix both usually ends up in long threads of differently formatted messages. Besides, mailing lists are usually exposed to spamming (worse yet if spam ends up on the web) and the "from" address is really easy to forge.
As usual, we wanted it all - the reliability and readability that come with authentication in a web forum and the ease of replying through a mailing list. Since we already had the Notifications and Messaging framework and an excellent mailhandler module to fetch incoming emails, it was just a question of putting the pieces together and adding some extra security/authentication into the recipe to get to this.
Check the new "Mail2web" plug-in in the Notifications module. This first version is for Drupal 5. And by the way, we just released the Drupal 6 version of both Notifications and Messaging modules. The Mail2Web Drupal 6 version, however, will have to wait for the mailhandler module.
Being paranoid about security and spam, we added a more secure method for message authentication than the ones currently used. Our outgoing emails have some digitally assigned parameters that are checked when the reply comes back. Thus only emails posted as a direct 'Reply-To' operation will get in as responses. And replies to a given thread will get only into that thread, nowhere else. But best of all, these tokens are completely invisible for a regular user and should work with most email clients without the need to install any extra software. (You can set an expiration time frame for replies too).
So what do I need to to do to get it working?
1. Install Mailhandler and set up an inbox for it to use to fetch email.
2. Install the notifications and messaging modules and set up the notifications and messaging methods to be used. You'll need at least one email method enabled. We have three available - the Drupal default mail, PHPMailer, and MIMEMail.
3. Enable the Notifications Mail2Web module and configure it.
4. Have fun and save time replying to your site users or teammates' comments directly from your inbox.
Also included in this Beta2 is a 'Notifications Lite' API module, which is a tool intended for developers to send simpler and easier notifications from their modules. As easy as
notifications_lite_send($user->uid, "Hey, this is a simple
notification for you.");
// I just don't know whether you'll get it by email or by SMS, that will depend on your personal settings.
You can Reply BELOW this LINE to POST a COMMENT.


Comments
I have installed Mail2Web
I have installed Mail2Web and all the other modules but I still can't get the reply to come through correctly. If I start a Thread on the web site I receive a copy by email via Notifications with the correct "Reply ABOVE this LINE to POST a COMMENT" at the top. If I reply to this, Mailhandler finds the message and tells me it is posted. It appears as a Comment on the correct thread BUT all it ever says is the single figure "1" (without the quotes)
Any ideas what is going wrong here. I have tried playing about with the input format settings (both places are set to use Filtered HTML) to no avail
I've solved the problem! I
I've solved the problem! I am familiar with using Mailhandler so I had put some default commands in. When I removed them everything worked correctly. A warning about this would help avoid others making the same mistake.
Thanks for the
Thanks for the information
About gmail, the basic set up is right in the comment below this one.
However, this should be documented at the mailhandler module instead of mail2web.
Hi,I have a little
Hi,I have a little problems
My aplication is in Google Apps and this is the configuration of the module mailhandler:
E-mail address: myemail@mysite.com
Second E-mail address: *empty*
Folder: INBOX
Mailbox domain:pop.gmail.com
Mailbox port:995
Mailbox username: myemail@mysite.com
Mailbox password: xxx
Extra commands: /ssl/novalidate-cert
Mime preference:Plain Text
Security: disable
Send error replies:Disabled
Cron processing:Enabled
the point is the messages don't appear until i run cron or "retrive" in maillhandler section. The most important the messages appear in the website without the body (content), the same happend when i check the suscription by email. I recive the notification of the reply, but the content is empty.
i report the bug here: http://drupal.org/node/301769
Thanks for the bug report,
Thanks for the bug report, we'll look into it and follow up there.
Hi! Excellent post and a
Hi!
Excellent post and a good read.
I would like to ask, what happens in the case that there is an attachment together with the email. Does the attachment get translated together into the node or comment?
There are some modules out
There are some modules out there that add attachment handling to mailhandler, like http://drupal.org/project/mailsave
However, this module we've done only handles comments atm (and will convert all mails to comments if there's a thread matching) but will drop the posts otherwise (that's related with the 'extra security' part).
So it may work with attachments for comments, but we haven't tried that part yet. Let us know how it works if you try.
Just what I need.
Just what I need on one of my sites for a non-profit.
Is this just for regular forums or does it work with OG-OrganicGroups also?
Thanks for the security check on incoming responses. Although it may not need it, would it still interface with Mollom if it's installed.
Yest it is for regular
Yest it is for regular forums/comments. It doesn't depend on OG, though you could use it together with OG.
About Mollom I cannot really tell, but if Mollom works with mailhandler's incoming posts, it should work.
Great stuff
This is brilliant, I'll definitely be playing around with this on the weekend.
How does this work with nested comments?
One of the real advantages
One of the real advantages of this system is that it works great with nested comments, and posts should go straight into it's thread.
The comment you're replying to is part of that 'digitally signed' parameters so it should match 100% of the comments to the right thread.
This is an exciting
This is an exciting development, but how exactly do you get it to work with organic groups? When I post something to my organic group, it sends the same emails it did before I installed the modules I need for this setup. Do I need to change something in admin/og/og to bypass the settings there?
This module only works with
This module only works with the ones using Notifications framework so to start with, you need to use the very latest version of og, that uses it for messages.
However this og version has just came out so I haven't had the time yet to try it all together, you can open a bug or feature request on the notifications_mail2web module if it doesn't work as expected.
Help! Reply above line not working.
I've been desperately searching for an answer to the problems I've had trying to implement this, and I've posted bugs up to the Drupal website, but without response. Somewhere between mailhandler and notifications, the wrong info is making it into the db when a reply email is sent by a mail recipient. I'm not sure which module is responsible for building the path to, say, a comment that has been submitted by mail as a reply to a forum post, but I'm pretty sure that's where the problem lies. The error involves a slug of php errors that come back from node.module in the core when it runs the "node_load" function. It's choking because something it is reading in the db is screwy.
The way this usually plays out is that an email is sent to an organic group subscriber. They reply with a comment above the line as expected. No problem so far. But when the cron picks it up, the php errors are generated.
The kicker is that the comment IS making it in, but IN THE WRONG PLACE. If I go to the comment module in drupal, I can see that the comment was in fact entered in the system, but two characters were shaved off of the path. Therefore, the comment never shows up as a reply to the forum thread, and it never gets mailed back out to other users.
Th path should be something like this
node/180#comment-157
but instead it is:
node/0#comment-157
So of course the comment never shows up.
Any suggestions? This is desperately needed functionality, but we can't figure out how to make it work.
Please, open a bug report
Please, open a bug report for the Notifications module (and add some more information like which versions of the modules you are running and which are the exact error messages you get)
http://drupal.org/node/add/project_issue/notifications/bug