By default, the WordPress
wp_mail function will not set the actual sender for
$domain instead of the actual sender. Which, in turn, means that when using relay maps (sender_dependent_relayhost_maps) to map senders to correct SMTP relays none of them is matched because of the sender is not set correctly…
Fortunately, the mailer class used by WordPress, PHPMailer knows how to correctly specify the sender via the chosen backend (which in WordPress is the
Sender property of the mailer we’re able to have Postfix identify the sender correctly.