From b9cc3cf269cac6e2a50e47e63c557533f91dee4d Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Tue, 27 Aug 2019 05:57:51 -0400 Subject: [PATCH] msmtp-scripts: Fix spool/lock dir permissions 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 --- mail/msmtp-scripts/files/msmtpq-ng-mta.init | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mail/msmtp-scripts/files/msmtpq-ng-mta.init b/mail/msmtp-scripts/files/msmtpq-ng-mta.init index 3012a28cb..1636d58bf 100644 --- a/mail/msmtp-scripts/files/msmtpq-ng-mta.init +++ b/mail/msmtp-scripts/files/msmtpq-ng-mta.init @@ -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 }