In a bit of a bind (pun intended).
We have a WebSphere application server that uses a mail package to send email via JavaMail, over SMTP. We have a RHEL box, with non-root access (can't change that), which has two network devices, eth0 and eth1. The mail package is used by a significant number applications and the effort to update it and change is labor intensive. Previously, we did not have to worry about this..
I need to have the mail sent from eth1, however, I have no means to configure this. This, https://www-01.ibm.com/support/knowledgecenter/SSD28V_8.5.5/com.ibm.websphere.nd.doc/ae/trun_multiplenic.html , does not help, as it does not control outgoing calls.
Have tried a number of JavaMail VM options, e.g., mail.smtp.localhost / localaddress (but I knew from the get-go that would be for incoming port bindings, tried anyway).
Unfortunately, I have not come across a VM Option that would allow me to specify which network device to use via JavaMail or for the JVM in general (the latter would be preferred).
My intent is to minimize the level of effort to accommodate this change in server setup (for which we have no control of).
The obvious answer is - setup iptables to force all traffic on one device, but we can't do that.
The next answer is - specify the network device to use when building the transport, can't do that because we don't own the mail package and would require a significant amount of time to regression test against all applications..
Any help or creative approaches to try (given the restrictions) would be appreciated!