Skip to content

Instantly share code, notes, and snippets.

@mwodz
mwodz / maildir-timestamp-fix.sh
Last active August 7, 2021 15:18 — forked from pimpreneil/fix-email-maildir-timestamps.sh
Fix timestamp for files in Maildirs
#!/usr/bin/env bash
#
# Fix emails with bad timestamps in a Maildir
#
# which are usually resulting from moves in IMAP clients
# If the client then doesn't ask Dovecot for a specific sorting, they will be shown in the order of the filename
# based timestamp.
#
# This script reads the date from the email header and set its UNIX timestamp and renames it with the proper date