On 12/4/2019 2:01 PM, Quasar wrote:
Hi there,
I need some help, tried to find the answer googling for it, but no luck.
Here's my question: I'd need to trigger a script whenever an email
is processed and sent. This trigger should be based on some header
fields (e.g. subject).
I tried playing with header_checks but without getting anything.
Can you please help me?
Thanks
Giuseppe.
Postfix doesn't do that directly, but there are several round-about
ways to make it work.
One incomplete example:
Set up an alias that pipes to your script.
aliases:
scriptuser: | /path/to/script
Use header_checks with a BCC action to send trigger mail to the
scriptuser
header_checks:
/^target text$/ BCC sciptuser@localhost
Note this requires localhost is listed in mydomains and is delivered
by the postfix local delivery agent.
Alternately, you can probably convince regex-milter to do this.
-- Noel Jones