More Hacking amavisd $msginfo

Damian amavis at arcsin.de
Tue May 3 13:42:01 CEST 2022


> I'm trying to find or develop a way to quarantine mail from specific
> senders for specific domains. Is there a well-defined way to do this?
> It appears the amavisd.conf doesn't provide the ability to specify
> different policies based on domains.

Since you already use Amavis::Custom, you can amend the new-hook:

> #  *custom hook: new() - may inspect info, may load policy banks

So, iterate $msginfo->per_recip_data, extract the domain from each 
recip_addr, extract the domain from $msginfo->sender and then make a 
decision which policy bank you wish to load via Amavis::load_policy_bank()



More information about the amavis-users mailing list