-
Notifications
You must be signed in to change notification settings - Fork 0
/
msgextract.sh
executable file
·48 lines (30 loc) · 1.03 KB
/
msgextract.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Easily extract the contents of MSG email files v.0.2
# https://github.com/AlexanderShad/msgextract
echo -e '\e[042;30m --- Start extraction... --- \033[0m\n'
if [ -n "$1" ] ; then
if [ -e "$(cd "$(dirname "$1")"; pwd -P)/$(basename "$1")" ] ; then
echo ''
echo -e '\e[0;31m* creating temp file...\e[0m'
echo ''
cp "$(cd "$(dirname "$1")"; pwd -P)/$(basename "$1")" "$(cd "$(dirname "$1")"; pwd -P)/tfile.msg"
echo ''
echo -e '\e[0;31m* msgconverting...\e[0m'
echo ''
msgconvert "$(cd "$(dirname "$1")"; pwd -P)/tfile.msg"
echo ''
echo -e '\e[0;31m* munpacking...\e[0m'
echo ''
munpack "$(cd "$(dirname "$1")"; pwd -P)/tfile.eml"
echo ''
echo -e '\e[0;31m* deleting temp files...\e[0m'
echo ''
rm "$(cd "$(dirname "$1")"; pwd -P)/tfile.eml"
rm "$(cd "$(dirname "$1")"; pwd -P)/tfile.msg"
echo -e '\e[042;30m --- Extracted --- \033[0m\n'
else
echo -e '\e[042;30m --- File not found. --- \033[0m\n'
fi
else
echo -e '\e[042;30m --- No parameters found. --- \033[0m\n'
fi