Comment 7 for bug 1875313

Revision history for this message
Ben Maddison (benmaddison) wrote :

This issue does not appear to be fully fixed in `msmtp version 1.8.6` on focal.
Although the workaround of calling `secret-tool` works, direct access to the keyring via `dbus` fails due to missing permissions in the AppArmor profile:

```
kernel: audit: type=1400 audit(1601726685.046:84): apparmor="DENIED" operation="connect" profile="/usr/bin/msmtp" name="/run/user/1000/bus" pid=982492 comm="pool" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=1000
```

This is fixed by adding the missing permissions to the local-site profile (`/etc/apparmor.d/local/usr.bin.msmtp`):

```
#include <abstractions/dbus-session-strict>

dbus send
     bus=session
     path=/org/freedesktop/secrets
     interface=org.freedesktop.DBus.Properties
     member=GetAll,
dbus send
     bus=session
     path=/org/freedesktop/secrets
     interface=org.freedesktop.Secret.Service
     member={OpenSession,SearchItems,GetSecrets},
```

These should probably be incorporated into the packaged profile