Hello Beniot, This exactly what I am doing in Apache James 3.5.0 in mailetcontainer.xml.
<mailet match="All" class="RemoteDelivery"> <outgoing>outgoing</outgoing> <delayTime>5000, 100000, 500000</delayTime> <maxRetries>25</maxRetries> <maxDnsProblemRetries>0</maxDnsProblemRetries> <deliveryThreads>${env:MTA_DELIVERY_THREADS}</deliveryThreads> <sendpartial>true</sendpartial> <bounceProcessor>bounces</bounceProcessor> <gateway>${env:SMTP_GATEWAY}</gateway> <gatewayPort>${env:SMTP_GATEWAYPORT}</gatewayPort> <!-- If the gateway requires smtp authentication the following directives --> <!-- (gatewayUsername/gatewayPassword) can be used. --> <gatewayUsername>${env:SMTP_WEBSSO_USERNAME}</gatewayUsername> <gatewayPassword>${env:SMTP_WEBSSO_PASSWORD}</gatewayPassword> <!-- Set the HELO/EHLO name to use when connectiong to remote SMTP-Server --> <!-- <mail.smtp.localhost>myMailServer</mail.smtp.localhost> --> </mailet> The java exception on the other hand states the following : jvm 1 | 30-Jun-2021 10:20:30.654 ERROR [RemoteDelivery-2] org.apache.james.dnsservice.library.MXHostAddressIterator.<init>:79 - Couldn't resolve IP address for discovered host smtpxxx.xxxx.com. amlan On 01/07/2021, 02:47, "btell...@apache.org" <btell...@apache.org> wrote: Hello, If ou are using a gateway you should configure it directly mailetcontainer.xml RemoteDelivery mailet. Otherwize James would attempt to deliver all mails itself to remote domains. Eg: <mailet match="All" class="RemoteDelivery"> <outgoingQueue>outgoing</outgoingQueue> <delayTime>5000, 100000, 23*500000</delayTime> <maxRetries>25</maxRetries> <maxDnsProblemRetries>0</maxDnsProblemRetries> <deliveryThreads>10</deliveryThreads> <bounceProcessor>bounces</bounceProcessor> <gateway>${env:JAMES_REMOTE_DELIVERY_GATEWAY}</gateway> <gatewayPort>${env:JAMES_REMOTE_DELIVERY_GATEWAY_PORT}</gatewayPort> <gatewayUsername>${env:JAMES_REMOTE_DELIVERY_USERNAME}</gatewayUsername> <gatewayPassword>${env:JAMES_REMOTE_DELIVERY_PASSWORD}</gatewayPassword> </mailet> Cheers, Benoit On 30/06/2021 22:56, Amlan Sengupta wrote: > Hello, > > To be honest I was not expecting it to need anything else besides a MX Record. > > The java exception on the other hand states the following : > jvm 1 | 30-Jun-2021 10:20:30.654 ERROR [RemoteDelivery-2] org.apache.james.dnsservice.library.MXHostAddressIterator.<init>:79 - Couldn't resolve IP address for discovered host smtpxxx.xxxx.com. Seems to me that the RemoteDelivery class is looking for an ip address for smtpxxx.xxxx.com and treat it as an A Record. Where as all it is the following > > $host smtpxxx.xxxx.com > smtpxxx.xxxx.com mail is handled by 10 sinxxx.xxx.com. > smtpxxx.xxxx.com mail is handled by 10 sinyyy.yyy.com. > smtpxxx.xxxx.com mail is handled by 10 frayyy.yyy.com. > smtpxxx.xxxx.com mail is handled by 10 fraxxx.xxx.com. > > All my usecase is > > Application running in a container ---> ApacheJames Running in a separated container ( MTA ) ------> SMTP gateway (exposed through MX Records) > > Amlan > > > > On 30/06/2021, 16:43, "David Matthews" <m...@dmatthews.org.INVALID> wrote: > > hi Amlan > > Why do you think any SMTP server needs anything other than an MX record? > > OK Some TXT records for dkim, spf and dmarc, but why an A record? > > I doubt that I properly understand your use case and since James itself does SMTP, I don't follow why you talk about connecting to an smtp provider with your own James instance. > > I'm out of date with James now, but did do a write up with config changes, as much as for my own future reference as for anyone else. I'm not sure if it will help you, but it's at > > https://dmatthews.org/java_email.html > > if you care to look. > > best wishes > > -- > David Matthews > m...@dmatthews.org > > > > > > > --- > This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. > > Please refer to https://www.db.com/disclosures for additional EU corporate and regulatory disclosures and to http://www.db.com/unitedkingdom/content/privacy.htm for information about privacy. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org > For additional commands, e-mail: server-user-h...@james.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to https://www.db.com/disclosures for additional EU corporate and regulatory disclosures and to http://www.db.com/unitedkingdom/content/privacy.htm for information about privacy. --------------------------------------------------------------------- To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org