Whitelist or blacklist user/domain at user level?

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,902
Location
GMT +7.00
Hello,

If you host several domains under one account and want to use SpamAssassin rules only for one particular domain then it's hardly can be achieved. You will need to move domains to separate accounts in such a case.
 

ozgurerdogan

Verified User
Joined
Apr 20, 2008
Messages
293
No one domain under one account. When I add a domain or email to blacklist, SA blocks is for all users. But I need to exlcude some mail accounts. How to achieve this?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,902
Location
GMT +7.00
SA rules are applied to all email boxes on all domains under one directadmin account.

Let's say user bob has two domains under his directadmin account:

domain1.com
domain2.com

and he has got emails:

email-a@domain1.com
email-b@domain1.com
email-c@domain2.com
email-d@domain2.com

Spamassassin enabled for user bob's account effects all the listed email accounts and even more if he creates more mailboxes. There is no way to tell to SA to skip this or that local domain or this or that email box while you hold them under one directadmin account.

If you need it can be achieved only through modification of /etc/exim.conf or /etc/exim.spamassassin.conf (depending on your version of exim.conf).

So you will need to modify this block:
http://files.directadmin.com/services/exim.spamassassin.conf and add something like this:

Code:
{!exists{/home/${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}/.spamassassin-skip/{$domain}/{$local_part}}} [COLOR=#000000] \[/COLOR]
before

Code:
[COLOR=#000000]{<{$message_size}{500k}} \[/COLOR]



With this if you create a file /home/user
/.spamassassin-skip/domain.com/mailbox SpamAssassin would skip to check emails for mailbox@domain.com

replace user, domain.com, mailbox with your actual data.

P.S. That's up to you to test it and confirm it's working or not and protect your files from being rewritten by custombuild.
 

ozgurerdogan

Verified User
Joined
Apr 20, 2008
Messages
293
Thank you for great post. İ will try and post results.. But with this method, user will not be able to add any rule for that skipped mail.
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,902
Location
GMT +7.00
Yes, they won't be able to add any rule for that skipped mail. And it can't be changed on exim's level.
 
Top