Regarding line 398 of mailcomment.module:
// we want the final element in references header, watching out for white space
identifier = drupal_substr(strrchr($item['header']->references, '<'), 0);
Not sure why we want the final element in the header. When someone replies to an email, the 'In-Reply-To' header is appended to the end of the references header like so:
<1.4626.5056.1486935753.bb17604ac1434f712f04f724d2af7ee6@example.com> <CAPbhD2K7FvcCPqSNRhp33P+CoNkY5xyb+qNqeJBuhMrxeMCBsg@mail.gmail.com>
The original Message ID that can be used by Mail Comment is the first one. If this email were to be replied to, Mail Comment / Feeds will fail to import this email reply.
Patch coming soon that gets the first message element in the header. Great for longer email chains. Someone can now reply to a notification email, then reply to that email that they just sent in response to the notification email, and that 2nd reply still gets imported by Feeds.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | mailcomment-tamper.PNG | 32.4 KB | alfthecat |
| #7 | mailcomment-mapping.PNG | 51.06 KB | alfthecat |
| #6 | 2852329-header-references-3.patch | 3.73 KB | maedi |
| #4 | 2852329-header-references-2.patch | 2.88 KB | maedi |
| #2 | 2852329-header-references.patch | 865 bytes | maedi |
Comments
Comment #2
maedi commentedComment #3
maedi commentedAfter failing because of odd references headers in the wild I think regex is the answer:
Patch coming soon.
Comment #4
maedi commentedHere's the patch. It has its own little mailcomment_parse_messageid() function to accompany mailcomment_build_messageid(). It uses regex and works on oddly formatted references headers found in the wild.
Comment #5
maedi commentedComment #6
maedi commented3rd revision of patch. Battle tested, validates values before returning them. Puts valid messageid regex into global constant so that Mailhandler filters can access it.
See also:
#1370286: 'Node' filter rejecting forwarded emails
Comment #7
alfthecat commentedAfter updating to the latest dev and applying this patch, only replies from Gmail are imported. Other email providers result in the infamous "Unable to create comment with empty NID."
I've been working for many months to get this system to work, with great pain, and now I'm stuck on this issue with forwarded emails.
The only way I can get incoming replies to work from all email providers is to match the parent node via the email subject (using feeds tamper to remove RE: ,etc). I know this isn't the perfect way of doing it, but nothing else seems to work consistently accross email providers.
Does this patch or the latest dev change anything in this regard? Is there anyone who can share a working feeds importer mapping setup that work?
Attached is my current mapping and tamper setup.
Thanks in advance for any help!