Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] no metadata exported if rcpt/from rule exists via settings #3552

Closed
bauerstefan opened this issue Nov 15, 2020 · 4 comments
Closed

[BUG] no metadata exported if rcpt/from rule exists via settings #3552

bauerstefan opened this issue Nov 15, 2020 · 4 comments
Labels

Comments

@bauerstefan
Copy link

Prerequisites

X Put an X between the brackets on this line if you have done all of the following:
Read about bug reporting in general: https://rspamd.com/doc/faq.html#how-to-report-bugs-found-in-rspamd
Enabled relevant debugging logs: https://rspamd.com/doc/faq.html#how-to-debug-some-module-in-rspamd
Checked the FAQs about Core files in case of fatal crash: https://rspamd.com/doc/faq.html#how-to-figure-out-why-rspamd-process-crashed
Tried ASAN package and obtained the ASAN report (if possible): https://rspamd.com/doc/faq.html#asan-builds
Checked that your issue isn't already filed: https://github.com/issues?utf8=%E2%9C%93&q=is%3Aissue+user%3Arspamd
Checked that there is not already an experimental package or master branch

Describe the bug
metadata export to http backend does not export any data if rcpt/from rule exists.
Steps to Reproduce

1.set local.d/metadata_exporter.conf to

rules {

LOG_REMOTE1 {
backend = "http";
url = "https://remot.esite:443/log.php";
selector = "default";
formatter = "json";
}

Reading settings from remote url with
rspamd.conf.override:settings = "https://remote.site/wl_bl.txt"

and content:

V1arAD297w {
from = "@sender.tld";
rcpt = "@recipient.tld";
want_spam = yes;
}

results in no metadata is exported. Not even a call to remote site. Dropping above settings, all is fine and exported.

rspamd just logs:

2020-06-05 12:16:19 #13462(normal) ; task; rspamd_message_parse: loaded message; id: kcEE.pyzgXOsPSjaPL7DxF3Jxqw.gJupWiI71gE@mx1.sender-domain; queue-id: ; size: 5835; checksum: <3fd7074142546428ffc6d346a2e7edd7>
2020-06-05 12:16:19 #13462(normal) ; lua; settings.lua:373: kcEE.pyzgXOsPSjaPL7DxF3Jxqw.gJupWiI71gE@mx1.sender-domain apply settings according to rule V1arAD297w (rcpt,from matched)
2020-06-05 12:16:19 #13462(normal) ; task; rspamd_task_write_log: id: kcEE.pyzgXOsPSjaPL7DxF3Jxqw.gJupWiI71gE@mx1.sender-domain, qid: , ip: remote-ip, from: sender@sender.tld, (default: S (no action): [0.00/500.00] []), len: 5835, time: 18.685ms, dns req: 0, digest: <3fd7074142546428ffc6d346a2e7edd7>, rcpts: stefan@recipient.tld, mime_rcpts: stefan@recipient.tld
2020-06-05 12:20:08 #13462(normal) ; task; rspamd_message_parse: loaded message; id: kcEE.aIYWPGAyTVeRIuh2AE3hLQ.gKWP4iI71gE@mx1.sender-domain; queue-id: <1EE195DC85>; size: 5789; checksum:
2020-06-05 12:20:08 #13462(normal) ; lua; settings.lua:373: kcEE.aIYWPGAyTVeRIuh2AE3hLQ.gKWP4iI71gE@mx1.sender-domain apply settings according to rule V1arAD297w (rcpt,from matched)
2020-06-05 12:20:08 #13462(normal) ; task; rspamd_task_write_log: id: kcEE.aIYWPGAyTVeRIuh2AE3hLQ.gKWP4iI71gE@mx1.sender-domain, qid: <1EE195DC85>, ip: sender-IP, from: sender@sender.tld, (default: S (no action): [0.00/500.00] []), len: 5789, time: 12.115ms, dns req: 0, digest: , rcpts: stefan@recipient.tld, mime_rcpts: <stefan@recipient.tld

Expected behavior

Metadata should be exported.
Versions

2.6-156~buster - Debian 10 64 bit on KVM/VM.

@vstakhov
Copy link
Member

vstakhov commented Nov 15, 2020

Working as intended - when you set want_spam it means that all Rspamd processing is skipped. If that's not what you want then you can use something like symbols_enabled = [] that will turn off all checks with the exception of those that are with flag explicit_disable (and metadata exporter rule has this flag).

@vstakhov
Copy link
Member

And yes, that should be reflected in docs to avoid this confusion (and new bug reports similar to this one).

@bauerstefan
Copy link
Author

Thank you and sorry for the trouble!

@vstakhov
Copy link
Member

I have updated the documentation to avoid this misunderstanding. Thank you for reporting it anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants