EmailReporting plugin removes labels in Gmail

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

Moderators: Developer, Contributor

Post Reply
ash.raghav
Posts: 10
Joined: 03 Sep 2017, 23:26

EmailReporting plugin removes labels in Gmail

Post by ash.raghav »

Hi,

The EmailReporting plugin has been great thus far but one thing that has been quite troublesome is after processing an email, the plugin simply removes the label previously added to my email.

The labels have been created to minimise & target the emails that are imported in the Bug Tracker plus they help me identify the emails by categories in Gmail. So after importing them in Mantis, the label vanishes which means I have to keep adding the label every time I receive a response for that email thread or if I reply to one. If I don't label it, then EmailReporting will not pick it up as I have set the option to specifically look into an IMAP sub-folder rather than the basefolder (Inbox).

It would be extremely useful if you can kindly advise on how to retain the labels after EmailReporting processes them.

Thanks
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: EmailReporting plugin removes labels in Gmail

Post by SL-Gundam »

Even if EmailReporting was able to store these labels somewhere we'd have to tell MantisBT to use those labels when sending the notification emails. Which is not part of the MantisBT feature set i believe.... i could be wrong though

Why not just create one label for all the replies to MantisBT notifications and let EmailReporting process that label?
EmailReporting really does not care where an email is received as long as the subject line contains a ticket number
https://www.mantisbt.org/wiki/doku.php/ ... ion_emails
ash.raghav
Posts: 10
Joined: 03 Sep 2017, 23:26

Re: EmailReporting plugin removes labels in Gmail

Post by ash.raghav »

Thanks for the suggestion.

Well, I started doing it the way you describe i.e. one label for EmailReporting. But then I'll have to start moving things around once it has been imported into Mantis which I am kinda not pleased with.

My main issue is not about storing those labels in Mantis but not losing them in Gmail. I understand that IMAP is a two-way communication but when the data is synced between Mantis and Gmail, I would prefer to have the labels I previously created for each mail thread such that I can maintain Mantis and Gmail in sync.

Is there a way I can return the label information back to Gmail such that I don't lose them every time a cron job is run?
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: EmailReporting plugin removes labels in Gmail

Post by SL-Gundam »

i meant keep everything the way it is. Just make sure that the replies to MantisBT notification emails are moved to one specific label for EmailReporting
ash.raghav
Posts: 10
Joined: 03 Sep 2017, 23:26

Re: EmailReporting plugin removes labels in Gmail

Post by ash.raghav »

Thanks. Think I am not clear.

The current process I have is
1. I run automatic labels through filters and I put those emails into separate folders (skipping Inbox)
2. After email reporting plugin imports the data, all the labels go away and the messages are marked as read

For some reason, any new issue created or assigned is not being emailed to people. Think it is is some kind of configuration error.

Its the second part of the process which isn't very helpful at the moment.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: EmailReporting plugin removes labels in Gmail

Post by SL-Gundam »

Ah then i misunderstood.
I just tested this with my own gmail account. My test email was marked as read and kept its label so i'm unsure what causes your situation to be different. I suggest the following.
  1. disable all filters
  2. Create a test email to be imported using EmailReporting.
  3. Manually move it to the proper label
  4. Run a complete test in EmailReporting of the mailbox
  5. Check what happened to the label
If the labels are still removed then it might be that the following Gmail IMAP option is playing a role here
Gmail wrote:When I mark a message in IMAP as deleted:
Auto-Expunge on - Immediately update the server. (default)
Auto-Expunge off - Wait for the client to update the server.
As can be read here, when using IMAP emails are marked for deletion after processing by EmailReporting. if auto-expunge is turned on in Gmail then i guess it could be possible it loses its labels when that happens. Turning off auto-expunge should fix that if this is the cause

Concerning the MantisBT emails not being sent. Could be multiple things. On the admin pages of MantisBT you can test this (e.g. http://www.yourwebserver.com/mantisbt/a ... _queue.php)
ash.raghav
Posts: 10
Joined: 03 Sep 2017, 23:26

Re: EmailReporting plugin removes labels in Gmail

Post by ash.raghav »

That was ace ! Thank you :-D

It was the auto-expunge at play like you mentioned. I must say, I got carried away into thinking that auto-expunge kicks in only for deletion process but I was completely wrong.

And thanks for the thread relating to emails not going out. I will have a read on that and come back if I have any questions (with a different post).
Post Reply