Apache james email server on EC2 (domain name mapping)

2

1

I have Amazon EC2 (windows) instance which hosts Tomcat & Apache James mail server.

James works fine on EC2 locally (I have created a domain and updated etc/hosts file to mimic domain. Using thunderbird client on same machine, I was able to send messages between accounts on same domain).

Now I am trying to map james to real domain. I have registered a domain with goDaddy say mycompany.com

  1. created one A record on Route 53: mailserver.mycompany.com points to EC2 instance IP
  2. created MX entry on Route 53: mailserver.mycompany.com 0(priority) mailserver.mycompany.com
  3. Pointed all Mail related DNS Zone file entries in GoDaddy to mailserver.mycompany.com

Now I am confused on while adding domain to James, what should be the host name & domain name I use?

should host name be localhost (or) mycompany.com? should James domain name be mycomapny.com (or) mailserver.mycompany.com?

Any help would be appreciated. Thanks for your time & help.

kosa

Posted 2013-10-07T19:03:32.270

Reputation: 23

3Note that many IP addresses used by EC2 instances are already blacklisted across much of the Internet. You are unlikely to be able to reliably email from an EC2. – ChrisInEdmonton – 2013-10-07T19:07:20.617

@ChrisInEdmonton: Agree. At this moment I am less concerned about it, because my application is still in POC mode. – kosa – 2013-10-07T19:09:30.470

Not using James, but I think the MX entry should be "mycompany.com 0(priority) mailserver.mycompany.com", and you should have as servernames both localhost and mycompany.com. – harrymc – 2013-10-10T05:49:28.557

@harrymc: Thanks for your comment, Should I open port 25 in both inboud/outbound rules (Amazon EC2 is very restrictive)? and How can I validate my mail server is ready for incoming messages from outside world? – kosa – 2013-10-10T20:32:39.333

Port 25 is required for send and receive. For validation this link might be useful.

– harrymc – 2013-10-10T22:09:44.570

Are my comments above worthwhile as an answer? – harrymc – 2013-10-11T05:22:00.993

@harrymc: For validation I have used few public websites etc., One change I did as per your suggestion is, MX mapping to mycomapny.com instead of mailserver.mycompany.com. your comments worth answer, I am not sure because I have done lot of trail/errors to get it working. If you can enhance your comment and make it as answer for James 3, I would be happy to accept it, otherwise I will write an answer with my experience. – kosa – 2013-10-11T14:14:04.720

Since you have used parts of my comments, I have collected them below as a partial answer. You should collect your findings in an answer of your own, or at least list the sources that you found useful. – harrymc – 2013-10-11T16:53:44.593

@harrymc: Yes make sense. (or) I will improve your answer and accept it with bounty (most probably on weekend). – kosa – 2013-10-11T17:04:57.757

@harrymc: Gave bounty and accepted answer. Will edit your answer when I get few minutes. – kosa – 2013-10-17T13:59:15.167

Answers

0

The MX entry should be "mycompany.com 0(priority) mailserver.mycompany.com", and you should have as servernames both localhost and mycompany.com.

Port 25 is required to be opened in the firewall for send and receive.

For validation of your installation, this link might be useful :
James Wiki JamesQuickstart.

harrymc

Posted 2013-10-07T19:03:32.270

Reputation: 306 093