File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,5 +68,34 @@ filter "rspamd" proc-exec "filter-rspamd -url http://example.org:11333"
6868listen on all filter "rspamd"
6969```
7070
71+ Optionally a ` -settings-id ` parameter can be used to select a specific rspamd
72+ setting. One usecase is for example to apply different rspamd rules to incoming
73+ and outgoing emails:
74+
75+ ```
76+ filter "rspamd-incoming" proc-exec "filter-rspamd"
77+ filter "rspamd-outgoing" proc-exec "filter-rspamd -settings-id outgoing"
78+
79+ listen on all filter "rspamd-incoming"
80+ listen on all port submission filter "rspamd-outgoing"
81+ ```
82+
83+ And in ` rspamd/local.d/settings.conf ` :
84+
85+ ```
86+ outgoing {
87+ id = "outgoing";
88+ apply {
89+ enable_groups = ["dkim"];
90+ actions {
91+ reject = 100.0;
92+ greylist = 100.0;
93+ "add header" = 100.0;
94+ }
95+ }
96+ }
97+ ```
98+
99+ Every email passed through the ` rspamd-outgoing ` filter will use the rspamd ` outgoing ` rule instead of the default rule.
71100
72101Any configuration with regard to thresholds or enabled modules must be done in rspamd itself.
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import (
3030)
3131
3232var rspamdURL * string
33+ var rspamdSettingsId * string
3334var version string
3435
3536var outputChannel chan string
@@ -338,6 +339,10 @@ func rspamdQuery(s *session, token string) {
338339 req .Header .Add ("Queue-Id" , s .tx .msgid )
339340 req .Header .Add ("From" , s .tx .mailFrom )
340341
342+ if * rspamdSettingsId != "" {
343+ req .Header .Add ("Settings-ID" , * rspamdSettingsId )
344+ }
345+
341346 if s .userName != "" {
342347 req .Header .Add ("User" , s .userName )
343348 }
@@ -552,6 +557,8 @@ func skipConfig(scanner *bufio.Scanner) {
552557
553558func main () {
554559 rspamdURL = flag .String ("url" , "http://localhost:11333" , "rspamd base url" )
560+ rspamdSettingsId = flag .String ("settings-id" , "" , "rspamd Settings-ID" )
561+
555562 flag .Parse ()
556563
557564 PledgePromises ("stdio rpath inet dns unveil" )
You can’t perform that action at this time.
0 commit comments