Timezones with Procmail

I use procmail to manage my incoming email and mutt to read it. Unfortunately mutt doesn’t handle dates from different timezones very well, so I came up with this procmail recipe using Ruby’s Time#parse method to convert the Date header to the current timezone:

DATE_=`formail -xDate: \
  | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
:0
{
  :0 fwhi
  | formail -i"Date: `ruby -e "require 'time'; p (Time.parse '${DATE_}').rfc2822"`"
}
This entry was posted in software | and tagged , , Bookmark the permalink. Post a comment or leave a trackback: Trackback URL. | Edit

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*