How to enable SpamAssassin for new accounts

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » DirectAdmin
Top Level » Email » Spam

How to enable SpamAssassin for new accountsLast Modified: Nov 30, 2009, 4:31 pm
By default (if enabled), DA gives the User the option to enable spamassassin, but it is not turned on by default.

To have it on by default, you can use the script to create it for you.


in it, add:

if [ "$spam" = "ON" ]; then
   mkdir  $DIR
   touch $DIR/user_prefs             #or this is where you'd copy  the default user_prefs you want them to have, instead of "touch".
   chown  ${username}:mail $DIR
   chmod 771 $DIR
   chown $username:$username  $DIR/user_prefs
   chmod 755 $DIR/user_prefs
   touch $DIR/spam
   chown  mail:$username $DIR/spam
   chmod 660 $DIR/spam
exit 0;

Once created, save it and chmod the to 755.

The above script can be used to also enable spamassassin for all existing accounts.  You can create another  simple script to do it called (for example) with the following code:

for i in `ls /usr/local/directadmin/data/users`; do
  username=$i spam=ON /usr/local/directadmin/scripts/custom/
exit 0;

save this new script, chmod it to 755, and run it once.
Related Helpfiles
How to enable SpamAssassin on your server.
I wish to change the default spam settings for new domains

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST