On Fri, Feb 18, 2022 at 02:50:27PM +0100, Adrian van Bloois wrote: > On Tue, Feb 15, 2022 at 12:25:40AM -0800, Sean Greenslade wrote: > > Does procmail either run in a chroot or run subprocesses in one? If so, > > you'll need to make sure that the pulse socket path is accessible. It's > > typically in /run/user/<PID>/pulse/native. > > The socket is in /run/user/MYuid/pulse, the permissions are such that > only MYuid has access to that directory and lower. > I tried to find out where that directory was made but I couldn't find any > clue. I have been looking in all tmpfiles.d directories, no luck. > Changeing the permissions by hand was nsuccessful, the next call to > pulseaudio immediately reversed that action. > Any suggestions? The easiest thing would be to use sudo within the procmail command to change effective user to the user that has the pulse session. You can configure sudo to allow a password-less user change with a specific command string. Here is an example sudoers line: procmail ALL=(sounduser) NOPASSWD: /opt/scripts/do_sound_stuff This allows the user "procmail" to run the command "sudo -u sounduser /opt/scripts/do_sound_stuff" without requiring a password. If "do_sound_stuff" is a script, make sure that it's appropriately protected from editing. You might also need to add the following line to sudoers to allow headless commands: Defaults !requiretty --Sean