Browse Source

msmtpq: Create queue directory automatically

If the queue directory is not present, there is no reason to complain as
we can just create it automatically.

This is a quality of life improvement so that people don't have to
remember to create ~/.msmtp.queue on new setups before this script
starts working.

Due to the previous "-d $Q" test, it is only called if the directory
does not exist yet, therefore the "-p" flag is not needed to prevent
mkdir from failing if the directory exists already.

With this patch, this script can finally run with zero prior
configuration.
pull/84/head
Magnus Groß 5 months ago committed by Martin Lambers
parent
commit
ef3b001f9a
  1. 4
      scripts/msmtpq/msmtpq

4
scripts/msmtpq/msmtpq

@ -71,8 +71,8 @@ MSMTP=msmtp
##
## the queue dir - modify this to reflect where you'd like it to be (no quotes !!)
Q=~/.msmtp.queue
[ -d "$Q" ] || \
err '' "msmtpq : can't find msmtp queue directory [ $Q ]" '' # if not present - complain ; quit
[ -d "$Q" ] || mkdir -m 0700 "$Q" || \
err '' "msmtpq : can't find or create msmtp queue directory [ $Q ]" '' # if not present - complain ; quit
##
## set the queue log file var to the location of the msmtp queue log file
## where it is or where you'd like it to be

Loading…
Cancel
Save