I don't delete anything. Storage is cheap.....
If you don't delete the old data in the EU you can be required to produce it in litigation -- or simply by a disgruntled customer asking your country's data authority to demand it of you.
(Storage may be cheap, but GDPR penalties or lawsuits probably aren't...)
* imapsync
My most recent (albeit still at least 7 years old) notes on installing imapsync onto a SME server
#IMAPSYNC v1.5.x
cd /var/git/imapsync & git pull
# https://github.com/imapsync/imapsync
# GIT REPO https://github.com/imapsync/imapsync.git
(presumably I had done
mkdir -p /var/git; cd /var/git; git pull https://github.com/imapsync/imapsync.git* fancy bash script
I created a script many years ago to move suspicious emails within each user's Maildir:
rbl-recheck.shFrom that I've created this quick command to move emails older than a specified date for each user into a new "Archived" folder, so you could see what gets moved.
* ARCHIVETO must start with "." and should not have spaces
* ARCHIVEDATE can be any valid argument to "date -d" -- for example "5 years ago"
* Change "DEBUG=echo" to "DEBUG=" to actually run the commands instead of listing them
It should be reasonably simple to modify this to move the archived emails to a totally different mailbox, if that's what you wanted to do...
ARCHIVETO=".Archived"; \
ARCHIVEDATE="1/1/2023"; \
DEBUG=echo; \
find /home/e-smith/files/users \
-type f \
-not -path $ARCHIVETO \
-daystart \
\( -path */cur/* -or -path */new/* -or -path */tmp/* \) \
-not -newermt $(date +%Y-%m-%d -d "$ARCHIVEDATE") \
-print0 |\
while read -d $'\0' MAILFILE; do \
if [[ $MAILFILE == */Maildir/cur/* ]]; then \
if [ ! -d "${MAILFILE/Maildir?cur*/Maildir/$ARCHIVETO/cur}" ]; then \
$DEBUG mkdir -p "${MAILFILE/Maildir?cur*/Maildir/$ARCHIVETO/{cur,new,tmp}}" ; \
$DEBUG chown -R $(stat -c \"%U:%G\" $MAILFILE) "${MAILFILE/Maildir?cur*/Maildir/$ARCHIVETO}" ;\
fi ; \
$DEBUG mv "$MAILFILE" "${MAILFILE/Maildir?cur/Maildir/$ARCHIVETO/cur}"; \
fi ; \
done
* Notes & Vague Memories
- Email folder names must start with a dot to be recognized - eg ".Archived"
- Email folders must contain all three of /cur/, /new/, and /tmp/ to be recognized
- All of the folders must be "owned" by the user accessing the mailbox
I had another script on a Kerio Connect server that scanned the email folders and output email stats - date, from, to, subject, etc -- if that sounds useful let me know.