Remove all collected Mails by the Mail app

I want to remove all the e-mails that where collected into the Nextcloud Mail app (and the attached files too).

But I do not find where they are actually being saved.

Can you please help me with this?

Hi,

As far as I know Nextcloud doesn’t store the mails on the server and only fetches the mails directly from the mail server when opening the app.
However, all information about the mail accounts are stored in the DB:

show tables where Tables_in_nextcloud_db like '%mail%';
+------------------------+
| Tables_in_nextcloud_db |
+------------------------+
| oc_mail_accounts       |
| oc_mail_aliases        |
| oc_mail_attachments    |
| oc_mail_coll_addresses |
+------------------------+

While some attachments are obviously stored on the server, the DB table oc_mail_attachments tells you the file name at least, so that you can search the file in the user directories:

describe oc_mail_attachments;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | int(11)      | NO   | PRI | NULL    | auto_increment |
| user_id    | varchar(64)  | NO   | MUL |         |                |
| file_name  | varchar(255) | NO   |     |         |                |
| created_at | int(11)      | NO   |     | 0       |                |
+------------+--------------+------+-----+---------+----------------+
1 Like

Thank you a lot.

I thought it actually caches/saves them instead of refetching every time.

All is good then, thanks for your time and clarity.