Delete spam automatically

asmar

Verified User
Joined
Aug 29, 2005
Messages
99
Location
https://t.me/pump_upp
Hello all,

I've setup spamassasin on a server as per directadmin instructions and enable it for all accounts. What I didn't find is how to setup automatically for every account to delete the messages marked as spam instead of emailing them with a SPAM subject.

Thanks
 
You dont set it up automatically. You set it up per domain on each user account.
 
Hello,

I'm assuming you're referring to this?
http://help.directadmin.com/item.php?id=117

If you want to automatically set it to delete the emails out of the box for new accounts (or existing ones) you'd need to have the following in the file:
/etc/virtual/domain.com/filter.conf
Code:
where=delete

You'd probably add that to the domain_create_post.sh rather than the user_create_post.sh, since Users can add more domains. So, create:
/usr/local/directadmin/scripts/custom/domain_create_post.sh
and add the code
Code:
#!/bin/sh
FILE=/etc/virtual/$domain/filter.conf
if [ -e "$FILE" ]; then
    echo "where=delete" >> $FILE
    echo "action=rewrite&value=filter&user=$username" >> /usr/local/directadmin/data/task.queue
fi
exit 0;
Then the way to have it take effect for existing domains would be something like:
Code:
cd /etc/virtual
for i in `ls */filter.conf`; do { echo "where=delete" >> $i; }; done;
echo "action=rewrite&value=filter" >> /usr/local/directadmin/data/task.queue
Note that if there are double "where" values in the filter.conf files, only the last one will matter, so the above code may add a duplicate, but that's fine. Once it's read in and written at a later point by DA, it will remove the duplicate.

John
 
This will enable SpamAssassin for each user aswell or will just change the setitng to delete? Cause i think that if SpamAssassin is not active on the user this modify dont have any effect, am i wrong?

Regards
 
Back
Top