Skip to content

Instantly share code, notes, and snippets.

mwodz /
Last active May 14, 2024 21:12 — forked from pimpreneil/
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