Tuesday, 6 August 2013

whitelist particular domain in spamassassin for server wide.

For example you have want to whitelist *@abc.com in the server.There is one option in spamassasin to whitelist this,but you have only whitelisted this for each user account which means you have login into each cpanel account and manually whitelisted *@abc.com in spamassassin under mail option.

But I have created one script to whitelist this *@abc.com for all accounts[server level].


Go to exim configuration manager,
Enabled this option"" SpamAssassin™: Forced Global ON "".

Then try this script.[one by one]

 for i in `ls /var/cpanel/users` ; do mkdir /home/$i/.spamassassin ; done

for i in `ls /var/cpanel/users` ; do touch /home/$i/.spamassassin/user_prefs  ; done

for i in `ls /var/cpanel/users` ; do echo whitelist_from *@abc.com  > /home/$i/.spamassassin/user_prefs  ; done

for i in `ls /var/cpanel/users` ; do chown $i.$i /home/$i/.spamassassin ; done

for i in `ls /var/cpanel/users` ; do chown $i.$i /home/$i/.spamassassin/user_prefs ; done

Thats all.

No comments:

Post a Comment