It's a little complex to achieve this with Cluebringer, but we will get it ready in next release of iRedMail.
To achieve it manually, you can try below steps:
- Create a policy: blacklisted_senders.
INSERT INTO policies (Name, Priority, Disabled, Description)
VALUES ('blacklisted_senders', 8, 0, 'Blacklisted senders');
- Create a policy group:
INSERT INTO policy_groups (Name, Disabled) VALUES ('blacklisted_senders', 0);
- Create policy member:
INSERT INTO policy_members (PolicyID, Source, Destination, Disabled)
SELECT id, '%blacklisted_senders', '%internal_domains', 0
FROM policies WHERE name='blacklisted_senders' LIMIT 1;
- Create ACL to reject emails from certain senders:
INSERT INTO access_control (PolicyID, Name, Verdict, Data)
SELECT id, 'reject_blacklisted_senders', 'REJECT', 'Blacklisted sender'
FROM policies WHERE name='blacklisted_senders' LIMIT 1;
- You can now reject a sender address "user@domain.com" by listing it in table 'cluebringer.policy_group_members':
INSERT INTO policy_group_members (PolicyGroupID, Member, Disabled)
SELECT id, 'user@domain.com', 0
FROM policy_groups WHERE name='blacklisted_senders' LIMIT 1;
IMPORTANT NOTES:
You can block single sender address (user@domain.com), whole domain (@domain.com), IP address (xx.xx.xx.xx) or CIDR IP range (xx.xx.xx.0/24, etc) this way. But iRedMail will have 3 policies to handle different sender types (single address, whole domain, IP address and CIDR IP range): blacklisted_senders, blacklisted_domains, blacklisted_ips. The reason why we do it this way is for better management in iRedAdmin-Pro, so that admins can easily find/understand different blacklist types.
You can refer to our (DRAFT) sample file here:
https://bitbucket.org/zhb/iredmail/src/ … at=default