To conclude my experience report -
With the sql below from get_unread_emails() I was able to id my 4x ‘rogue’ emails to close them.
Their email owner and parent differed - reassigned perhaps? - that might explain why they did not show up in any list…
SELECT count(*) FROM tabCommunication WHERE communication_type=‘Communication’
AND communication_medium=“Email” AND email_status not in (“Spam”, “Trash”)
AND email_account in (
SELECT distinct email_account from tabUser Email WHERE parent="[email protected]" )
AND modified >= DATE_SUB(NOW(),INTERVAL 1 YEAR)
AND seen=0;
The sql query here may differ from the query that displays a list view, that might mean a bug?
I must find the code that lists emails in a view to compare with this sql.