Plugin usage?
phanan opened this issue · 3 comments
Hello, and thanks for moving the plugin to Github ;) Now I'm sorry to sound silly, but how do I use the plugin? I put \s*\n?\d+.*?my@redmine.com.*
in "Truncate email after one of these lines" settings, but the quote didn't get trimmed off. Here is a sample of the email:
Duis vel nibh at velit scelerisque suscipit. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Nulla facilisi. In ut quam vitae odio lacinia tincidunt.
Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed a libero. Phasellus tempus. Praesent porttitor, nulla vitae posuere iaculis, arcu nisl dignissim dolor, a pretium mi sem ut ipsum.
Done ratio: 10
Tracker: In progress
On Wed, Feb 19, 2014 at 11:03 AM, <my@redmine.com> wrote:
(Quoted message starts here)
A test on RegEx101 shows that the regex matches.
I'm using Gmail/Google Apps, if that matters.
EDIT: And yes, the plugin is active ;)
That's the correct setting, and each line should be a regular expression to match. Look at https://github.com/ahills/redmine_mailclean_regexp/blob/master/lib/mail_handler_clean_body_regexp_patch.rb#L16 to see how the resulting regular expression is compiled. Here's an example configuration that's working for me:
-----Original Message-----
(support|redmine)@DOMAIN wrote:
On.*(support|redmine)@DOMAIN.*wrote[:,]
Looking at your regular expression on RegEx101, it looks like you're not matching properly from the beginning of the line. Try something like this instead:
On .*, <my@redmine\.com> wrote:
Basically, you want the blue highlight to cover the entire line. Hope this helps!
Thanks for answering. Will check once I'm back to my Mac ;)
It works like a charm! Now I'd suggest you include this in your README ;)