How to enable SpamAssassin for new accounts

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 user_create_post.sh script to create it for you.

Create: /usr/local/directadmin/scripts/custom/user_create_post.sh

in it, add:

#!/bin/sh
if [ "$spam" = "ON" ]; then
   DIR=/home/$username/.spamassassin
   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
fi
exit 0;

Once created, save it and chmod the user_create_post.sh 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) spam.sh with the following code:

#!/bin/sh
for i in `ls /usr/local/directadmin/data/users`; do
{
  username=$i spam=ON /usr/local/directadmin/scripts/custom/user_create_post.sh
};
done;
exit 0;

save this new spam.sh script, chmod it to 755, and run it once.

 
email/enable.txt · Last modified: 2010/02/21 20:01 by muscardin
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Please visit Automatic Backlinks to start earning free backlinks Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki beautiful women dating