How to fully remove and reinstall the mail app?

In the past I’ve once tried out the mail app and disabled it after some testing because it didn’t work as expected.
Today I reactivated the app and directly ran into an error condition, mainly because of wrong legacy configuration fragments. I completely remove the app, dropped all mail related tables and reinstalled it to start from scratch.
Unfortunately the required database tables haven’t been recreated so that it runs into an error condition again. Can someone please tell me how I can fully reset the app to start from scratch? The administrator guide didn’t cover this important question and also the forum search function couldn’t answer it.

I’ve fiddled-out what I had missed. I had to execute the following commands to remove legacy app fragments from the database to be able to reinstall the app:

DELETE FROM `prefix_migrations` WHERE app='mail';
DELETE FROM `prefix_preferences` WHERE appid='mail';

Hi,

as a Mail app dev I’m curious to hear what motivates you to delete all app data? We’ve had migrations for a while and I couldn’t think of a reason for dropping the tables as the next time you’ll install the app you get the exact same schema.

Cheers

@ChristophWurst The problem is, that the mail app has never worked with my specific UW-IMAP based setup. I wanted to start from scratch and give it a try again. Unfortunately the app still has problems with my email account and runs into a timeout every time I try to access my mailbox, whereas Thunderbird, Roundcube and many other applications are working well.

Gateway Timeout

The gateway did not receive a timely response from the upstream server or application.

UW-IMAP uses a big file in Mbox format for all emails. Such email server are very slow.
Perhaps that explains the timeout you get.
Check the admin readme to increase the timeout limit https://github.com/nextcloud/mail/blob/master/doc/admin.md#timeouts.

I will give it a try but I’m not really confident that it solves the problem. As I wrote, other programs, like Roundcube, doesn’t have any problems accessing a mailbox within seconds. The Nextcloud mail app directly hangs after it has been selected with a spinning circle being displayed. I’ve not even a chance to change any setting etc. without removing and reinstalling the app - that’s really weired.

@ChristophWurst Could you please tell me if a debug guide exists for the mail app? Today I’ve reactivated the app and checked the Nextcloud log file for related messages. This is what I found and might be of importance:

...,"app":"index","method":"GET","url":"\/index.php\/apps\/mail\/","message":{"Exception":"TypeError","Message":"explode() expects parameter 1 to be string, null given","Code":0,"Trace":[{"file":"\/srv\/www\/nextcloud\/nextcloud\/apps2\/mail\/lib\/IMAP\/FolderMapper.php","line":219,"function":"explode","args":[null,"INBOX",2]},{"file":"\/srv\/www\/nextcloud\/nextcloud\/apps2\/mail\/lib\/IMAP\/FolderMapper.php","line":200,"function":"guessSpecialUse","class":"OCA\\Mail\\IMAP\\FolderMapper","type":"->","args":[{"__class__":"OCA\\Mail\\Folder"}]},{"file":"\/srv\/www\/nextcloud\/nextcloud\/apps2\/mail\/lib\/IMAP\/FolderMapper.php","line":158,"function":"detectSpecialUse","class":"OCA\\Mail\\IMAP\\FolderMapper","type":"->","args":[{"__class__":"OCA\\Mail\\Folder"}]},{"file":"\/srv\/www\/nextcloud\/nextcloud\/apps2\/mail\/lib\/IMAP\/MailboxSync.php","line":79,"function":"detectFolderSpecialUse","class":"OCA\\Mail\\IMAP\\FolderMapper","type":"->","args":[[{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"},{"__class__":"OCA\\Mail\\Folder"}, ...