rspamd icon indicating copy to clipboard operation
rspamd copied to clipboard

`Deliver-To` header does not work

Open vttranlina opened this issue 2 years ago • 2 comments

I'm using the HTTP protocol for interacting with Rspamd.

As a document write:

Defines actual delivery recipient of message. Can be used for personalized statistics and for user specific options.

https://rspamd.com/doc/architecture/protocol.html#http-headers

But when I tried it, it didn't work.

My scenario:

  1. Use HTTP request to /checkV2 to check message A.
curl --location --request POST '/checkv2' \
--header 'Deliver-To: [email protected]' \

Score = 14.2

  1. Use HTTP request to /learnspam to learn message A.
curl --location --request POST '/learnspam' \
--header 'Deliver-To: [email protected]' \

// Message A has been learned

  1. /checkV2 again, and score = 14.7 (changed)
  2. /checkV2 with header Deliver-To: [email protected]
  • Result: score = 14.7
  • Expect: score = 14.2

What something I wrong?

My config

  • statistic.conf
classifier "bayes" {
  tokenizer {
    name = "osb";
  }
  cache {
  }
  new_schema = true; # Always use new schema
  store_tokens = true; # Redefine if storing of tokens is desired
  signatures = true; # Store learn signatures
  per_user = true; # Enable per user classifier
  users_enabled = true;
  min_tokens = 10;
  backend = "redis";
  min_learns = 0;

  statfile {
    symbol = "BAYES_HAM_USER";
    spam = false;
  }
  statfile {
    symbol = "BAYES_SPAM_USER";
    spam = true;
  }

  learn_condition = 'return require("lua_bayes_learn").can_learn';

  # Autolearn sample
  # autolearn {
  #  spam_threshold = 6.0; # When to learn spam (score >= threshold)
  #  ham_threshold = -0.5; # When to learn ham (score <= threshold)
  #  check_balance = true; # Check spam and ham balance
  #  min_balance = 0.9; # Keep diff for spam/ham learns for at least this value
  #}

  .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/classifier-bayes.conf"
  .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/classifier-bayes.conf"
}

vttranlina avatar Sep 15 '22 05:09 vttranlina

Maybe we can add the context: Integrating Rspamd with Apache James

chibenwa avatar Sep 15 '22 10:09 chibenwa

Our rspamd configdump: https://pastebin.com/xSrnwmKm

Can someone please have a look at this? Is there any possible issue with the per-user Bayes feature?

quantranhong1999 avatar Sep 22 '22 04:09 quantranhong1999

Hello,

Any feedback on this?

chibenwa avatar Oct 21 '22 04:10 chibenwa

Hi, This is actually not an issue of Rspamd but rather our Rspamd Bayes configuration issue. rf: https://github.com/apache/james-project/pull/1269#discussion_r1003128895 Thanks for your support ^.^ Please close this issue.

quantranhong1999 avatar Oct 24 '22 10:10 quantranhong1999