Ian and Jose (and I think Darren might be interested too),
I have spent the day poking around the code for the D6 version and would like to propose a few changes to perhaps clean up a few issues. These changes would all apply to what Jose has committed since $message array became an object. I am using all of the latest versions of Messaging, Notifications, Mailhandler, Mail2Web as of today (Dec 25th - Merry XMas!).

A few things I noticed (and are in the patch):
1) Mailhandler treats incoming emails as nodes (with body and teasers). This creates a bit of overhead that is not needed once we convert from node->body to node->comment. So I set node->body and node->teaser to empty once they are no longer needed.
2) Mail2Web posts comments so does not work in the node context. That makes things a bit interesting with mailhandler commands etc. With the current code if you set a default command of "comment: 2" on your M2W mailbox thinking you are going to get read/write comments you will instead set node->comment to 2 and all your comments will read "2". Mailhandler tries to overwrite the node->comment property if it is saving a comment but the problem is that it checks to see if node->comment is false first. And it's not as it will more than likely be set to reflect 0,1,2 which indicates whether comments are allowed, read, read/write. The wrong context for comments. My change ensures that node->comment has the right data for a comment body.
3) Messaging is now passing $message as an object which meant a few things needed to change in M2W hook_message_alter.
4) I incorporated some of the changes in the D5 version that check to make sure we are only operating on $nodes for the M2W mailbox. I think I read where Jose would like a switch to turn this on off. Could be done, just not clear on the use case for the "catch all".
5) I would like to work on implementing the hook_filter in this version but will leave that for another day/issue/patch

Thoughts?

R,
Coby

Comments

cglusky’s picture

StatusFileSize
new16.1 KB

Until I can talk to Ian et al about best way to break these changes into more manageable chunks here is my latest module for D6.

In addition to above changes it also includes:
- Fix for Yahoo Mail and other clients that may strip stuff set in the headers
- Fix for iPhone and other clients that may change the In Reply To header string when replying (needs work me thinks)
- In preparation of separate mail2web_message_clean.inc file as in D5 dev version: Removed code that attempted to remove stuff put into the body of the mail when replying. E.g. On some day someone wrote

D5 patch info #290214: Extend mail2web support for mail clients (Yahoo mail) and some html cleaning up

Also see working git repository here: http://github.com/cglusky [edit of outdated link]

Thanks,
Coby

cglusky’s picture

StatusFileSize
new7.48 KB

Here's a patch for #1 applied against latest D6 dev version

Ian Ward’s picture

Assigned: cglusky » Ian Ward

Thanks for the patch, Coby. I am reviewing and testing this now. I'll commit to the dev version of 6, and aim for a release after this weekend. As for the filter to strip out "On Jan 26, 2009, John Doe wrote:", I believe I've come up w/ another method that should work the majority of the time. I'll post about this later.

Ian

Ian Ward’s picture

Status: Needs review » Fixed

I've committed most of this patch, and backported a couple parts to 5.x as well. Aiming for new release by the end of the week. Thanks for the patch and for testing.

Ian

cglusky’s picture

Ian, glad it helped. For some reason I was not subscribed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Ian Ward’s picture

Project: Mail to Web » Mail Comment
Version: 6.x-1.0-beta1 » 6.x-1.0-beta4

Switch to mailcomment project. Mail2web is now known as "mailcomment" due to a trademark issue with the name mail2web.