Score:0

How to apply a ratelimit in rspamd using a selector that matches the sender with domains from a list?

lb flag

I have created a map


UNPOLITE_SENDERS_MAP {
    type="selector";
    symbol="UNPOLITE_SENDER"
    selector = 'from("smtp","orig"):domain.get_tld';
    score = 3.5;
    map="/etc/rspamd/local.d/maps.d/unpolite_senders_expr";
    message="Detected un unusal ammount of email, please take a break"; 
    }

and the senders are correctly matched against that map. (Can be seen in the logs)

I have tried to apply a rate limit based on that map using

other_limit = {
      selector = "emails:apply_map('UNPOLITE_SENDERS_MAP')";
      bucket = [{
        symbol = "LOCAL_RATE_10_30";
        burst = 3;
        rate = "10/30s";
        message = "Unusual message rate 10-30, please take a break";
        }]

However that rate limit is not being applied.

The configurations are in the proper places. I cannot configure a rete based on a map and for sure I'm missing something with the selector part of the rate limit configuration.

Any ideas?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.