Determine which users have spamassassin enabled
I'd like to check which users have Process New Emails and Mark them as Spam: enabled (server-wide).
Secondly I'd like to be able to turn it on (using server default values) without using the global force on in Exim config (so users can disable if they want). (I know new accounts now enable it by defaults, but for accounts the predate that I want to enable it without removing users' ability to disable.)
-
Hi @PeteS The following two UAPI commands will do what you're requesting: UAPI Functions - Email::enable_spam_assassin - Developer Documentation - cPanel Documentation UAPI Functions - Email::get_spam_settings - Developer Documentation - cPanel Documentation These are per account API functions so if you need to run this for multiple accounts you'll need to write a custom script to obtain that data. Thanks! 0 -
Hi @PeteS The following two UAPI commands will do what you're requesting: UAPI Functions - Email::get_spam_settings - Developer Documentation - cPanel Documentation These are per account API functions so if you need to run this for multiple accounts you'll need to write a custom script to obtain that data. Thanks!
Thank you. (APIs, of course, I should have thought of that.) I'll have to work on a script to implement this. -Pete0 -
HI @PeteS I'm glad I could help! Please let us know how it works out for you. Thanks! 0 -
Will do, in time... :) 0 -
In the end, I have decided to deal with past accounts as necessary, one at a time, since the new accounts enable it by default (spam threshold 5, no delete). I did find this which may help someone as well (NOT tested...UAYOR). knownhost.com/wiki/control-panels/cpanel-whm/how-can-i-enable-spamassassin-on-all-cpanel-accounts -Pete 0 -
For anyone interested here's a one-liner command to detect all the accounts having SpamAssassin's "Move New Spam to a Separate Folder (Spam Box)" option not enabled: [CODE=bash]for i in `cat /etc/trueuserdomains | cut -d: -d' ' -f2-` ; do if [ ! -f "/home/$i/.spamassassinboxenable" ]; then echo $i: Not enabled; fi; done 0
Please sign in to leave a comment.
Comments
6 comments