/usr/bin/getmails is in getmail 5.5-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/bin/sh
# vim:se tw=78 sts=4:
# Copyright (C) 2011-2017 Osamu Aoki <osamu@debian.org>, GPL2+
set -e
if [ "$1" = "-p" ]; then
para=true
shift
elif [ "$1" = "--" ]; then
para=false
shift
else
para=false
fi
# check file extension
endwith () {
[ "$1" != "${1%$2}" ] && return 0 || return 1
}
UID_BY_ID=$(id -u)
PID_GETMAILS=$(pgrep -U $UID_BY_ID '^getmails$')
if [ "x$PID_GETMAILS" != "x$$" ]; then
echo "The getmails script is already running as PID=\"$PID_GETMAILS\" ." >&2
exit 1
fi
if [ -f $HOME/.getmail/stop ]; then
echo "Do not run getmail ... (if not, remove $HOME/.getmail/stop)" >&2
exit 1
fi
rcfiles="/usr/bin/getmail"
# Address concerns raised by #863856
# emacs backup files: foo~ foo#
# vim backup files: foo~ foo.swp
# generic backup files: foo.bak
# These are excluded but let's allow file names with @
if $para ; then
pids=""
for file in $HOME/.getmail/config/* ; do
if ! endwith "$file" '~' && \
! endwith "$file" '#' && \
! endwith "$file" '.swp' && \
! endwith "$file" '.bak' ; then
$rcfiles --rcfile "$file" "$@" &
pids="$pids $!"
fi
done
rc=0
if [ -n "$pids" ]; then
for pid in $pids ; do
wait $pid
prc=$?
if [ $prc -gt $rc ]; then
rc=$prc
fi
done
fi
exit $rc
else
for file in $HOME/.getmail/config/* ; do
if ! endwith "$file" '~' && \
! endwith "$file" '#' && \
! endwith "$file" '.swp' && \
! endwith "$file" '.bak' ; then
rcfiles="$rcfiles --rcfile \"$file\""
fi
done
eval "$rcfiles $@"
exit $?
fi
|