Enable or Disable SpamAssassin for Users

From brokenpoet.org wiki

In order to enable or disable SpamAssassin for all users (or most users with exceptions), simply follow these instructions.

The way the system checks for whether or not SpamAssassin is enabled is to look for the existence of an empty file called .spamassassinenable in the user's home directory (/home/username)

This script checks for the existance of this file and either creates or removes it depending on what option you choose.

If you wish to make exceptions please be sure to have to correct usernames on hand.

To start:

wget http://scripts.brokenpoet.org/chgsastatus.sh
chmod 700 chgsastatus.sh
./chgsastatus

It will prompt you:

Are we turning SA on or off?  [ON/off]

The default is on and can be achieved by simply hitting enter. Either way it will then prompt you again:

Any User Exceptions?  [N/y]

The default is n and can be achieved by hitting enter.

If there are no exceptions it will simply run through the userlist and tell you what users it has changed. However, if you select yes (y), it will prompt you a third time:

What users (separate usernames with a space)?

You must enter usernames in the following format:

user1 user2 user3

It will then go through all users EXCEPT the ones stated and change their SA status.

Personal tools