Hello,

To set more context I am trying to get this work on :
Version : Apache James 3.6.0
Runtime : RHEL 5.7.x
openshift v3.11.248
kubernetes v1.11.0+d4cacc0

I have been debugging this a bit further

- I moved to Apache James 3.6.0
- When I set the gateway host in the mailetcontainer.xml == smtp.x.x.com    . I 
get the following error in 3.6.0.
- in my dnsservice.xml I also enabled the <servers> with two upstream dns 
entry. Then I get this


Error:
jvm 1    | 02-Jul-2021 21:34:09.722 DEBUG [RemoteDelivery-6] 
org.xbill.DNS.Lookup.lookup:513 - Lookup for smtp.x.x.com./A, cache answer: 
unknown
jvm 1    | 02-Jul-2021 21:34:09.728 DEBUG [RemoteDelivery-6] 
org.xbill.DNS.ExtendedResolver$Resolution.send:68 - Sending smtp.x.x.com./A, 
id=50467 to resolver 0 (SimpleResolver [/dnsserrverrip:dnsport]), attempt 1 of 3
jvm 1    | 02-Jul-2021 21:34:09.729 DEBUG [RemoteDelivery-6] 
org.xbill.DNS.SimpleResolver.sendAsync:332 - Sending smtp.x.x.com./A, id=50467 
to udp/dnsserrverrip:dnsport
jvm 1    | 02-Jul-2021 21:34:09.771 DEBUG [RemoteDelivery-6] 
org.xbill.DNS.Cache.addMessage:732 - Caching NXRRSET for smtp.x.x.com./A
jvm 1    | 02-Jul-2021 21:34:09.771 DEBUG [RemoteDelivery-6] 
org.xbill.DNS.Lookup.lookup:563 - Queried smtp.x.x.com./A, id=50467: NXRRSET
jvm 1    | 02-Jul-2021 21:34:09.772 ERROR [RemoteDelivery-6] 
org.apache.james.dnsservice.library.MXHostAddressIterator.<init>:79 - Couldn't 
resolve IP address for discovered host smtp.x.x.com.


- so in my env if I do, I get

$nslookup smtp.x.x.com

*** Can't find smtp.x.x.com: No answer

I am wondering if there is anything specific we need to set up or do to get 
this work on kubernetes ? Also has anyone been able to get James to work 
against MX Records which are not coupled with an A Name before ?

I also feel the fundamental issue is, my MX record has no ip and it is dying as 
cannot find one.

         $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.

Any advise ?

Amlan


    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.

Reply via email to