I can't for the life of me figure out how to get mail2web working. Whenever I turn the module on, all mailhandler rules stop working - even the ones that worked fine before to post to the blog by email. I get "Received an email with no parameters from..." messages in the log and no messages are not posted.
- drupal 5.11
- notifications 5.x-1.0
- messaging 5.x-1.0
- mailhandler 5.x-1.4
What other info might you need?
I would be massively grateful to anyone who can help me sort this out. The feature is promising and I want to start using it ASAP.
Thanks!
Tobias
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | mail2web.patch | 667 bytes | sagannotcarl |
Comments
Comment #1
Ian Ward commentedhi Tobias,
There is a dev version now available to download and test on http://drupal.org/project/mail2web which you could try on a test site. The other mailhandler rules should now continue to work in the dev version. Once this is tested some more, i'll roll another beta version. I'm going to switch this ticket to the mail2web project as I imagine it is a mail2web issue.
There is a post about configuring mail2web over here http://www.developmentseed.org/blog/2008/apr/30/reply-above-line-post-co...
Can you tell me what email client you are using to respond to the message?
thanks,
Ian
Comment #2
JamesCollier commentedHi,
I've installed everything on a Drupal 6 dev site, and know what the problem is, though admittedly I don't have the technical know-how to fix it.
When Mail to Web is not enabled, all works as it should with Mailhandler, Notifications and all other modules, and I can email in a post with no errors. When Mail to Web is enabled, it requires authentication parameters (that assign responses to certain nodes, or to previous comments) that are not present in a new post, and thus the emailed post is not processed.
Thanks for looking into all of this,
James
Comment #3
jide commentedI confirm what JamesCollier says, thus i have been able to make it work first.
Then, i added a new mailbox in mailhandler and the error now occurs (i made some other changes i can't remember too, sorry).
I tried to look at the module, but for now, i have no clue.
Comment #4
jide commentedThe mailhandler hook does not return $node if the mail does not contain information required by mail2web.
A simple fix is to return the node as a fallback. Look for the function mail2web_mailhandler, line 158 :
Comment #5
nsciaccaThe problem with the missing parameters is as such:
1. Mail2Web constructs a Message ID like this:
<1.2.13.1229449723.eec24b28f146e19f4153bc704ec58437@example.com>2. The received mail message has a header Message ID like this:
<ea7cb714cfaa049aad94d365de07f7a9@example.com>So when you reply - the Message ID cannot be broken back apart into the "uid.nid.cid.time.signature" fields. I'm still looking into where/why the Message ID is not being sent correctly.
*UPDATE*
I was using the PHPMailer and when I dug into the "messaging_phpmailer.module" I found that the Message ID was NOT being passed along to the send function, so it was generating a random message ID -- so I added the following:
The Message ID was successfully passed to the email and the Reply function posted a comment reply - the subject of the email was successfully added as the subject of the comment reply - BUT the content of the email/comment is blank... investigating now...
*UPDATE*
The preg_split in "mail2web.module" to deal with the mac mail client was causing a problem -- the partial HTML tags from the HTML email was causing the preg_split not to identify the key part of the message correctly. I added the following line before the preg_split:
Of course this only works if you don't care to have HTML in your comments -- the reason the preg_split wasn't working was that the comment text was prefaced with:
<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">. So lesson learned: either only send back plain text emails, or write an advanced filter to take out the lines before the comment text.Comment #6
nsciaccaThe problem with the hook_mailhandler is that it runs on every email message, not just the one that has been marked to be used as the Web2Mail address, the following code fixes that by first checking to see if the mailbox matches:
Comment #7
sagannotcarl commented#6 fixed the problem for me for version 5-x-dev.. Here is the same code as a patch.
Thanks nsciacca.
It doesn't look like the line numbers mentioned work for the 6-x version so I'm switching the version of the issue. If I'm wrong please excuse me, and maybe give a little more context for that code snippet.
Comment #8
sagannotcarl commentedAnd the patch...
Comment #9
cglusky commentedWe need to get more info on this issue and keep the versions from changing:) There are some differences in level of development with this module. E.g. The latest 5.x version already has the code that makes this check - although it does not read the same as #6. Please review the latest dev version for 5 as this fix is already in place. Matter o' fact I used it to update the 6.x version.
We start out with this:
do more stuff in here, and end with this:
I am testing this and it seems to work but I question rather we should be returning $node. Think it might be null as mailhandler may think we have done something in our function when we have not.
The patch in #6 does essentially the same thing, I am just going for consistency between modules.
R,
C
Comment #10
cglusky commentedOK, I have had a chance to test my code a bit using Apple Mail and .Mac Web client with good luck. I will have a patch shortly but it may address a few more items, so I will cross post in here if it ends up being inline with Ian and Jose's plans.
Right now I am just focused on getting this all working with plain text and considering HTML input/output as gravy.
R,
Coby
[EDIT] This is part of a bigger patch I proposed here http://drupal.org/node/351260
Comment #11
Ian Ward commentedThe issues discussed on this thread are duplicates of:
http://drupal.org/node/257588 (issue where mail2web blocks other uses of mailhandler)
http://drupal.org/node/290214 (issue where messageid is getting mangled or removed by some email clients)
By the end of this week the second beta will be released for both versions, and both of these issues will be fixed. I am marking this issue as a duplicate of the above mentioned two issues.
Comment #12
sagannotcarl commentedI am reopening this because the issues that this was marked a duplicate of (#257588: mail2web blocks other modules from using mailhandler, #290214: Extend mail2web support for mail clients (Yahoo mail) and some html cleaning up, and potentially portions of #351260: Proposed Changes For D6 Version) have been committed and I'm still getting this error. If I should be opening a new instead issue please let me know.
My comment is properly getting processed and posted using SquirrelMail and Roundcube webmail, but when I use Apple Mail, Outlook express, or gmail I get the parameters error.
Are people having luck with these email clients? If so what versions of mail to web / notifications / messaging are you using?
I'm using:
* Mail to Web 6.x-1.0-beta 2
* Messaging 6.x-1.1
* Notifications 6.x-1.1
Thanks,
Colin
Comment #13
sagannotcarl commentedI've been digging around trying to figure this out in the dev version. I don't really know what the ramifications are of this but I've found a clue. Maybe someone else can chime in as to what is going on.
I think my issue has to do with this code starting on line 197 of mail2web.module:
If I comment out the if (!$node->threading) so that $node->threading = _mail2web_get_backup_messageid($node->body); runs no matter what then email is properly processed from every email client. Oddly enough it doesn't clean the "On April 17th..." stuff anymore though.
I started looking here because I realized that whenever I was getting an error _mail2web_get_backup_messageid wasn't being called.
This may just be an indication that something else isn't working elsewhere but it's as far as I got.
Comment #14
sagannotcarl commentedI think I've figured out what my problem is and it looks like it's just an issue with using PHPMailer and headers.
When using PHPMailer there is an extra message id header and it's confusing things. There is an issue and a patch here: #363001: messaging_phpmailer does not use passed headers - fails with mail2web module.
Moving this back to fixed.
Comment #16
tclusellas commentedJust to report that I was not able to post comments via email with subjects that included extra words like: "Re:"
I followed sagannotcarl advice on #13,
it fixed my problem.
Thanks
Comment #17
Ian Ward commentedSwitch to mailcomment project. Mail2web is now known as "mailcomment" due to a trademark issue with the name mail2web.