Zentyal Forum, Linux Small Business Server

Zentyal Server => Email and Groupware => Topic started by: opensauce on May 14, 2018, 01:59:11 pm

Title: How to delete email older than a certain date
Post by: opensauce on May 14, 2018, 01:59:11 pm
We are using Zentyal 4.2.12 with SOGO.
In order to comply with GDPR we are wanting to delete all email older than a certain date e.g. 5 years. I have a couple of questions.

1. Where is email stored with SoGO?
2. Is there a way to delete email older than a set date using a script?

Many thanks for your help.
Title: Re: How to delete email older than a certain date
Post by: half_life on May 29, 2018, 06:00:36 am
Contacts and calendar are stored in mysql.  The mail info is in maildir format under /var/vmail/<your_domain>/username/Maildir/. Folders created within SOGo are hidden.  The file dates should be enough but you could also parse the date info in the email.

You can find all candidate emails with something like this:
Code: [Select]
find /var/vmail/<your_domain>/* -type f  -mtime +1825

Adding a -delete to the end will perform the deletion.