dotfiles/mutt/.mutt/displayMail.sh
Frank Villaro-Dixon 2a7713b73b Display mail
2016-06-13 13:11:33 +02:00

15 lines
330 B
Bash
Executable file

#!/bin/bash
TMPFILE=$(mktemp)
# save the message to a file
cat - >"$TMPFILE"
# extract the date header
DATE=$( formail -xDate: < "$TMPFILE" )
# convert to the current timezone (defined by TZ)
DATE=$( date -R -d "$DATE" )
# output the modified message
echo "Date: $DATE"
formail -fI Date < "$TMPFILE"
# clean up
rm -f "$TMPFILE"