Benoit, thanks for the info about adding the localaddress parameter.  Just for future readers who might be doing this on Amazon Web Services EC2, there is a rather large pitfall that I encountered.  AWS EC2 instances have two different IP addresses for each external IP: an internal private IP and an external public IP that is associated with that internal private IP.  So here are all of the steps to send mail via a secondary IP address in AWS EC2:

    -- From the AWS console, add a 2nd private IP to your EC2

    -- associate it with a new Elastic external IP

    -- Name the ip address in your AWS Route 53 DNS for you mail server's domain

    -- You must submit a form to AWS to create an rDNS entry for your external IP and map it to your new DNS name.  (I recommend you start this as early in the process as possible.  AWS manual intervention moves at glacier speed....)  And then the new rDNS has to propagate through DNS servers and may be delayed by TTL refresh delays.

     -- Make sure your OS recognizes the 2nd IP.  It might do so automatically.  But just verify.  There's documentation on how to do this on various OS installations.

    -- In your JAMES transport processor, change your <mail.smtp.localhost> value to the DNS name for your new IP

    -- Now THE MOST IMPORTANT step... per Benoit, you need to also add a line to your transport processor:

<mail.smtp.localaddress>##.###.###.##</mail.smtp.localaddress>

        BUT.... be careful... this IP address is NOT the external Elastic IP that matches your dns host name.  This IP MUST be the PRIVATE IP address that is associated with your new external IP address.  If you incorrectly use the external IP address here, expect a very long frustrating day of not being able to send any mail (guess how I know...)

Jerry

On 11/6/2019 1:48 AM, Tellier Benoit wrote:
Hi Jerry,

You need also to specify `mail.smtp.localaddress`

https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html

Local address (host name) to bind to when creating the SMTP socket.
Defaults to the address picked by the Socket class. Should not normally
need to be set, but useful with multi-homed hosts where it's important
to pick a particular local address to bind to.

mail.smtp.localhost is only used for EHLO, thus would not be enough.

Good luck, trust management of SMTP outbound is not a easy topic.

Regards,

Benoit Tellier

On 06/11/2019 02:26, Jerry Malcolm wrote:
As if I haven't hit enough problems in this transition.... apparently
the IP address that AWS assigned to me was formerly used by a spammer.
So far, both sbcglobal and icloud.com are blocking and bouncing all
email saying my IP is blacklisted. Yippee....

I don't want to change my inbound ip address for all of the obvious
reasons.  But I've registered a 2nd IP address that I want to use
strictly for sending email.  I just need verification that I'm doing the
configuration correctly.  All I need to do is change:

<mail.smtp.localhost>mxa1.jwmhosting.com</mail.smtp.localhost>

in the transport processor to a different server name, right? (Obviously
as long as the new server name has the correct dns/rDNS entries etc).

Is that correct?

Jerry


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to