I am making my own policy service:
userpolicy unix - n n - 0 spawn user=mail argv=/usr/libexec/postfix/per-user-policy

Which is called in smtpd_recipient_restrictions with check_policy_service. Per the SMTPD_POLICY_README it accepts inputs then replies with actions and an empty line.
Everything is working up to this point, emails are accepted.

I get the impression from the SMTPD_POLICY_README and the access.5 pages that you can respond with multiple actions before ending with an empty line. However in practice no matter what combinations of actions i try only the first one works and all others are ignored.

Example:
action=prepend Custom-Header: Header-value
action=info Custom-Log=Log-value
action=dunno
[empty line]

In that case only the header is added and the log info is ignored. If i switch the prepend and info lines then only the log info is saved but the header is not added. One example of why i expect both to work is the man page for prepend says: "When more than one PREPEND action executes, the first prepended header appears before the second etc. prepended header." I tried removing the info and just doing two prepends and still only the first one works and the second one is ignored.

Am i doing something wrong? Missing something? Or did i misunderstand and you can only have one action per policy response?

Reply via email to