I was able to group conversations for inbox for exmaple with:
from imapclient import IMAPClient
mail = IMAPClient(domain, ssl=True)
mail.login(username+"@"+domain, password)
mail.select_folder(folder)
threads = mail.thread(algorithm='REFERENCES', criteria='ALL')
That works without error. Now I am having trouble grouping messages from inbox and sent. Lets say I received 4 messages (grouping works with previous code) and sent 3. That means I want to show 7 in total and not just 4 i have received.
I do not need a ready to use solution, just some suggestions on where to start. Thanks.