Skip to content

Instantly share code, notes, and snippets.

@jferris
Created October 7, 2015 20:56
Show Gist options
  • Save jferris/f15fca383b178deb0e18 to your computer and use it in GitHub Desktop.
Save jferris/f15fca383b178deb0e18 to your computer and use it in GitHub Desktop.
"Programming"
#!/bin/zsh
original=$(cat)
print "$original" > /tmp/mutt_message
ascii=$(print "$original" | recode utf-8..iso-8859-1 2>&1)
if echo "${ascii}" | egrep --silent "recode: Invalid input"; then
message=$(cat /tmp/mutt_message)
else
message=$(print "$ascii" | recode HTML_4.0)
fi
if echo "${message}" | egrep --silent "^From: Trello"; then
echo "${message}" | trelloparse
else
echo "${message}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment