I think it would be convenient to use check_client_access in smtpd_client_restrictions etc. to manage it in a database.
Activity