rspamd rejects and greylists messages from Postfix whitelisted senders

Discussion in 'Installation/Configuration' started by slagroom, Sep 18, 2024.

  1. slagroom

    slagroom Member

    Seems that the Whitelist in ISPConfig has no influence whatsoever on users policy or whitelist settings.
    Also, if a user picks "Wants all spam", how and where is this set for rspamd? I don't see it anywhere in rspamd config.
    All I see is that rspamd indeed has rejected a message that a user has deliberately whitelisted.
     
  2. pyte

    pyte Well-Known Member HowtoForge Supporter

    Which whitelist are you talking about? Be aware that policys and entries for in the user specific white/blacklists have a priority setting which prioritizes one rule over another if the score is set accordingly.
    When you set "Wants all spam" there will be a entry for the user in question in /etc/rspamd/local.d/users folder in which the setting "want_spam = yes" is set which is a built-in rspamd option.
     
  3. slagroom

    slagroom Member

    This is the user's config under /etc/rspamd/local.d/users :
    Code:
    ispc_spamfilter_user_36 {
            priority = 30;
            rcpt = "[email protected]";
    
            apply {
                    CLAM_VIRUS = 1999.0;
                    JUST_EICAR = 1999.0;
                    actions {
                            reject = null;
                                                    greylist = null;
                                            }
            }
    
    How do I check if rspamd or postfix is actually prioritizing this policy over others?
     
  4. pyte

    pyte Well-Known Member HowtoForge Supporter

    You can check if there is a rule that is applied to the whole domain xxx.nl which has a higher priority. Another method of debugging this is checking the rspamd.log and more in-depth enable the debug symbols in rspamd.

    What rule(s) does not work in your setup? Can you give an example?
     
  5. slagroom

    slagroom Member

    By "higher priority" you mean a higher number or a lower number? This should really be said in ISPconfig UI. For many users this is a question they posed at me "What does the priority do/mean? Is Priority 1 a value over Priority 10, or the other way around?" which is a valid question. In many applications, Priority is actually set from 1 down, for cops and firemen for example "PRIO 1" is always the most important call.
     
  6. pyte

    pyte Well-Known Member HowtoForge Supporter

    The ISPConfig UI displays this AFAIK in all mail related priority fields like this:
    Code:
    1 - lowest
    2
    3
    4
    5 - normal
    6
    7
    8
    9
    10 - highest
    I think this is self explanatory
     
  7. slagroom

    slagroom Member

    Eeh? For mail servers (MX) for example, priority is scaled according to *position*. I.e. 1 has priority over 10. Since 10 is a higher number than 1, it's totally unclear what this even means for spam. This is causing double negation, which makes it very hard to follow..
     
  8. slagroom

    slagroom Member

    priority = 30;

    On a scale from 1 to 10, what is 30 ? Whoever thought that would be a good idea, to use a different priority scale in config files than the one users see? Here's ChatGPT's response:

    About RSpamd config. There's a user config file that looks like this: ispc_spamfilter_user_36 { priority = 30; rcpt = "[email protected]"; apply { CLAM_VIRUS = 1999.0; JUST_EICAR = 1999.0; actions { reject = null; greylist = null; } } What does this priority scale relate to? Is it a scale from 1 to 100, and does 1 have priority over 100, or who thought that was a handy way to note it down in config?
    ChatGPT said:
    In Rspamd, the priority setting determines the order in which configuration blocks (like filters or policies) are applied. The lower the number, the higher the priority. So, a priority of 1 will be applied before a priority of 100. In other words, 1 has more priority over 100.

    This scale doesn't necessarily cap at 100—it can technically go much higher, depending on the setup. It's up to the administrator to define their own thresholds. Lower-priority rules (with higher numbers) will only be applied if no higher-priority rule (with a lower number) matches the criteria.

    The reason for this numbering choice is rooted in the general practice of many configuration systems, where lower numbers mean "higher" priority. It's a convention that's widely used in system configurations, even though it can seem counterintuitive at first glance.​
     
    Last edited: Sep 20, 2024
  9. pyte

    pyte Well-Known Member HowtoForge Supporter

  10. slagroom

    slagroom Member

    Again: Most, if not ALL, priority scales have higher priority set for a lower number.
    Second, the config file has "priority 30" in it, which does not match the 1 to 10 priority scale the ISPconfig documentation mentions. What do you expect users to think?
     
  11. pyte

    pyte Well-Known Member HowtoForge Supporter

    Admins should not be needed to check these files anyways. But if you do so and wondering why things are the way they are you might refer to the upstream documentation of the product or the code itself. I don't know what is confusing about this in the first place as the panel clearly states what is highest and lowest priority in the spamfilter black and whitelist forms.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig was originally built for amavisd, and for compatibility reasons, we use the scale for Rspamd that we used for Amavis. I doubt anyone needs a scale from 1 to 30 to set a priority; a scale from 1 to 10 is more than enough and less confusing for users. And how ISPConfig internally translates a scale into values in config files internally does not matter to a user, but you can read the code if you want to understand the email config better.

    The ISPConfig UI clearly shows the highest and lowest priority (see screenshot), so there is no need for users to look into any config files.

    The priority scale is 1 - 10, as you can see in the screenshots I posted, so it matches exactly what the manual mentions. And as I said, how ISPConfig translates this for various backends does not matter to the user at all.

    2024-09-22 14_06_18-ISPConfig.png

    2024-09-22 14_10_47-ISPConfig.png
     
    pyte likes this.

Share This Page