Pass all mails to user, not matter what spam score message has. Just tag it. How to?

203 views
Skip to first unread message

Thomas Plant

unread,
Aug 9, 2017, 5:05:35 AM8/9/17
to rspamd
Hello,

we have some users who want all messages coming in. No matter how high the spam score is. Just want it tagged and filter then by themselves.

I tried to do it with settings {} in rspamd.conf.local, but if the mail is spam it does not geht honored, if message is clean the setting is evaluated, as of the logs.

I have the following in rspamd.conf.local:
settings {
        spam_lovers {
                id = "spam_lovers";
                priority = high;
                rcpt = "in...@example.com";
                apply "no action" {
                        actions {
                                reject = 101.0;
                                greylist = 10.0;
                                "add header" = 6.0;
                        }
                }
        }
}


If I send a mail with the GTUBE pattern, the mail gets refused and strangely no entry in the history on the webinterface.

This is the log entry if I send a clean message with the settings being honored:
2017-08-09 10:43:52 #32137(rspamd_proxy) <b1b3d0>; lua; settings.lua:293: <99a8ab9b-bf9e-152b-6d58-f9deed202daa@xxxxxx> apply settings according to rule spam_lovers

If there is the GTUBE pattern there is no such line an no recording in the history.

Thanks for help,
Thomas

Vsevolod Stakhov

unread,
Aug 9, 2017, 5:10:22 AM8/9/17
to Thomas Plant, rspamd
Gtube is special and it bypasses everything.

Thomas Plant

unread,
Aug 9, 2017, 5:20:46 AM8/9/17
to rspamd, blues...@gmail.com
And I have been testing all day for nothing. 

Will look for a real spam message and see if it works.

Thanks.

Thomas Plant

unread,
Aug 9, 2017, 5:37:49 AM8/9/17
to rspamd, blues...@gmail.com
Hi,

does not work as expected, the settings get evaluated with a spam message, but it blocks it anyway:

2017-08-09 11:33:29 #32137(rspamd_proxy) <d37270>; lua; settings.lua:293: <221ed6c3-f255-e805...@gmail.com> apply settings according to rule spam_lovers
2017-08-09 11:33:29 #32137(rspamd_proxy) <d37270>; proxy; fuzzy_insert_result: found fuzzy hash(txt) eb892531bed7ddeb6e31ec108b7be5342209891709b64c4887107493b271210992a489c815ee242f0e5a5db4178c9cac89e3d3831575aa0c48fd603b57e07877 with weight: 1.00, probability 1.00, in list: FUZZY_DENIED:1
2017-08-09 11:33:29 #32137(rspamd_proxy) <d37270>; proxy; fuzzy_insert_result: found fuzzy hash(txt) a6343df980f4344a6ce15da821a6a8984ebb63d9d50e68e3e9d8651f865371914af08c924310d0a2a4f083a913b41b1b4f91b18a632bab69f125db032429bfac with weight: 0.00, probability 0.69, in list: FUZZY_DENIED:1
2017-08-09 11:33:34 #32137(rspamd_proxy) <d37270>; proxy; rspamd_task_write_log: id: <221ed6c3-f255-e805...@gmail.com>, qid: <111D26006FA7F>, ip: 2a00:1450:400c:c0c::242, from: <ab...@gmail.com>, (default: T (reject): [17.25/16.00] [FUZZY_DENIED(12.00){1:eb892531be:1.00:txt;1:a6343df980:0.69:txt;},BAYES_SPAM(4.00){100.00%;},HTML_SHORT_LINK_IMG_1(2.00){},DMARC_POLICY_ALLOW(-0.25){gmail.com;none;},R_DKIM_ALLOW(-0.20){gmail.com;},R_SPF_ALLOW(-0.20){+ip6:2a00:1450:4000::/36;},MIME_GOOD(-0.10){multipart/alternative;text/plain;},ARC_NA(0.00){},ASN(0.00){asn:15169, ipnet:2a00:1450:400c::/48, country:US;},FREEMAIL_ENVFROM(0.00){gmail.com;},FREEMAIL_FROM(0.00){gmail.com;},FROM_EQ_ENVFROM(0.00){},FROM_HAS_DN(0.00){},IP_SCORE(0.00){country: US(-0.79);},MID_RHS_MATCH_FROM(0.00){},PREVIOUSLY_DELIVERED(0.00){in...@abcd.com;},RCPT_COUNT_ONE(0.00){1;},RCVD_COUNT_THREE(0.00){3;},RCVD_IN_DNSWL_NONE(0.00){2.4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.c.0.c.0.c.0.0.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0;},RCVD_NO_TLS_LAST(0.00){},RCVD_VIA_SMTP_AUTH(0.00){},SUBJECT_ENDS_EXCLAIM(0.00){},TO_DN_ALL(0.00){},TO_MATCH_ENVRCPT_ALL(0.00){}]), len: 30341, time: 5042.060ms real, 22.864ms virtual, dns req: 48, digest: <843e41dac8e7c18a84439a2aeadb71b2>, rcpts: <in...@abcd.com>, mime_rcpt: <in...@abcd.com>
2017-08-09 11:33:34 #32137(rspamd_proxy) <d37270>; proxy; rspamd_protocol_http_reply: regexp statistics: 0 pcre regexps scanned, 10 regexps matched, 166 regexps total, 84 regexps cached, 0B bytes scanned using pcre, 32.14k bytes scanned total

Any hints how to make it right?

Thanks,
Thomas

Vsevolod Stakhov

unread,
Aug 9, 2017, 6:09:21 AM8/9/17
to Thomas Plant, rspamd
You have a mistake in your "apply" part. It should be either

apply "default" { ... }

or even better:

apply { ... }

In your case, you can just replace "apply" with a more simple definition:

want_spam = true;

There is also an alias called `whitelist` for `want_spam` policy.

Thomas Plant

unread,
Aug 9, 2017, 6:13:06 AM8/9/17
to Vsevolod Stakhov, rspamd
Yes saw the error and corrected it a few minutes ago. To much trying on
the configuration file ;-)
When I set want_spam=yes it seems to me it does no spam checking at all,
and therefore no subject rewriting etc.

Thanks will try the new aplly {} setting immediately,
Thomas

Thomas Plant

unread,
Aug 9, 2017, 6:27:44 AM8/9/17
to Vsevolod Stakhov, rspamd
Am 09.08.2017 um 12:09 schrieb Vsevolod Stakhov:
>
> You have a mistake in your "apply" part. It should be either
>
> apply "default" { ... }
>
> or even better:
>
> apply { ... }
>
> In your case, you can just replace "apply" with a more simple definition:
>
> want_spam = true;
>
> There is also an alias called `whitelist` for `want_spam` policy.

It is working now, partially. It rewrites the subject but no headers
created.
Not a big problem, I would just be curious why no headers are being
created.....

Greetings,
Thomas

Thomas Plant

unread,
Aug 9, 2017, 7:41:36 AM8/9/17
to rspamd, vsev...@highsecure.ru
And the headers work to. Set local.d/milter_headers.conf with a line "extended_spam_headers = true;" and the headers where there.

Greetings,
Thomas 
Reply all
Reply to author
Forward
0 new messages