Hello Kaustubh,

that's exactly what James is doing by default. I am using James 2.3.2, so I
refer to this version.

If you send Mails to som...@somewhere.com, James will look into the
configured DNS Server for the MX record of "somewhere.com",
and then will send the message to the mailserver with the ip of the MX
record.

Example:
Assuming :
- your own mail-domain is "capgemini.com"
- your own mail servers are "MX1.capgemini.com" (194.11.253.158) and
MX2.capgemini.com (194.4.230.92)
- the DNS Server for your domains are "nsefra01.capgemini.com (194.11.253.85
)" and "nseore01.capgemini.com (198.184.235.41)"

For that you should configure inside the config.xml:

Configure your DNS Server inside:
   <dnsserver>
          <server>194.11.253.85</server>
          <server>198.184.235.41</server>
   </dnsserver>

And configure the spooling of new mails
   <spoolmanager>
      <processor name="root">
....
         <mailet match="All" class="ToProcessor">
            <processor> transport </processor>
         </mailet>
      </processor>

And after that configure the transport of the the spooled mail:
      <processor name="transport">
...
         <!-- incoming mails for capgemini.com should be delivered to
MX1.capgemini.com -->
         <mailet match="HostIs= capgemini.com" class="RemoteDelivery">
            <outgoing> file://var/mail/relay/ </outgoing>
            <gateway>MX1.capgemini.com</gateway>
            <gatewayPort>25</gatewayPort>
         </mailet>
...
         <!-- check to not allow to be an open relay, only MX1.capgemini.com
and MX2.capgemini.com should send mails outside -->
         <mailet match="RemoteAddrNotInNetwork=127.0.0.1, 194.11.253.158,
194.4.230.92" class="ToProcessor">
            <processor> relay-denied </processor>
            <notice>550 - Requested action not taken: relaying
denied</notice>
         </mailet>
...
         <!--- all other mails will go outside -->
         <mailet match="All" class="RemoteDelivery">
            <outgoing> file://var/mail/outgoing/ </outgoing>
            <!-- do not set a gateway here, so james will lookup and deliver
direct to the server in mx record -->
         </mailet>

You may need more values, but this is only an example.
The config.xml file is full of comments, that should lead you to a solution.
We are using v2.3.2 in production environments.
I do not know about the V3, because we do not want to use pre-release
versions in production.
We will switch to V3 after public release.


Regards,
Bernd Waibel     
 


-----Ursprüngliche Nachricht-----
Von: Patwardhan, Kaustubh [mailto:kaustubh.patward...@capgemini.com] 
Gesendet: Mittwoch, 26. März 2014 20:35
An: 'server-user@james.apache.org'
Betreff: James gateway server

Hi,

I want to configure a James server to lookup into Public DNS server for the
MX records and relay mails accordingly. Has anyone done this before?

~Kaustubh
This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to