-
Notifications
You must be signed in to change notification settings - Fork 0
/
sendmail-p.d.o
executable file
·35 lines (32 loc) · 1.02 KB
/
sendmail-p.d.o
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
#!/bin/sh -e
# vim:se tw=0 sts=2 ts=2 et ai:
# Send mail from people.debian.org via ssh-login
if [ "${DEBEMAIL}" = "" ] && [ "$(id -un)" = "osamu" ]; then
# probably started from non-shell prompt (e.g. browser)
# hidden option. Must be adjusted for each DD.
DEBEMAIL="[email protected]"
export DEBEMAIL
elif [ "${DEBEMAIL##*@}" != "debian.org" ]; then
echo "You must have a debian.org e-mail address and export it by setting the" >&2
echo '$DEBEMAIL environment variable.' >&2
echo "NOTE: If a browser starts mutt, the shell start-up code doesn't set this." >&2
exit 1
fi
# Normal
VERBOSE=""
# For debug
#VERBOSE="-vvv"
# If strict host check, use this.
#STRICTCK=''
# No strict check, use this. (Double quotes are important)
STRICTCK='-o "StrictHostKeyChecking no"'
# eval is the trick to keep the above double quotes in place
if [ -n "$DEBEMAIL" ]; then
eval /usr/bin/ssh \
"${VERBOSE}" \
-p 22 \
"${STRICTCK}" \
"${DEBEMAIL%%@*}@people.debian.org" \
/usr/sbin/sendmail -bm -ti \
-f "$DEBEMAIL"
fi