Add anti-spam
modules/config/mail.scm
71 | 71 | table blacklist file:" blacklist-file " | |
72 | 72 | ||
73 | 73 | # A simple spam filter | |
74 | + | filter check-rdns phase connect match !rdns disconnect \"550 no rDNS\" | |
74 | 75 | filter spam-filter phase mail-from match mail-from <blacklist> reject \"555 Your spam level is over NINE THOUSAND!\" | |
76 | + | filter rspamd proc-exec \"" opensmtpd-filter-rspamd "/libexec/opensmtpd/filter-rspamd\" | |
75 | 77 | ||
76 | 78 | # port 25 is used only for receiving from external servers, and they may start a | |
77 | 79 | # TLS session if the want. | |
78 | - | listen on " interface " port 25 tls pki lepiller.eu filter spam-filter | |
80 | + | listen on " interface " port 25 tls pki lepiller.eu filter { check-rdns, spam-filter, rspamd } | |
79 | 81 | # For sending messages from outside of this server, you need to authenticate and | |
80 | 82 | # use TLS. | |
81 | 83 | listen on " interface " port 587 tls-require pki lepiller.eu mask-src auth <passwd> | |
82 | 84 | # Localhost is used by the .onion, so we use the same configuration for | |
83 | 85 | # local connections. | |
84 | - | listen on lo port 25 tls pki lepiller.eu filter spam-filter | |
86 | + | listen on lo port 25 tls pki lepiller.eu filter { check-rdns, spam-filter, rspamd } | |
85 | 87 | # Since incoming connection uses tor, we don't need tls, but still require | |
86 | 88 | # authentication; we're not a relay | |
87 | 89 | listen on lo port 587 tls pki lepiller.eu mask-src auth <passwd> | |
… | |||
151 | 153 | (type 'domainkeys) | |
152 | 154 | (method "nofws"))))))))) | |
153 | 155 | ||
156 | + | (define (lepiller-rspamd-service) | |
157 | + | (service rspamd-service-type)) | |
158 | + | ||
154 | 159 | (define* (lepiller-mail-services #:key interface domain) | |
155 | 160 | (list | |
156 | 161 | (lepiller-smtp-service interface domain) | |
157 | 162 | (lepiller-imap-service domain) | |
158 | - | (lepiller-dkim-service domain))) | |
163 | + | (lepiller-dkim-service domain) | |
164 | + | (lepiller-rspamd-service))) | |
159 | 165 |