At one moment, when a discussion becomes long, every post returns this as error thru email:
Hi, sorry about this but we were unable to handle your email correctly for the following reason:
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'references_header' at row 1
Please correct this error and try again, or contact the system administrator. Thank you.
---- Below this line is a copy of the message ----
I see that the 'references_header' has a field length of 512.
This field shows me all previous references, not just the last, is this correct?
I guess there should not be a max limitation on how many replies there were.
Cheers,
Tom
Comments
Comment #1
mahfiaz commentedThank you for this report. I made it truncate references to not exceed 512 characters, this should leave at least 5 references which ought to be enough for anyone (and it even isn't 640 Kb).
Pull new code and see if it works for you.
Seems like someone is giving ogm a serious usage :)
Comment #2
betz commentedThanks for your answer.
Yes, ogm is fully used.
I hacked the module a lot to meet our needs, so I can't just update anymore.
We use it as a replacement for mailman at pirateparty.be
Works great so far.
What did I hack?
- I strip out the quotes, so the whole history is not saved with each comment. Way too much redundant data.
- Some extra regex to filter out 'On XXX name@example.com wrote:' shizzle
- I removed the functionality with the levenshtein title matching. This leads too much too merging threads that shouldn't be merged.
- all site members can reply by email, even if they are not subscribed to the group. (subscribing to group is more like following, getting updates, in our usage)
On top of that, i changed postfix to poll the drupal db first to see if the email address exists. Otherwise postfix bounces the email, so drupal isn't called then.
About the references_header field, do you need to save the whole thread history all the time?
Wouldn't it be better to only save the last reference?
Comment #3
betz commentedforgot t thank you for all your great work.
I really was looking for this, and the whole feeds story was just too bloated to be interesting.
Thanks!
Comment #4
mahfiaz commentedIf you cannot upgrade then here is the diff:
http://drupalcode.org/project/og_mailinglist.git/blobdiff/99e6262a8932a2...
~10 reference_headers are kept, so when the direct parent is deleted, then next upper mail is matched and threading still works, otherwise the email would be orphaned. Of course we could recreate the reference_headers when sending an email, but it would make db load a little higher and would require some extra work, so it doesn't look appealing at all. (maybe it will be if my database doesn't fit to server anymore :) )
I have thought about stripping out quotes before saving, but then again, filtering later works well for Google groups and it is safe for data. But this could definitely be optional, maybe by hook in a separate module.
As for the "On 2013/04/30 someone wrote:" filtering, text filter should catch these as well for quite some time now (although not yet all of these, I recently found that there might be something as awful as "Yourname on 2013/04/30").
Swithing Levensthein off could be configurable, it totally makes sense.
This could eventually leave you with only one or two hacks :)
And finally, I would very much like to read about how to configure Postfix to check db first, would you mind writing some instructions about it as a child page for documentation? http://drupal.org/node/938718
Comment #5
betz commentedah yes your diff makes sense, will apply it later on.
About the stripping of quotes and those anoying mail client lines, i prefer clean data instead of filtering it out on display.
This also makes a big difference in storage space if you have discussion lists with about 1000 members. :)
For the postfix mysql guide, i started one, but this is not working as i have some extra drupal code i wrote.
Maybe this is a good idea to have ogm doing this.
So the problem is that you need to have the full postfix pipe in your mysql records.
Like this:
| /etc/postfix/postfix_og_mailinglist/og_mailinglist_postfix_transport.phpIn custom module, i added a extra table in a hook_schema, named workgroup_postfix_aliases.
here is the code:
Now i added a hook_node_insert, hook_node_update and hook_node_delete in my module:
This, together with the howto on http://drupal.org/node/1982922 gets everything working.
You get the idea.
tom
Comment #7
njivy commentedI got this bug while using 7.x-1.x-dev (2013-May-12), which incorporates the diff mentioned in #4. The function og_mailinglist_log_email_sent() appears the same in the latest code, too.
I don't have the headers from the email which caused the error, but it's possible that strpos() returned FALSE which substr() then interpreted as zero.
Comment #8
mahfiaz commentedThanks for reporting. Now this should be resolved: http://drupalcode.org/project/og_mailinglist.git/blobdiff/7ee25ce35ea46e...
Comment #10
joshuautley commented#4 diff no longer exists. I just need the patch relative to this issue.
Ref http://cgit.drupalcode.org/og_mailinglist.git/blobdiff/99e6262a8932a2ebb...
- Cheers
Comment #11
joshuautley commentedComment #12
mahfiaz commentedI don't know why the commit link does not work. But to find it again I went to https://www.drupal.org/node/744486/commits page and searched for current nid (1980098).
http://cgit.drupalcode.org/og_mailinglist/commit/?id=1eb026f
Comment #13
mahfiaz commentedComment #14
ddoligalski commentedNoting that this patch does not correct the problem. While it claims to limit the $references field, it actually applies the limitation to the $in_reply_to field.