You have some errors here. The f
flag says to replace the message with the output from the filter (though the b
restricts this action to just the body). The braces are also superfluous here. So I'd go with
:0b
* ^Subject.*Telemetry rotate$
! `php -f /path/to/script/script.php`
if indeed the plan is to (1) pass the body to the PHP script, (2) capture the script's output (this is what the `backticks`
do) and (3) forward the message to the address captured (that's wat the !
action does).
If your intention is merely to pass the body to your script, that would be
:0b
* ^Subject.*Telemetry rotate$
| php -f /path/to/script/script.php
maybe also with a c
flag if you want to continue to process the message after this point.
You'll notice that I took out the hard-coded path /usr/bin
; hardcoding the path makes the script less portable, and makes it impossible (or at least extremely cumbersome) to replace php
with a wrapper for debugging purposes. I'd recommend to simply make sure you set up your PATH
correctly in production.
!
forwards the mail to the address that the PHP script outputs. That's what the!
at the start does. Is this what you intend? Did you intend to use|
instead? Check thepromailrc
manual... – Kusalananda Dec 18 '18 at 18:02f
flag with an!
action. This is a corner case I have never seen before. I'm pretty sure the recipe doesn't do at all what you want; but your question really should spell out more explicitly what you do want. The idea that backticks "escape" a command is certainly nonsense. – tripleee Dec 18 '18 at 19:56