Hi,
I've been tinkering with Policy Filters, and I was wondering whether
the behavior I've experienced is right or not.
I've implemented a simple bash script that would read parameters
delivered by master from any incoming mail, so in master I defined
that filter as 'pipe'.
test-policyd unix - n n - - pipe
flags=F user=dangerous argv=/opt/postfix_policy.php $sender $size $recipient
I've noticed that in this case the parameters are indeed forwarded to
the bash script, but Postfix doesn't expect the script to return any
value like 'action=DUNNO', it just assumes the external script will
handle the message and forward it (via sendmail, for example) if the
policy determines it should be forwarded.
On the other side, I've seen that some filters are implemented via the
spawn command (in daemon mode), these indeed process the parameters
and finally return 'DUNNO', 'REJECT', 'DEFER', etc., so in this case
Postfix would wait for the policy daemon to process the message and
return the corresponding action.
Is there a way to make Postfix wait for a 'piped' script result
instead just forwarding the parameters and transfer responsibility of
that message to the external script?
Thanks