Email Reporting not picking up all the emails in a folder

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

Moderators: Contributor, Developer

Email Reporting not picking up all the emails in a folder

Postby ash.raghav » Sep 20, 2017 10:32 am

Hi,

I have deleted my previous Mantis installation and reinstalled fresh as my prior installation was a little messy and disorganised.

After I reinstalled and ran the Email Reporting plugin, it is clearly picking up only those emails which was not imported into Mantis previously. It clearly looks like there is something set somewhere to disallow import of what was previously imported.

However, I am now unable to get any my previous emails imported into Mantis.

Has anyone else faced the same problem? any tips on how to clear cache or index using which the Email reporting plugin might be picking up from?

Thanks
ash.raghav
 
Posts: 10
Joined: Sep 03, 2017 6:26 pm

Re: Email Reporting not picking up all the emails in a folde

Postby SL-Gundam » Sep 20, 2017 1:39 pm

If you want EmailReporting to pick up emails that have already been imported previously by EmailReporting, do the following

POP3: mark the emails in question as unread in your mail client
IMAP: emails are marked as deleted but not purged. Undelete said emails

Documentation: https://www.mantisbt.org/wiki/doku.php/ ... ilbox_type

That should make EmailReporting process those emails again.
SL-Gundam
 
Posts: 448
Joined: Jul 06, 2011 9:17 am

Re: Email Reporting not picking up all the emails in a folde

Postby ash.raghav » Sep 20, 2017 1:57 pm

Thanks SL-Gundam.

The emails are in the same folder as they were previously when I had imported them in Mantis. None of them were deleted from my mailbox because I have disabled the option to delete emails after they were processed by Email Reporting

I am sorry but where are they marked as "deleted"? I am using IMAP and Gmail and none of the emails are marked as "deleted" or "archived" for that matter which is why I am slightly confused.

So technically there are no emails for me to un-delete. And IMAP Auto-Expunge settings is off now as per previous suggestion. Any other suggestions? Thanks again

P.S. I am wondering where this bit of validation exists in the package - IMAP: emails are marked as deleted but not purged. Undelete said emails?
ash.raghav
 
Posts: 10
Joined: Sep 03, 2017 6:26 pm

Re: Email Reporting not picking up all the emails in a folde

Postby SL-Gundam » Sep 20, 2017 4:08 pm

Check for deleted flag starts here: https://github.com/mantisbt-plugins/Ema ... i.php#L446
Check for expunge starts here: https://github.com/mantisbt-plugins/Ema ... i.php#L496

I checked gmail and expect you will find a label (probably "Trash") connected to those emails. Delete that label
Gmail is a special case concerning IMAP since they need to support legacy with IMAP but the web interface they provide works differently which creates some unexpected situations sometimes
SL-Gundam
 
Posts: 448
Joined: Jul 06, 2011 9:17 am

Re: Email Reporting not picking up all the emails in a folde

Postby ash.raghav » Sep 21, 2017 5:24 am

Thanks SL-Gundam. I think I have a complicated situation here.

If you remember - viewtopic.php?f=13&t=24946. This is where you had advised me to turn off Auto-Expunge and prior to this, any labels I had assigned where automatically removed (owing to Auto-Expunge settings). My Auto-Expunge settings was then to simply "Archive the message" (Not move to the Bin nor delete immediately from the server). This means, there was no other label (e.g. Trash, Junk, Archive, etc) attached to any of my messages present in the IMAP folders.

After turning off Auto-Expunge, I managed to re-label all my conversations again and now all my previously imported conversations (through Email Reporting) are in the correct labels. The labels I now see are only "Inbox" and the custom label I have based on filters.

Even after putting them back into the right labels, Email Reporting has not managed to pick them up. Not sure what else I can do at this point :-(

Thanks for your time and suggestions. Much appreciated !
ash.raghav
 
Posts: 10
Joined: Sep 03, 2017 6:26 pm

Re: Email Reporting not picking up all the emails in a folde

Postby ash.raghav » Sep 21, 2017 6:01 am

I had to resort to end up doing the dirty way temporarily to import all the previous emails by settings "$t_isDeleted = FALSE;" to allow processing every single email in IMAP folders.

I am happy with this option given that all my emails will now be imported and I have turned-off Auto-Expunge which means my emails will not be Archived nor the labels will be removed.

I can happily go back to Mantis and update the emails accordingly.

One last question - when the Email Reporting plugin runs, is it possible to pick the conversation date of an email and update the same as the "Last Modified" column in Mantis? Currently, the last modified date is date on which the Email Reporting tool had imported the conversation.

Many thanks again! :-)
ash.raghav
 
Posts: 10
Joined: Sep 03, 2017 6:26 pm

Re: Email Reporting not picking up all the emails in a folde

Postby SL-Gundam » Sep 21, 2017 11:24 am

Good quickfix. Nice job

Currently EmailReporting does not support updating the modification date of an issue. You could of course make custom modifications to EmailReporting to support this but the easiest might be to just run the import job every minute so that the difference between the email being processed and the conversation date is up to one minute
SL-Gundam
 
Posts: 448
Joined: Jul 06, 2011 9:17 am

Re: Email Reporting not picking up all the emails in a folde

Postby ash.raghav » Sep 22, 2017 12:32 pm

Thanks SL-Gundam. Just thought that it is easier to sort this way than trying to find what Gmail has done its bowels.

Well, running the import job every minute will not be optimal in my case as I don't want to give my server a run. So have set it to every hour.

The main reason why I wanted to customise the reporting/modified date is in cases where I am importing everything in bulk like now. It helps maintain the audit trail.

However, I wouldn't worry about them going forward because the emails will show a difference of an hour which is not a big deal at all.

Many Thanks for all your help! Great product and support!
ash.raghav
 
Posts: 10
Joined: Sep 03, 2017 6:26 pm

Re: Email Reporting not picking up all the emails in a folde

Postby Ancy » Oct 04, 2017 4:10 am

Hi Both, As i am not good in this, could you please explain what line has to be added where to import the emails again from the same mailbox folder?
Thanks in advance,
Ancy
Ancy
 
Posts: 46
Joined: Jun 30, 2017 6:10 am

Re: Email Reporting not picking up all the emails in a folde

Postby SL-Gundam » Oct 04, 2017 8:48 am

He added
Code: Select all
$t_isDeleted = FALSE;

on line 452 in mail_api.php

Don't forget to remove this added code after processing previous emails
SL-Gundam
 
Posts: 448
Joined: Jul 06, 2011 9:17 am

Re: Email Reporting not picking up all the emails in a folde

Postby Ancy » Oct 05, 2017 3:37 am

Yes, it worked . i did like this
mantis/plugins/EmailReporting/core/mail_api.php
if ( $t_isDeleted === FALSE )
{
// Email marked as deleted. Do nothing
}
Ancy
 
Posts: 46
Joined: Jun 30, 2017 6:10 am


Return to EmailReporting

Who is online

Users browsing this forum: No registered users and 4 guests