[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Scott Kitterman via Postfix-users
On June 19, 2023 9:44:59 PM UTC, Viktor Dukhovni via Postfix-users wrote: >On Mon, Jun 19, 2023 at 09:12:29PM +, Anton Hvornum via Postfix-users >wrote: > >> Yea found libmilter, appears to have some python bindings too. > >You don't need to go that far down the stack. Try the "Milter"

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Viktor Dukhovni via Postfix-users
On Mon, Jun 19, 2023 at 09:12:29PM +, Anton Hvornum via Postfix-users wrote: > Yea found libmilter, appears to have some python bindings too. You don't need to go that far down the stack. Try the "Milter" package. There are sample Milters available, just tweak one to your needs. For

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Anton Hvornum via Postfix-users
On 6/19/23 20:23, Wietse Venema via Postfix-users wrote: Jaroslaw Rafa via Postfix-users: Dnia 19.06.2023 o godz. 16:53:58 Anton Hvornum via Postfix-users pisze: Thank you, yes that one slipped by me entirely. I'll have to re-evaluate how to mark mails as spam with multiple headers when SPF is

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Wietse Venema via Postfix-users
Jaroslaw Rafa via Postfix-users: > Dnia 19.06.2023 o godz. 16:53:58 Anton Hvornum via Postfix-users pisze: > > > > Thank you, yes that one slipped by me entirely. > > I'll have to re-evaluate how to mark mails as spam with multiple > > headers when SPF is not passing then. > > To add multiple

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Viktor Dukhovni via Postfix-users
On Mon, Jun 19, 2023 at 04:55:59PM +, Anton Hvornum via Postfix-users wrote: > Thank you again, I'm not sure how I would keep adding headers by > executing multiple times - without spamming the DNS server and looking > which headers have already been added. The policy server can keep per

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Jaroslaw Rafa via Postfix-users
Dnia 19.06.2023 o godz. 16:53:58 Anton Hvornum via Postfix-users pisze: > > Thank you, yes that one slipped by me entirely. > I'll have to re-evaluate how to mark mails as spam with multiple > headers when SPF is not passing then. To add multiple headers, it is best to use milter, not a policy

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Anton Hvornum via Postfix-users
On 6/19/23 16:10, Viktor Dukhovni via Postfix-users wrote: On Mon, Jun 19, 2023 at 03:36:13PM +, Anton Hvornum via Postfix-users wrote: > When more than one PREPEND action executes,  the  first prepended  header >  appears before the second etc. prepended header. To get

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Anton Hvornum via Postfix-users
On 6/19/23 16:33, Viktor Dukhovni via Postfix-users wrote: On Mon, Jun 19, 2023 at 04:10:46PM +, Anton Hvornum via Postfix-users wrote: My understanding was that the "check_policy_service unix:private/policy-spf" would hand over key=value pairs, I would use that information to perform one

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Viktor Dukhovni via Postfix-users
On Mon, Jun 19, 2023 at 04:10:46PM +, Anton Hvornum via Postfix-users wrote: > My understanding was that the "check_policy_service > unix:private/policy-spf" would hand over key=value pairs, I would use > that information to perform one spf-check, finalized by me returning all > the

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Anton Hvornum via Postfix-users
The format of access maps and header_body_checks is: Key Value === = pattern action As documented, there can be only ONE action per pattern, and there can be only ONE match per table lookup. I think my issue here is that I don't fully understand what constitutes a

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Viktor Dukhovni via Postfix-users
On Mon, Jun 19, 2023 at 03:36:13PM +, Anton Hvornum via Postfix-users wrote: > > When more than one PREPEND action executes,  the  first prepended  header > >  appears before the second etc. prepended header. To get more than one action to execute you need to call the policy

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Wietse Venema via Postfix-users
Wietse Venema via Postfix-users: > The format of access maps and header_body_checks is: > > Key Value > === = > pattern action > > As documented, there can be only ONE action per pattern, and there > can be only ONE match per table lookup. > > When more than one PREPEND

[pfx] Re: Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Wietse Venema via Postfix-users
The format of access maps and header_body_checks is: Key Value === = pattern action As documented, there can be only ONE action per pattern, and there can be only ONE match per table lookup. When more than one PREPEND action executes (as the result of more than one

[pfx] Is it possible in postfix spf policy to utilize multiple action=prepend to add multiple headers?

2023-06-19 Thread Anton Hvornum via Postfix-users
Hi. I'm quite new to postfix and it's policy framework but I wanted to learn more about it. I thought a good way to learn about policy frameworks/services would be to read the docs and write a simple script that performs a SPF check on incoming emails. A snippet from the script/attempt