This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Fix emails with bad timestamps in a maildir | |
# This script reads the date from the email header and set its UNIX timestamp and renames it with the proper date | |
# e.g. this: | |
# dec. 05 2017 1512499812.M908995P21566.ip-111-11-11-11,S=16331,W=16746:2,S | |
# becomes that (the email Date header is "Date: Tue, 22 Oct 2013 10:07:21 +0100"): | |
# oct. 22 2013 1382432841.M908995P21566.ip-111-11-11-11,S=16331,W=16746:2,S | |
cd "/var/mail/[email protected]/MyMailDir/cur"; |