forked from jessfraz/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·73 lines (64 loc) · 2.06 KB
/
entrypoint.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
set -e
if [ -z "$GMAIL" ]; then
echo >&2 'error: missing GMAIL environment variable'
echo >&2 ' try running again with -e [email protected]'
echo >&2 ' optionally, you can also specify -e GMAIL_PASS'
echo >&2 ' -e GMAIL_NAME="Your Name" and [email protected]'
echo >&2 ' if not specified, both default to the value of GMAIL'
exit 1
fi
if [ -z "$GMAIL_NAME" ]; then
GMAIL_NAME="$GMAIL"
fi
if [ -z "$GMAIL_FROM" ]; then
GMAIL_FROM="$GMAIL"
fi
if [ -z "$IMAP_SERVER" ]; then
IMAP_SERVER="imap.gmail.com:993"
fi
if [ -z "$SMTP_SERVER" ]; then
SMTP_SERVER="smtp.gmail.com"
fi
sed -i "s/%GMAIL_LOGIN%/$GMAIL/g" "$HOME/.mutt/muttrc"
sed -i "s/%GMAIL_NAME%/$GMAIL_NAME/g" "$HOME/.mutt/muttrc"
sed -i "s/%GMAIL_PASS%/$GMAIL_PASS/g" "$HOME/.mutt/muttrc"
sed -i "s/%GMAIL_FROM%/$GMAIL_FROM/g" "$HOME/.mutt/muttrc"
sed -i "s/%IMAP_SERVER%/$IMAP_SERVER/g" "$HOME/.mutt/muttrc"
sed -i "s/%SMTP_SERVER%/$SMTP_SERVER/g" "$HOME/.mutt/muttrc"
if [ -d "$HOME/.gnupg" ]; then
# sane gpg settings to be a good encryption
# social citizen of the world
{
echo
if [ -f "/etc/Muttrc.gpg.dist" ]; then
echo 'source /etc/Muttrc.gpg.dist'
fi
if [ -f "/usr/share/doc/mutt/samples/gpg.rc" ]; then
echo 'source /usr/share/doc/mutt/samples/gpg.rc'
fi
if [ -f "/usr/share/doc/mutt/examples/gpg.rc" ]; then
echo 'source /usr/share/doc/mutt/examples/gpg.rc'
fi
if [[ ! -z "$GPG_ID" ]]; then
echo "set pgp_sign_as = $GPG_ID"
fi
echo 'set crypt_replysign=yes'
echo 'set crypt_replysignencrypted=yes'
echo 'set crypt_verify_sig=yes'
# auto encrypt replies to encrypted mail
echo 'set pgp_replyencrypt=yes'
# auto sign replies to signed mail
echo 'set pgp_replysign=yes'
# auto sign & encrypt to signed & encrypted mail
echo 'set pgp_replysignencrypted=yes'
# show which keys are no good anymore
echo 'set pgp_show_unusable=no'
# auto sign emails
echo 'set pgp_autosign=yes'
} >> "$HOME/.mutt/muttrc"
fi
if [ -e "$HOME/.muttrc.local" ]; then
echo "source $HOME/.muttrc.local" >> "$HOME/.mutt/muttrc"
fi
exec "$@"