[Rspamd-Users] Not working: task:modify_header(name, mods)

G.W. Haywood rspamd at jubileegroup.co.uk
Wed Aug 24 15:53:03 UTC 2022


Hi there,

On Wed, 24 Aug 2022, lutz.niederer at gmx.net wrote:

> In milter_headers.conf I have a custom routine that should add a header with a specific value.

It might be better if you could show us your configuration.

> I have tried everything with task:modify_header(name, mods).  Nothing works.
> task:modify_header( 'X-ENTRY', { add = {0, "VALUE"}, remove = {0} } )
> This seems to me the closest thing that should work...

I haven't used any of this personally, but that doesn't match my
reading of the documentation:

https://rspamd.com/doc/lua/rspamd_task.html#m3b1f8

> Could someone please show me how this would be called correctly?

Based on my reading of the documentation linked above, try putting
quotes around "add" and "remove" ?

> Otherwise I believe that there may be a bug.

With something like this it's much more likely to be the user's
misunderstanding than to be a fault in the software.  It is however a
little unfortunate that the rendering of the documentation on the
rspamd Website leaves much to be desired from the formatting POV.

Incidentally you should _append_ any header like X-ENTRY so I think you
would want {-1, "VALUE"} instead of {0, "VALUE"} in the 'mods' table.
In general I'd be cautious about removing headers.

-- 

73,
Ged.


More information about the Users mailing list