How to rewrite default filter and filter.conf ?

iprodua

Verified User
Joined
Oct 5, 2007
Messages
88
Hi. How to rewrite default filter and filter.conf for new users? Is there official "way" without editing user_create_post.sh?
 
I use this way for user_prefs, you should adapt to filter as you prefer.

cat /usr/local/directadmin/scripts/custom/user_create_post.sh

Code:
#!/bin/sh
if [ "$spam" = "ON" ]; then
   DIR=/home/$username/.spamassassin
   mkdir $DIR
   wget -O $DIR/user_prefs http://MY_CUSTOM_CONF_URL >/dev/null 2>&1
#  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;

Regards
 
Maybe this would work better

cat /usr/local/directadmin/scripts/custom/domain_create_post.sh

Code:
mv CUSTOMfilterPATH /etc/virtual/$domain/filter
mv CUSTOMfilterPATH.conf /etc/virtual/$domain/filter.conf
chown mail:mail /etc/virtual/$domain/filter*
chmod 600 /etc/virtual/$domain/filter*

Regards
 
Back
Top