Created
January 11, 2016 10:55
-
-
Save TauPan/8b8673bb9277cb744fa8 to your computer and use it in GitHub Desktop.
Displaying and replying to ms-tnef / winmail.dat attachments from #outlook in #mutt
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
application/ms-tnef; tnefsmime %s; copiousoutput |
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
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
# | |
# Automatically use entries from ~/.mailcap to view these MIME types | |
# | |
# auto_view <type> [ <type> ... ] | |
auto_view application/x-gunzip application/x-gzip text/html application/ms-tnef |
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
#!/usr/bin/env bash | |
filename=$(realpath -P $1) | |
dir=$(mktemp -d) | |
cd $dir | |
tnef $filename | |
for f in $(ls -1) | |
do | |
if [ "$f" = "smime.p7m" ] | |
then | |
gpgsm --decrypt $f | |
else | |
cat $f | |
fi | |
done | |
rm -rf $dir |
I probably should mention the obvious: the script does no security checks whatsoever and makes some strong assumptions about my personal environment.
For example if somebody sneaks an alias for mktemp into your environment, rm -rf will delete all your files.
And I put my smime keys into gpgsm, obviously.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See G+ Post: https://plus.google.com/+FriedrichDelgado/posts/F6VdyoRrHMV