.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Amavis::SpamControl::RspamdClient 3pm" .TH Amavis::SpamControl::RspamdClient 3pm 2024-03-14 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "Amavis extension module to use Rspamd as a spam checker" .IX Header "Amavis extension module to use Rspamd as a spam checker" Copyright (c) 2019 Ralph Seichter, partially based on the SpamdClient extension. Released under GNU General Public License; see Amavis LICENSE file for details. .SS "Example configuration #1 (local Rspamd)" .IX Subsection "Example configuration #1 (local Rspamd)" .Vb 5 \& # Rspamd running on the same machine as Amavis. Default URL \& # is http://127.0.0.1:11333/checkv2 , matching Rspamd\*(Aqs \& # "normal" worker defaults. \& @spam_scanners = ( [ \& \*(AqLocal Rspamd\*(Aq, \*(AqAmavis::SpamControl::RspamdClient\*(Aq, \& \& # Adjust scores according to Rspamd\*(Aqs "required score" \& # setting (defaults to 15). Scores reported by Rspamd \& # will be multiplied with this factor. The following \& # adjusts Rspamd scores to SpamAssassin scores. While \& # this setting is technically optional, not adjusting \& # scores is prone to cause headaches. \& score_factor => $sa_tag2_level_deflt / 15.0, \& \& # MTA name is used to assess validity of existing \& # Authentication\-Results headers, e.g. if DKIM/DMARC \& # validation has already happened. \& mta_name => \*(Aqmail.example.com\*(Aq, \& ] ); .Ve .SS "Example configuration #2 (remote Rspamd)" .IX Subsection "Example configuration #2 (remote Rspamd)" .Vb 5 \& # Rspamd running behind HTTPS\-capable proxy using basic \& # authentication to control access. \& @spam_scanners = ( [ \& \*(AqRemote Rspamd\*(Aq, \*(AqAmavis::SpamControl::RspamdClient\*(Aq, \& url => \*(Aqhttps://rspamd\-proxy.example.com/checkv2\*(Aq, \& \& # Response timeout in seconds. Default is 60, matching \& # Rspamd\*(Aqs standard config for the "normal" worker. \& timeout => 42, \& \& # SSL\-options and \-credentials passed to LWP::UserAgent, \& # see https://metacpan.org/pod/LWP::UserAgent . Default: \& # ssl_opts => { verify_hostname => 1 }, \& credentials => { \& # The following : must match the \*(Aqurl\*(Aq \& # defined above or credentials won\*(Aqt be transmitted. \& netloc => \*(Aqrspamd\-proxy.example.com:443\*(Aq, \& # Remote authentication realm \& realm => \*(AqRspamd restricted access\*(Aq, \& username => \*(AqMarco\*(Aq, \& password => \*(AqPolo\*(Aq, \& }, \& \& # Don\*(Aqt scan messages remotely if the body size extends \& # the following limit (optional setting). \& mail_body_size_limit => 32 * 1024, \& \& score_factor => $sa_tag2_level_deflt / 15.0, \& mta_name => \*(Aqmail.example.com\*(Aq, \& ] ); .Ve .SS Requirements .IX Subsection "Requirements" In addition to Amavis' core requirements, this extension needs the following additional Perl modules: .PP .Vb 5 \& JSON \& HTTP::Message \& LWP::UserAgent \& LWP::Protocol::https \& Net::SSLeay .Ve .PP Should your host OS not provide the necessary packages, these modules can be obtained via https://www.cpan.org .