Inbound Email broken perhaps corrupted

I have setup suiteCRM for our small company (6 or so users) on a shared host at A2Hosting.com. My system access is via cPanel and I used Softaculous for the initial install (7.10.11). Later after problems with email I upgraded to 7.10.17, which seemed to make things better for a while. Most things work ok except email. This seems a little broken; it was better.

I am accessing an IMAP account on our company server. I have checked that I can access the same account using Thunderbird via IMAP and can see no problems or surprises with any of the test emails.

Issue1: In suiteCRM I can see the mails in the Inbox BUT if I tick an email I do NOT get the “Selected:1” indication and the “BulkAction” button does not activate so there is no option to Import, UNLESS I tick the last email in the list;then I do see “Selected:1”, but if I tick others I do not see “selected:2” etc , but I can import several emails in one go as long as I have selected the last email in the list.

Issue 2: I have deleted all incoming mail accounts except one, a single group account, to try and simplify things. However, when I am logged in and looking at the email page, if I press the control to select the folder, I still see all the deleted email accounts going back as far as I can remember. These accounts are all defunct, they are not selected in my email settings and I thought they were deleted.

Issue 3: No attachments are visible until after Import (I guess this is normal). After import, the attachments are visible, but the Body of a plain-text email which has an attachment disappears and is not readable.

So it all seems a bit corrupted. I have tried the Admin/Repair tool with no success. Amongst others I have tried “Quick repair and rebuild”, “Repair inbound email accounts” and “Sync inbound email accounts”. These all seemed to work without complaint, but did not affect the problems. Things were not always this messed up. I don’t know what I might have done to corrupt things. Please can anyone suggest how I might recover. I think I need to improve things before encouraging my colleagues to import email…

Apache Version 2.4.39
MySQL Version 10.2.24-MariaDB-cll-lve
Kernel Version 3.10.0-962.3.2.lve1.5.24.5.el7.x86_64
PHP Version 7.3.6 (but I have also tried 7.0 and 5.6)

You should make a further upgrade to 7.11.6, that may help you in fixing many issues related to Emails you are facing.

Thank you for the very rapid reply. It will be a day or so before I can make the upgrade. Do you think this will clean up the old email account information? Normally I am a little hesitant to make major upgrades when what I want is bug fix rather than new features. I nearly always prefer stability to features and a less patched newer version tends to come with exciting new bugs, but if you know that there is a particular feature of the newer version that will definitely fix the email woes, then I guess I should give it a try. Do you have any idea how it got in this state, or what one would do to clean things up without upgrading the whole thing?

Upgrade rules.

Always keep 100% backup of Instance + databases.

FYI :Upgrade don’t touch your data, it is just to move files from older version to new version. There is no chance to data loss , still keep yourself safe from taking 100% backup before starting.

Inbound email is broken for me too in 7.11.6

One of the issues produces the following warning in the logs (& also, a string of subsequent imap errors):

SET assigned_user_id=‘1’,name=‘Check Inbound Mailboxes’,date_modified=‘2019-07-04 03:30:01’,scheduler_id=‘4ce4965a-b4c9-ae4e-5f89-5cdcaeba52fe’,execute_time=‘2019-07-04 03:30:00’,status=‘done’,resolution=‘success’,message=‘Warning [2]: imap_append() expects at least 3 parameters, 1 given in ****/include/Imap/ImapHandler.php on line 456\nWarning [2]: imap_append() expects at least 3 parameters, 1 given in ****/include/Imap/ImapHandler.php on line 456\n’,target=‘function::pollMonitoredInboxesAOP’,data=NULL,requeue=0,retry_count=NULL,failure_count=NULL,job_delay=0,client=‘CRON031952892d6ab8937fbdee355ef876de:29906’,percent_complete=NULL

Looking at ImapHandler.php on line 456 I saw an apparently obvious error that I corrected as follows:

public function expunge()
{
    $this->logCall(__FUNCTION__, func_get_args());

[color=#ff0000]// $ret = imap_append($this->getStream());
[/color] [color=#00ff00] $ret = imap_expunge($this->getStream());[/color]
if (!$ret) {
$this->log(‘IMAP expunge error’);
}
$this->logReturn(FUNCTION, $ret);
return $ret;
}

The warning/error in the logs has gone. although still not importing emails

Correction. Case import IS working after this fix.

I have now upgraded to 7.11.6. That made no difference at all.
I have also tried making the correction suggested by bryancn (thanks for the thought) with no result.
I feel some part of the databases has probably aquired some bad values and would welcome suggestions from anyone with some knowledge about how this part of the system works. It seems to me the weird behaviour of the user interface (only acknowledges the last entry selected) must be an important clue.
Also, it may not be relevant to the main problem, but how is it that I see all the old IMAP accounts when I have deleted them. What is supposed to happen when an IMAP account is removed?
I have enough knowledge to be prepared to go modify some tables using PhpMyAdmin, but it’s a while since I wrote any PHP/Javascript and I am not familiar with the database structure and how it is supposed to work - Is there a guide somewhere I have not found?

Agreed.

7.11.7 using Outlook IMAP :

If only “INBOX” is listed as “monitored folder” – then it shows okay under personal e-mail account and “View Emails”.

If you add “Junk Email” for example (using ctrl-click in the folders list) – No e-mails subsequently list under “View Emails”.

If you go back and remove “Junk Email” (leaving just “INBOX”, or any other single folder), then the list is once again correctly populated.

Bascally more than one monitored folder results in zero results being listed; If just one, only that folder appears (there is no folder list popup – unpopulated, despite both Deleted Items and Sent Items being correctly entered in the profile)>

7.11.8 might address?

Thanks,

Dave

Not the best answer, but we had the same problem on 7.11
Kept upgrading to 7.11.10 without a fix. Then we copied over the module folder Emails from a 7.10.7 version into the 7.11.10 install that worked…