Skip to content

Instantly share code, notes, and snippets.

@mwodz
mwodz / maildir-timestamp-fix.sh
Last active Aug 7, 2021 — forked from pimpreneil/fix-email-maildir-timestamps.sh
Fix timestamp for files in Maildirs
View maildir-timestamp-fix.sh
#!/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