Mass-Remove Email by Date with Microsoft 365 Extension?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tpayne03
    Junior Member
    • Aug 2018
    • 7

    Mass-Remove Email by Date with Microsoft 365 Extension?

    Hi,

    We purchased the MS 365 extension and have one private email account that was connected to EspoCRM Version 8.0.6.

    In the private email account setting, under IMAP, the cutoff date was set to 12/13/23.

    Yesterday we migrated email accounts from G Suite to MS 365 and found that our ESPO CRM has now imported all of the legacy email prior to 12/13/23 that was migrated over.

    The cron job is still importing the emails (over 60k...!), today.

    In our CRM, we do not need this legacy email.

    In the extension for MS 365, is the cut off date working under the IMAP settings?

    Is there a way to mass remove old email from a specific date and make sure ESPO CRM doesn't re-import this email again?

    [Very happy buying the extension! Love the system. Thanks for all the hard work!].
  • victor
    Active Community Member
    • Aug 2022
    • 727

    #2
    EspoCRM does not import emails from date A to date B. EspoCRM imports emails from date A until the instance is running and instance/integration/Personal Email Account are enabled.
    That is, even if the instance/integration/Personal Email Account have not worked for a years, but Fetch Since 1.01.2018 is specified in the settings, EspoCRM will download all emails from 1.01.2018 when you enable them again (instance/integration/Personal Email Account).

    If you need to stop the fetching process, do the following:​
    1. Make your Personal Email Account Inactive (screenshot 1).
    2. In Administration > Scheduled Jobs, enable the Inactive status for Check Personal Email Accounts (screenshot 2).
    3. In Administration > Jobs, find all jobs Check Personal Email Accounts with status Running and Pending and delete them (screenshots 3 and 4).
    4. Make your Personal Email Account Active with the required Fetch Since.
    5. In Administration > Scheduled Jobs, enable the Active status for Check Personal Email Accounts.

    To delete unnecessary emails, just configure the filter to delete those emails you don't need. For example, Date Sent older than 100 days (screenshot 5)​​​​ And only then select all the necessary filtered records and delete them.
    Attached Files
    Last edited by victor; 01-18-2024, 10:04 PM.

    Comment

    • tpayne03
      Junior Member
      • Aug 2018
      • 7

      #3
      Thank you!

      One note for a future user: we had 60k emails in this box, and tried deleting all emails at once and it did not work. I think this is due to script execution time in php.ini or some issues like this. We broke the deletes down to 3k emails at a time by date, and the job queue processed the smaller deletes without any issue.

      Comment


      • victor
        victor commented
        Editing a comment
        Deleting unnecessary records if there are "too many" happens in cron. And you will in any case receive a message about the completed task (deletion task, for example, 60,000 records). In fact, a lot depends on the capabilities (power) of your server. Again, for example, having one of the most productive computers and servers located on its base, I can confidently say that such tasks are solved in minutes or even seconds. However, if your server/PC is quite weak - it can seem quite a long process.

        P.S. I'm not trying to cause any squeamishness, but a new PC (in your case it might be a faster server) solves quite a few, if not most, issues.
        Last edited by victor; 01-20-2024, 01:34 AM.

      • tpayne03
        tpayne03 commented
        Editing a comment
        Yes.... very small AWS instance! Next we are going to learn how to finally use some indexes.
    Working...