Mailing List Archive

how to enable both spamassassin and rspamd to run together
Heloo
Is it possible to run spamassassin and rspamd at the same time
spamd_address = 127.0.01 783 : 127.0.0.1 11333 variant=rspamdthis rule unfortunately will not allow spamassassin and rspamd to run at the same timeregardsslawek

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: how to enable both spamassassin and rspamd to run together [ In reply to ]
On 05/09/2023 17:04, S?awomir Dworaczek via Exim-users wrote:

> Is it possible to run spamassassin and rspamd at the same time

Yes. (Although I don't use rspamd this should work.) See:

https://www.exim.org/exim-html-current/doc/html/spec_html/ch-content_scanning_at_acl_time.html

"The spamd_address variable is expanded before use if it starts with a
dollar sign."

So I set:

spamd_address = $acl_m_spamengine

In the acl which I split into sub acls but the flow is:

# set the spam engine
set acl_m_spamengine = 127.0.0.1:783
# invoke the spam engine
spam = ...
# save the result
set acl_m_sa_score = $spam_score_int ...
# set another spam engine
set acl_m_spamengine = 127.0.0.1:9783
# invoke the spam engine
spam = ...
# save the result
set acl_m_jspamd_score = $spam_score_int ...
# process results do decide if deny or accept





--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: how to enable both spamassassin and rspamd to run together [ In reply to ]
My config for doing exactly that is as follows:

defer
message = Deferred.
set acl_m_spamd = 127.0.0.1 11333 variant=rspamd
spam = Debian-exim:true
condition = ${if eq{$spam_action}{soft reject}}

deny
message = Junk: $spam_score
log_message = rspamd hits=$spam_score report=$spam_report
action=$spam_action
set acl_m_spamd = 127.0.0.1 11333 variant=rspamd
spam = Debian-exim:true
add_header = X-Rspamd-Status: $spam_report hits=$spam_score
condition = ${if eq{$spam_action}{reject}}

deny
message = Junk: $spam_score
log_message = spamassassin hits=$spam_score report=$spam_report
action=$spam_action
set acl_m_spamd = 127.0.0.1 783
spam = Debian-exim:true
add_header = X-Spamassassin-Status: $spam_report
hits=$spam_score
condition = ${if >{$spam_score_int}{50}{true}{false}}




On Wed, 6 Sept 2023 at 14:38, James via Exim-users <
exim-users@lists.exim.org> wrote:

> On 05/09/2023 17:04, S?awomir Dworaczek via Exim-users wrote:
>
> > Is it possible to run spamassassin and rspamd at the same time
>
> Yes. (Although I don't use rspamd this should work.) See:
>
>
> https://www.exim.org/exim-html-current/doc/html/spec_html/ch-content_scanning_at_acl_time.html
>
> "The spamd_address variable is expanded before use if it starts with a
> dollar sign."
>
> So I set:
>
> spamd_address = $acl_m_spamengine
>
> In the acl which I split into sub acls but the flow is:
>
> # set the spam engine
> set acl_m_spamengine = 127.0.0.1:783
> # invoke the spam engine
> spam = ...
> # save the result
> set acl_m_sa_score = $spam_score_int ...
> # set another spam engine
> set acl_m_spamengine = 127.0.0.1:9783
> # invoke the spam engine
> spam = ...
> # save the result
> set acl_m_jspamd_score = $spam_score_int ...
> # process results do decide if deny or accept
>
>
>
>
>
> --
> ## subscription configuration (requires account):
> ##
> https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
> ## unsubscribe (doesn't require an account):
> ## exim-users-unsubscribe@lists.exim.org
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/
>

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: how to enable both spamassassin and rspamd to run together [ In reply to ]
Heloo

Unfortunately it doesn't work, in the rspamd interface I can't see the
scanned emails, if you set spamd_address - 127.0.0.1 11333 variant=rspamd
then rspamd works


My settings

spamd_address = $acl_m_spamengine

acl_check_content:

# scan the message with rspamd
warn spam = nobody:true


# use greylisting available in rspamd v1.3+
defer message = Please try again later
set acl_m_spamengine = 127.0.0.1 11333 variant=rspamd
condition = ${if eq{$spam_action}{soft reject}}

deny message = Message discarded as high-probability spam
set acl_m_spamengine = 127.0.0.1 11333 variant=rspamd
condition = ${if eq{$spam_action}{reject}}

# Remove foreign headers
warn
set acl_m_spamengine = 127.0.0.1 11333 variant=rspamd
remove_header = x-spam-bar : x-spam-score : x-spam-report : x-spam-status

# add spam-score and spam-report header when "add header" action is
recommended by rspamd
warn
set acl_m_spamengine = 127.0.0.1 11333 variant=rspamd
condition = ${if eq{$spam_action}{add header}}
add_header = X-Spam-Score: $spam_score ($spam_bar)
add_header = X-Spam-Report: $spam_report

# add x-spam-status header if message is not ham
# do not match when $spam_action is empty (e.g. when rspamd is not
running)
warn
set acl_m_spamengine = 127.0.0.1 11333 variant=rspamd
! condition = ${if match{$spam_action}{^no action\$|^greylist\$|^\$}}
add_header = X-Spam-Status: Yes

# add x-spam-bar header if score is positive
warn
set acl_m_spamengine = 127.0.0.1 11333 variant=rspamd
condition = ${if >{$spam_score_int}{0}}
add_header = X-Spam-Bar: $spam_bar

accept
----- Original Message -----
From: "James via Exim-users" <exim-users@lists.exim.org>
To: <exim-users@lists.exim.org>
Sent: Wednesday, September 6, 2023 3:36 PM
Subject: [exim] Re: how to enable both spamassassin and rspamd to run
together


> On 05/09/2023 17:04, S?awomir Dworaczek via Exim-users wrote:
>
>> Is it possible to run spamassassin and rspamd at the same time
>
> Yes. (Although I don't use rspamd this should work.) See:
>
> https://www.exim.org/exim-html-current/doc/html/spec_html/ch-content_scanning_at_acl_time.html
>
> "The spamd_address variable is expanded before use if it starts with a
> dollar sign."
>
> So I set:
>
> spamd_address = $acl_m_spamengine
>
> In the acl which I split into sub acls but the flow is:
>
> # set the spam engine
> set acl_m_spamengine = 127.0.0.1:783
> # invoke the spam engine
> spam = ...
> # save the result
> set acl_m_sa_score = $spam_score_int ...
> # set another spam engine
> set acl_m_spamengine = 127.0.0.1:9783
> # invoke the spam engine
> spam = ...
> # save the result
> set acl_m_jspamd_score = $spam_score_int ...
> # process results do decide if deny or accept
>
>
>
>
>
> --
> ## subscription configuration (requires account):
> ##
> https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
> ## unsubscribe (doesn't require an account):
> ## exim-users-unsubscribe@lists.exim.org
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/
>


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/