Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is actually a question from an exam, but I believe it could help others troubleshooting a similar situation.

In a system, an e-mail needs to be sent to a certain mailbox. The following Java code, which is part of a larger system, was developed for that. Assume that "example.com" corresponds to a valid registered internet domain.

 public void sendEmail(){

 String s1=”Warning”;
 String b1=”Contact IT support.”;
 String r1=”warning@example.com”;
 String d1=”admin@example.com”;
 String h1=”mx.intranet”;

 Properties p1 = new Properties();

 p1.put(“mail.host”, h1);

 Session session = Session.getDefaultInstance(p1, null);
 MimeMessage message = new MimeMessage(session);

try {
   message.setFrom(new InternetAddress(r1));
   new InternetAddress(d1));
  catch (MessagingException e){

The execution of this code, within the testing environment of an application server, does NOT work as expected. The mailbox of the "example.com" server never receives the email, even tough all string values in the code are correctly attributed.

The output for the command "netstat -np TCP" in the application server during execution is shown bellow:

Src Add         Src Port    Dest Add         Dest Port   State  54395         25      SYN_SENT  54390         110     TIME_WAIT  52001     80      CLOSE_WAIT  52050     80      ESTABLISHED  50001      25      TIME_WAIT  50000      25      ESTABLISHED

With the exception of the lines that were NAT'd, all others are associated with the Java application server, which created them after the execution of the code above.

The e-mail server used in this environment is the production server, which is online and does not require any authentication for internal connections.

Based on this situation, point out three possible causes for the problem.

share|improve this question
add comment

1 Answer

I gave my shot as follows:

1 - There's a firewall between the application server ( subnet and the internal mail server ( blocking port 25.

2 - The DNS entry for "mx.intranet" is incorrectly configured in the internal DNS server. It is pointing to, which is not the SMTP server.

3 - The application server's deployment descriptors are configured in such a way that it redirects SMTP connections to the wrong server ( is not the production email server).

Do these seem reasonable causes?

Thanks if anyone could comment... :)

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.