sieve_extprograms plugin calling bash script
I receive an email a few times a week containing a URL for a live stream which starts within a minute after receiving the email. I want to automate capturing the whole stream.
I've been trying to write a sieve script which uses the sieve extprograms plugin to call a bash script that parses the URL from the email and passes it to a capture program. So far I've had no luck getting the bash script to call _any_ external programs. I can't even write a file to /tmp/, so it's not a filesystem permissions issue. The sieve script has no issues finding and executing the bash script, it just does nothing other than return an exit code.
Does sieve put the extprogram script in some kind of sandbox where it has no access to the system?
This may not be the best place to find answers to sieve plugin info. If so, can someone point me in the right direction?
On 27/01/2023 09:00 EET Tom tom@grimps.net wrote:
I receive an email a few times a week containing a URL for a live stream which starts within a minute after receiving the email. I want to automate capturing the whole stream.
I've been trying to write a sieve script which uses the sieve extprograms plugin to call a bash script that parses the URL from the email and passes it to a capture program. So far I've had no luck getting the bash script to call _any_ external programs. I can't even write a file to /tmp/, so it's not a filesystem permissions issue. The sieve script has no issues finding and executing the bash script, it just does nothing other than return an exit code.
Does sieve put the extprogram script in some kind of sandbox where it has no access to the system?
This may not be the best place to find answers to sieve plugin info. If so, can someone point me in the right direction?
Can you provide doveconf -n and your sieve rules? And the script?
Also if you're on systemd, you will likely have PrivateTmp=yes in the unit, so /tmp becomes /tmp/*systemd*dovecot*/tmp
Aki
Tom skrev den 2023-01-27 08:00:
This may not be the best place to find answers to sieve plugin info. If so, can someone point me in the right direction?
https://doc.dovecot.org/configuration_manual/sieve/plugins/extprograms/
At the location /usr/lib/dovecot/sieve-execute, create the executable script vacationcheck.sh. In this example, the vacationcheck.sh script needs two parameters: the sender address and a time interval specified in seconds. The time interval is used to specify the minimum amount of time that needs to have passed since the sender was last seen. If the script returns exit code 0, then message is redirected in the Sieve script shown above.
+1
participants (3)
-
Aki Tuomi
-
Benny Pedersen
-
Tom