Skip to content

Commit

Permalink
Update protocol.md
Browse files Browse the repository at this point in the history
Remove mention of the control block
  • Loading branch information
vstakhov authored Sep 25, 2024
1 parent 102c0c6 commit f799e05
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions doc/developers/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,26 +229,6 @@ Where `<header_name>` represents header's name, and the value is the order of th
}
```

## Rspamd JSON control block

Starting from Rspamd version 0.9, it's also possible to transmit additional data by prepending a JSON control block to a message. Therefore, you have the flexibility to utilize either headers or a JSON block to convey information from the MTA to Rspamd.

To employ a JSON control block, you must include an additional header named `Message-Length` when forwarding the message to Rspamd. This header should specify the size of the message, but it should **exclude** the JSON control block. Consequently, the size of the control block is calculated as `Content-Length - Message-Length`. Rspamd assumes that the message immediately follows the control block without any additional CRLF (Carriage Return Line Feed) characters. This approach is equally compatible with streaming transfers. However, even when you don't explicitly specify `Content-Length`, you are still required to specify `Message-Length`.

Here's an illustrative example of a JSON control block:

~~~json
{
"from": "[email protected]",
"pass_all": "true",
"ip": "95.211.146.161",
"helo": "localhost.localdomain",
"hostname": "localhost"
}
~~~

Furthermore, it's worth noting that [UCL](https://github.com/vstakhov/libucl) JSON extensions and syntax conventions are fully supported within the control block.

## Curl example

To check a message without rspamc:
Expand Down

0 comments on commit f799e05

Please sign in to comment.