Mailing List Message #104215
From: Nicolas Hatier <>
Subject: Re: Feature request: helper protocol enhancement
Date: Thu, 16 May 2013 21:47:19 -0400
To: CommuniGate Pro Discussions <>

Good question. I guess this will be left as an exercise to the developpers. I don't think it would be efficient for the headers to be removed from the message immediately.


On 2013-05-16 16:18, Jeff Wark wrote:
These seem like good additions to the helper protocol.

Just for clarification, how would the REMOVEHEADER work?

The ADDHEADER command results in headers being added.  Those headers are then available to subsequent helpers via the HEADERS command.  Would the removed headers be removed from the queued message immediately or would they be available via the HEADERS command as well?

On 05/16/2013 01:02 PM, Nicolas Hatier wrote:

Here's a feature request that has been informally asked a few times a long time ago since the introduction of the ADDHEADER answer and rule action.

The External Helper protocol should be enhanced for the helpers to be able to know the headers added by previous rules.

The protocol could be enhanced this way:
  • The protocol version become 4 instead of 3.
  • The server would not send additional information if the helper answer INTF 3
  • The FILE command would be enhanced. If there's additional headers available in memory, CGP would send:
    • 1 FILE "filename.msg" HEADERS
  • If there's no headers, CGP would send the FILE command as in version 3
    • 1 FILE "filename.msg"
  • If the helper sees the tag "HEADERS" and want to know the additional headers, it would answer with
    • 1 HEADERS
  • CGP would then give a single reply containing all the additional headers:
    • 1 HEADERS "X-AdditionalHeader: value\eX-AdditionalHeader2: value\e[...]"
  • The processing would then continue as usual.
Also, a RemoveHeader answer would be useful. This would not be the final answer of the helper, the processing would still only complete with one of the four available answers (OK, ERROR, FAILURE, ADDHEADER).

The helper would be able to command:
  • 1 REMOVEHEADER "X-SomeHeader", which would remove all X-SomeHeader headers, or
  • 1 REMOVEHEADER "X-SomeHeader: SomeValue", which would remove the X-SomeHeader header matching the value

The message could be repeated as many times as required, only one header per command. The header would be removed from the actual message and/or from the additional headers in CGP's memory.

To either of these commands, CGP would respond either

The second answer is still a OK answer as it's not a fatal error, it is OK for the helper to ask a nonexistent header to be removed.

These two additions would make external helpers more efficient and easier to use. The REMOVEHEADER command would prevent helpers from being forced to re-submit messages. The HEADERS tag would allow filters to be chained more efficiently, and would allow signing helpers such as DKIM to include added headers in the signature. Currently any DKIM helper must limit the headers included in the signature to a limited set, as it can't know what previous filters added to the message.

Nicolas Hatier


Nicolas Hatier, ing. <>
Niversoft idées logicielles -

Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster