MBF Knowledge Base

How do I alert a Postfix sender when outbound email is not delivered due to amavisd-new checks?

In amavisd.conf you'll have a few options that can be useful.

The options are :
$final_virus_destiny =
$final_banned_destiny =
$final_bad_header_destiny =

$virus_quarantine_to =
$banned_quarantine_to =
$bad_header_quarantine_to =

With the $final_X_destiny if you set it to D_BOUNCE, amavisd will create a DSN to the sender, this can be problematic if you're being spammed with spoofed addresses, you might want to look into creating a policy bank for authenticated users, and using this option just there.

The other option you have is the $X_quarantine_to if you set that to a particular email, you could run a script that checks the mailbox, and sends messages to people.