GregBeason
Verified User
- Joined
- May 4, 2006
- Messages
- 7
We have recently been upgrading our DA server to make our client's initial setup much easier, particularly in email spam settings. DA does not provide any means to preconfigure spam settings (spam destination, score levels, junk email location, etc). We have configured post install scripts for user, domain and email (see below) to configure out desired default settings. Everything works wonderfully as the end user doesn't have to enable spam filtering and has their email put in their junk email folder.
We did choose to break from the INBOX.spam folder, which is giving us some grief. With the new RoundCube, we found it easier on end-users to have their Junk E-mail labeled as such (similar to MS Outlook which most of users current use), and for it to not be under inbox. Also, for customers using IMAP, Outlook's internal SPAM filtering uses the same folder. The problem we are having is that whenever as user changes the spam settings, DA recreates the INBOX.spam. Is there any setting to choose the SPAM folder that is created to store spam?
We have utilized post install scripts as follows:
/usr/local/directadmin/scripts/custom/domain_create_post.sh
/usr/local/directadmin/scripts/custom/user_create_post.sh
/usr/local/directadmin/scripts/custom/user_prefs.default
/usr/local/directadmin/scripts/custom/email_create_post.sh
Also, does anyone know how to create the filer.conf based on the template in the data directory?
We did choose to break from the INBOX.spam folder, which is giving us some grief. With the new RoundCube, we found it easier on end-users to have their Junk E-mail labeled as such (similar to MS Outlook which most of users current use), and for it to not be under inbox. Also, for customers using IMAP, Outlook's internal SPAM filtering uses the same folder. The problem we are having is that whenever as user changes the spam settings, DA recreates the INBOX.spam. Is there any setting to choose the SPAM folder that is created to store spam?
We have utilized post install scripts as follows:
/usr/local/directadmin/scripts/custom/domain_create_post.sh
#!/bin/sh
DIR=/etc/virtual/$domain
HOME=/home
echo "where=userspamfolder" > $DIR/filter.conf
chown mail.mail $DIR/filter.conf
chmod 600 $DIR/filter.conf
echo "# Exim Filter
# created by DirectAdmin, version 1.28.1
# Do not modify this file as any changes will be
# overwritten when the user makes a change.
# (data is only written to this file, not read)
if error_message then finish endif
if
\$h_X-Spam-Status: contains \"Yes\"
then
if
$local_part is \"$username\"
then
save \"$HOME/$username/Maildir/.Junk E-mail/new/\" 660
else
save \"$HOME/$username/imap/\$domain/\$local_part/Maildir/.Junk E-mail/new/\" 660
endif
finish
endif
#end filter
" > $DIR/filter
chown mail.mail $DIR/filter
chmod 600 $DIR/filter
echo "Configured SPAM filter configuration sucessfully"
exit 0;
/usr/local/directadmin/scripts/custom/user_create_post.sh
#!/bin/sh
if [ "$spam" = "ON" ]; then
DIR=/home/$username/.spamassassin
mkdir $DIR
cp /usr/local/directadmin/scripts/custom/user_prefs.default $DIR/user_prefs
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;
/usr/local/directadmin/scripts/custom/user_prefs.default
required_score 3.0
report_safe 0
/usr/local/directadmin/scripts/custom/email_create_post.sh
#!/bin/sh
HOME=/home
mkdir $HOME/$username/imap/$domain/$user/Maildir/.Junk\ E-mail/
mkdir $HOME/$username/imap/$domain/$user/Maildir/.Junk\ E-mail/new
chown $username.mail -R $HOME/$username/imap/$domain/$user/Maildir/.Junk\ E-mail/
chmod 770 -R $HOME/$username/imap/$domain/$user/Maildir/.Junk\ E-mail/
rm -rf $HOME/$username/imap/$domain/$user/Maildir/.INBOX.spam
echo "Junk E-mail" > $HOME/$username/imap/$domain/$user/Maildir/subscriptions
echo "Junk Email folder created"
exit 0;
Also, does anyone know how to create the filer.conf based on the template in the data directory?