msmtp-scripts: Fix spool/lock dir permissions
authorDaniel F. Dickinson <cshored@thecshore.com>
Tue, 27 Aug 2019 09:57:51 +0000 (05:57 -0400)
committerDaniel F. Dickinson <cshored@thecshore.com>
Tue, 27 Aug 2019 10:55:04 +0000 (06:55 -0400)
If the spool or lock dir exist before msmtp's initscript runs we
need to modify the permisions to be appropriate instead of just
bailing, otherwise non-root can't send mail.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
mail/msmtp-scripts/files/msmtpq-ng-mta.init

index 3012a28cba927cb5c6603ede5a7ee31d0ccd0355..1636d58bfad93d6fe85597f8fda4a00a9a388fc2 100644 (file)
@@ -4,12 +4,16 @@
 START=90
 
 boot() {
-       [ ! -d /var/spool/msmtp ] && {
+       if [ ! -d /var/spool/msmtp ]; then
                mkdir -m1777 -p /var/spool/msmtp
-       }
+       else
+               chmod 1777 /var/spool/msmtp
+       fi
 
-       [ ! -d /var/lock/msmtp ] && {
+       if [ ! -d /var/lock/msmtp ]; then
                mkdir -m1777 -p /var/lock/msmtp
-       }
+       else
+               chmod 1777 /var/spool/msmtp
+       fi
 }