Feature request: helper protocol enhancement
Nicolas Hatier <nicolas.hatier <at> niversoft.com>
2013-05-16 17:02:36 GMT
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
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
- If the helper sees the tag "HEADERS" and want to know the
additional headers, it would answer with
- CGP would then give a single reply containing all the
- 1 HEADERS "X-AdditionalHeader:
- 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,
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
1 OK REMOVED
1 OK NOTFOUND
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.