virtualmin / virtualmin-gpl

Virtualmin web hosting control panel for Webmin
https://www.virtualmin.com
GNU General Public License v3.0
331 stars 102 forks source link

cpanel migration - no spamassassain rule migrated #943

Open shoulders opened 3 weeks ago

shoulders commented 3 weeks ago
SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Usermin version 2.102
Virtualmin version 7.20.2 Pro
Theme version 21.20.7
Apache version 2.4.52
Package updates 10 package updates are available

This is a probably a feature request.

Background

In cpanel I have set a few spamassassain rules to block out most of the offenders of recent spam in Global Email Filters. these are per domain rules.

You can also set Email Filters which is a per email method.

image

the issue

My global filters/spamassaasain rules were not brought over

the request

Make the cpanel migration migrate these settings aswell.

NB: Mine are not complex and i can move them manually.

iliajie commented 3 weeks ago

Hello,

Thanks for the heads up!

Where are those SpamAssassin rules stored within a cPanel account?

shoulders commented 3 weeks ago

Below id the information you have asked for but for SpamAssassin rules and the filters, both of which were not brought over.

in the cpanel account backup

./homdedir/.cpanel/filter.yaml.bak

this is from 2017 so I think it is pointless and not the live data.

./homdedir/.cpanel/filter.yaml

```yaml --- filter: - actions: - action: save dest: /dev/null filtername: Dodgy Spam rules: - match: contains opt: or part: $message_body val: /t/click/ - match: contains opt: or part: $message_body val: /mw/index.php/ - match: contains opt: or part: $message_body val: or send post-mail - match: contains opt: or part: $message_body val: /track-url/ - match: contains opt: or part: $message_body val: claudia unescaped: 1 - actions: - action: save dest: /dev/null enabled: 1 filtername: Generated Apache SpamAssassin™ Discard Rule rules: - match: contains opt: or part: "$h_X-Spam-Bar:" val: +++++ version: '2.2' ```

./homdedir/.cpanel/filter.cache

{"version":2.2,"filter":[{"actions":[{"dest":"/dev/null","action":"save"}],"filtername":"Dodgy Spam","unescaped":1,"rules":[{"val":"/t/click/","part":"$message_body","opt":"or","match":"contains"},{"val":"/mw/index.php/","part":"$message_body","match":"contains","opt":"or"},{"val":"or send post-mail","part":"$message_body","match":"contains","opt":"or"},{"part":"$message_body","match":"contains","opt":"or","val":"/track-url/"},{"part":"$message_body","match":"contains","opt":"or","val":"claudia"}]},{"filtername":"Generated Apache SpamAssassin™ Discard Rule","rules":[{"val":"+++++","part":"$h_X-Spam-Bar:","opt":"or","match":"contains"}],"enabled":"1","actions":[{"dest":"/dev/null","action":"save"}]}]}

./homdedir/.spamassassin/user_prefs

score SPF_FAIL 10
whitelist_from *@joomlashine.com
whitelist_from *@stackideas.com
required_score 5

Addtional

https://docs.cpanel.net/cpanel/files/backup-for-cpanel/

The Email Filters backup file only stores the account-level email filters from cPanel’s Global Email Filters interface (cPanel » Home » Email » Global Email Filters). The backup file does not store user account-level email filters from cPanel’s Email Filters interface (cPanel » Home » Email » Email Filters).

jcameron commented 2 weeks ago

That's certainly something we can look into migrating! Did the latest backup you sent me have these custom rules?

shoulders commented 2 weeks ago

No it didn't .

I will whip up an example cpanel with various options and send it over. Might be a couple of days though.

jcameron commented 2 weeks ago

ok thanks that would be really useful!

shoulders commented 2 weeks ago

i have sent you an example cpanel account in an email.

jcameron commented 2 weeks ago

Thanks, will take a look!

shoulders commented 2 weeks ago

I have sent a corrected backup with global filters, whitelists, blacklists, an additional Spam test (SPF_FAIL).