Where to set the parameter 'mail_remove_replies_after'

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
andreas.panozzo
Posts: 17
Joined: 23 Dec 2020, 12:22

Where to set the parameter 'mail_remove_replies_after'

Post by andreas.panozzo »

Hello,
My target is to only add the most recent reply in the email chain and ignore the rest.
Looking to the documentation I found that I should set to YES, the value of 'mail_remove_replies' (done from the Manage Configuration Options web page) and configure also the parameter: 'mail_remove_replies_after'.
What I'm not able to find is where I should configure this second parameter since I'm not able to find it in the Manage Configuration Options web page.
Any suggestion?
Thanks
Attachments
Untitled.png
Untitled.png (29.26 KiB) Viewed 7808 times
SL-Gundam
Posts: 745
Joined: 06 Jul 2011, 14:17

Re: Where to set the parameter 'mail_remove_replies_after'

Post by SL-Gundam »

0.11.0-DEV changed this functionality. It is using a plugin to detect replies. So now it automatically detects replies and supports more variations.
Documentation will be updated when 0.11.0 is officially released. Which is taking longer then it should.
andreas.panozzo
Posts: 17
Joined: 23 Dec 2020, 12:22

Re: Where to set the parameter 'mail_remove_replies_after'

Post by andreas.panozzo »

Ok. Thanks..but please could you suggest which is the best way, using 0.11.0-DEV, to only add the most recent reply in the email chain and ignore the rest.Because, setting to YES the 'Remove all replies from notes' parameter, seems not work properly.
SL-Gundam
Posts: 745
Joined: 06 Jul 2011, 14:17

Re: Where to set the parameter 'mail_remove_replies_after'

Post by SL-Gundam »

It might be that the plugin is missing a certain language support. I don't know the language used in your email.

If you can provide an example of how the start of a reply looks like that does not work, we can try fixing that.
Something like this
From: Name <email@address.com>
Sent: wednesday 26 februari 2025 09:25
To: Name <email@address.com>
Subject: RE: Example
andreas.panozzo
Posts: 17
Joined: 23 Dec 2020, 12:22

Re: Where to set the parameter 'mail_remove_replies_after'

Post by andreas.panozzo »

Hello,
first I added a note [THIS IS A NOTE ADDED IN THE WEB] working on the web UI, then I answered to the e-mail received (with the first note) adding a second note [THIS IS A NOTE SENT VIA E-MAIL].
The result, as you can see, is that in the second note it has been added both the replies and not only the most recent one in the email chain and ignoring the rest (this is what I would like to see).
Attachments
Untitled.png
Untitled.png (26.23 KiB) Viewed 6501 times
SL-Gundam
Posts: 745
Joined: 06 Jul 2011, 14:17

Re: Where to set the parameter 'mail_remove_replies_after'

Post by SL-Gundam »

hmmm. Should have worked i believe.
Will have to investigate that. I will let you know if i find anything.
SL-Gundam
Posts: 745
Joined: 06 Jul 2011, 14:17

Re: Where to set the parameter 'mail_remove_replies_after'

Post by SL-Gundam »

It works just fine for me

It looks for the "From:" line.
At the moment i couldn't tell you why it doesn't work for you

You could try adding the regex below to https://regex101.com/ with the text from the note.

Code: Select all

^\s*(From\s?:.+\s?(\[|<).+(\]|>))
I'm curious if it matches anything
andreas.panozzo
Posts: 17
Joined: 23 Dec 2020, 12:22

Re: Where to set the parameter 'mail_remove_replies_after'

Post by andreas.panozzo »

Hello.
Here it is.
Attachments
Untitled.png
Untitled.png (62.82 KiB) Viewed 6362 times
SL-Gundam
Posts: 745
Joined: 06 Jul 2011, 14:17

Re: Where to set the parameter 'mail_remove_replies_after'

Post by SL-Gundam »

It found it. So it should have worked for you too.

There are 2 options.
1. Debug the code yourself. In mail_api.php there are 2 functions that govern this functionality: identify_mantisbt_replies and parse_email_body.
2. Activate debug mode in EmailReporting. In the debug options make sure the complete email is saved to a directory or attached as an attachment to the issue. Reproduce the issue and send me the files saved by debug mode (might be best to use a private message for this).
andreas.panozzo
Posts: 17
Joined: 23 Dec 2020, 12:22

Re: Where to set the parameter 'mail_remove_replies_after'

Post by andreas.panozzo »

I'm trying to send you a private message with the required details.. but all my messages stuck in the outbox...
If I try to send the same private message to myself it works.
SL-Gundam
Posts: 745
Joined: 06 Jul 2011, 14:17

Re: Where to set the parameter 'mail_remove_replies_after'

Post by SL-Gundam »

I think they might have blocked links to or attachments of a certain types.
Add spaces as necessary to the link so that it will detect it as normal text.
Post Reply