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

domain-admin and SQLSpamSettings.pm #1216

Open
stefaweb opened this issue Jul 5, 2021 · 5 comments
Open

domain-admin and SQLSpamSettings.pm #1216

stefaweb opened this issue Jul 5, 2021 · 5 comments

Comments

@stefaweb
Copy link
Contributor

stefaweb commented Jul 5, 2021

Hi!

I discovered that domain-admin specific spam score is not working in SQLSpamSettings.pm.

May be, I 'm not well using the feature.

In the code we have in the LookupScoreList function:

return $LowHigh->{$to} if $LowHigh->{$to};
return $LowHigh->{$todomain} if $LowHigh->{$todomain};
return $LowHigh->{"admin"} if $LowHigh->{"admin"};

If in the table users we have the user user@domain.tld ($to) and the default "admin" user, it's working and the code use the specific low/high score.

But for domain-admin@domain.tld, it's not working as the code is looking for only the domain part.

I can create a user called domain.tld in the database (but only as "Administrator"). With an administrator domain.tld user, the code use the $todomain and works with a specific low/high score for all email from this domain.

The problem is that this administrator is not an "Domain administrator" and can see all mails, not only it how domain mails.

It will be better to look for domain-admin@domain.tld as a regular domain admin user.

Cheers,

@stefaweb
Copy link
Contributor Author

stefaweb commented Jul 5, 2021

Again me.

I tried with:

$todomain = 'domain-admin@' . $todomain[0];

And it work fine.

@stefaweb
Copy link
Contributor Author

stefaweb commented Jul 5, 2021

Commit: dc0fb32

@Skywalker-11
Copy link
Member

This would break the settings for normal users. Wouldn't it be better to change it here instead?

    return $LowHigh->{$to} if $LowHigh->{$to}; //check user setting
    return $LowHigh->{$todomain} if $LowHigh->{$todomain}; //check "legacy" domain setting
    return $LowHigh->{'admin@' . $todomain} if $LowHigh->{'admin@' . $todomain} //check new domain setting (in user account admin@<domain.tld>
    return $LowHigh->{"admin"} if $LowHigh->{"admin"}; //check global admin

@stefaweb
Copy link
Contributor Author

stefaweb commented Jul 6, 2021

Hi!

What is a "legacy domain setting"?

In the online doc in MailWatch.org, "domain-admin@<domain.tld>" is used instead of "admin@<domain.tld>".

More mods car be done and the default setup for "domain-admin" migrated in MailWatchConf.pm.

@stefaweb
Copy link
Contributor Author

stefaweb commented Jul 6, 2021

I updated the commit: c1070d4

Sorry, I completely broke my git config and the commit went straight to the source.

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

No branches or pull requests

2 participants