• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H30-Nov-2020-

.gitignoreH A D30-Nov-202014

LICENSEH A D30-Nov-2020792

README.mdH A D30-Nov-20202.6 KiB

filter-rspamd.8H A D30-Nov-20202.2 KiB

filter-rspamd.goH A D30-Nov-202012.5 KiB

go.modH A D30-Nov-2020111

go.sumH A D30-Nov-2020207

pledge.goH A D30-Nov-2020196

pledge_openbsd.goH A D30-Nov-2020270

README.md

1# filter-rspamd
2
3## Description
4This filter implements the Rspamd protocol and allows OpenSMTPD to request an Rspamd analysis
5of an SMTP transaction before a message is committed to queue.
6
7
8## Features
9The filter currently supports:
10
11- greylisting
12- adding X-Spam related headers to a message
13- rewriting Subject
14- DKIM-signing message
15- Rspamd-provided SMTP replies
16- Allow Rspamd to add and remove headers
17
18
19## Dependencies
20The filter is written in Golang and doesn't have any dependencies beyond the Go extended standard library.
21
22It requires OpenSMTPD 6.6.0 or higher.
23
24
25## How to install
26Install from your operating system's preferred package manager if available.
27On OpenBSD:
28```
29$ doas pkg_add opensmtpd-filter-rspamd
30quirks-3.167 signed on 2019-08-11T14:18:58Z
31opensmtpd-filter-rspamd-0.1.x: ok
32$
33```
34
35Install using Go:
36```
37$ GO111MODULE=on go get github.com/poolpOrg/filter-rspamd
38$ doas install -m 0555 ~/go/bin/filter-rspamd /usr/local/libexec/smtpd/filter-rspamd
39```
40
41Alternatively, clone the repository, build and install the filter:
42```
43$ cd filter-rspamd/
44$ go build
45$ doas install -m 0555 filter-rspamd /usr/local/libexec/smtpd/filter-rspamd
46```
47
48On Ubuntu the directory to install to is different:
49```
50$ sudo install -m 0555 filter-rspamd /usr/libexec/opensmtpd/filter-rspamd
51```
52
53
54## How to configure
55The filter itself requires no configuration.
56
57It must be declared in smtpd.conf and attached to a listener for sessions to go through rspamd:
58```
59filter "rspamd" proc-exec "filter-rspamd"
60
61listen on all filter "rspamd"
62```
63
64A remote rspamd instance can be specified by providing the -url parameter to the filter:
65```
66filter "rspamd" proc-exec "filter-rspamd -url http://example.org:11333"
67
68listen on all filter "rspamd"
69```
70
71Optionally a `-settings-id` parameter can be used to select a specific rspamd
72setting. One usecase is for example to apply different rspamd rules to incoming
73and outgoing emails:
74
75```
76filter "rspamd-incoming" proc-exec "filter-rspamd"
77filter "rspamd-outgoing" proc-exec "filter-rspamd -settings-id outgoing"
78
79listen on all filter "rspamd-incoming"
80listen on all port submission filter "rspamd-outgoing"
81```
82
83And in `rspamd/local.d/settings.conf`:
84
85```
86outgoing {
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
99Every email passed through the `rspamd-outgoing` filter will use the rspamd `outgoing` rule instead of the default rule.
100
101Any configuration with regard to thresholds or enabled modules must be done in rspamd itself.
102