My server has multiple network interfaces (each with its own IP).
Due to the hosting provider's security policy, outgoing connections to SMTP (port 587) are only allowed from a specific IP address — not from the default one.
So I need to configure Drupal to send emails via SMTP using a non-default local IP.
I'm fine with using external modules such as:
However, I can’t find any option to set the local bind address (the source IP for the connection).
In other systems this can be done with something like:
'socket'=>[
'bindto' => '1.2.3.4:0'
]
or
localAddress: '1.2.3.4'
or
'source_ip' => '1.2.3.4',
Has anyone encountered this before or found a way to set the source IP for outgoing SMTP connections in Drupal (or in Symfony Mailer settings)?