Hello Vincent,

On 2019-07-31 9:49 a.m., Vincent Hobeïka wrote:
> Package: msmtp
> Version: 1.8.3-1
> Severity: normal
> 
> Dear Maintainer,
> 
> msmtp is unable to write logs into an encfs file. If I try to write
> the logs elsewhere everything is fine.
> 
> I believe I have the same problem regarding the reading of the
> .msmtprc since I had to move it outside of my encfs folder too.
> 
> Here is an example of error message I obtain when trying to write logs
> in an encfs file:
> 
> message-send-mail-with-sendmail: Sending...failed to msmtp: cannot log to 
> /home/vincent/orgd/msmtp.log: cannot open: Permission denied; msmtp: log info 
> was: host=smtp.gmail.com tls=on auth=on [email protected] 
> [email protected] [email protected] mailsize=11420 
> smtpstatus=250 smtpmsg='250 2.0.0 OK  1564578476 s17sm12382144ejz.70 - gsmtp' 
> exitcode=EX_OK; 
> 
> Prior to Buster things worked fine with encfs. Could this be related
> to the apparmor settings? I am not at ease with apparmor and can't
> provide further debugging info. Feel free to ask me to try different
> settings.

You are correct that it's due to the Apparmor profile not permitting
this. encfs is not supported by the stock profile. You have multiple
options to workaround this:

1) log elsewhere
2) add a rule to the local override file
(/etc/apparmor.d/local/usr.bin.msmtp)
3) disable the apparmor profile completely

I would recommend 2) as the safest option. Please see the NEWS file for
the full details but it should look like this (as root):

  echo '  owner @{HOME}/orgd/msmtp.log wk,' \
      >> /etc/apparmor.d/local/usr.bin.msmtp
  apparmor_parser -R /etc/apparmor.d/usr.bin.msmtp

Then it should be able to log to the real backing file under
~vincent/orgd. Please let me know if the above still doesn't work.

Regards,
Simon

Reply via email to