Is there a feature I can use to rewrite the To: header, of "virtual
alias domain" mail, with the result of the following lookup, *after*
smtpd_milters are applied?
SELECT 'b...@example.com' FROM my_table WHERE sender = '%s'
Or do I need to use a milter of my own for this?
recipient_canonical_maps and recipient_canonical_classes seem pretty
close! I can exclude the From: header and the envelope_recipient from
being rewritten, but they're applied *before* smtpd_milters. And I
haven't thought carefully about how to limit them to virtual alias
domain mail.
My specific situation is that I'm using the OpenDKIM milter to verify
mail, so that needs to happen before I rewrite the To: header.