1 diff --git a/scripts/msmtpq/msmtpq b/scripts/msmtpq/msmtpq
2 index d8b4039..1f2a7b5 100755
3 --- a/scripts/msmtpq/msmtpq
4 +++ b/scripts/msmtpq/msmtpq
5 @@ -60,8 +60,8 @@ err() { dsp '' "$@" '' ; exit 1 ; }
6 ## e.g. ( export MSMTP=/path/to/msmtp )
7 if [ "$MSMTP" = "" ] ; then # If MSMTP is unset or empty...
9 -elif [ ! -x "$MSMTP" ] ; then
10 - log -e 1 "msmtpq : can't find the msmtp executable [ $MSMTP ]" # if not found - complain ; quit
11 +# elif [ ! -x "$MSMTP" ] ; then
12 +# log -e 1 "msmtpq : can't find the msmtp executable [ $MSMTP ]" # if not found - complain ; quit
15 ## set the queue var to the location of the msmtp queue directory
17 ## ( chmod 0700 msmtp.queue )
19 ## the queue dir - export this variable to reflect where you'd like it to be (no quotes !!)
20 -Q=${Q:-~/.msmtp.queue}
21 +Q=${MSMTP_QUEUE:-~/.msmtp.queue}
22 [ -d "$Q" ] || mkdir -m 0700 -p "$Q" || \
23 err '' "msmtpq : can't find or create msmtp queue directory [ $Q ]" '' # if not present - complain ; quit
25 @@ -85,8 +85,10 @@ Q=${Q:-~/.msmtp.queue}
27 ## the queue log file - export this variable to change where logs are stored (but no quotes !!)
28 ## Set it to "" (empty string) to disable logging.
29 -[ -v LOG ] || LOG=~/log/msmtp.queue.log
30 +LOG=${MSMTP_LOG:-~/log/msmtp.queue.log}
31 [ -d "$(dirname "$LOG")" ] || mkdir -p "$(dirname "$LOG")"
34 ## ======================================================================================
36 ## msmtpq can use the following environment variables :
37 @@ -139,6 +141,7 @@ on_exit() { # unlock the queue on exit if the lock was
38 ## display msg to user, as well
43 PFX="$('date' +'%Y %d %b %H:%M:%S')"
44 # time stamp prefix - "2008 13 Mar 03:59:45 "
45 @@ -156,10 +159,19 @@ log() {
49 + if [ "$JOURNAL" = "Y" ]; then
52 + echo "$ARG" | systemd-cat -t "$NAME" -p info
56 if [ -n "$RC" ] ; then # an error ; leave w/error return
57 [ -n "$LKD" ] && lock_queue -u # unlock here (if locked)
59 echo " exit code = $RC" >> "$LOG" # logging ok ; send exit code to log
60 + [ "$JOURNAL" = "Y" ] && \
61 + echo "exit code= $RC" | systemd-cat -t "$NAME" -p emerg
62 exit "$RC" # exit w/return code