--- src/test/org/apache/james/smtpserver/SMTPServerTestOld.java	2006-03-30 12:14:29.000000000 +0200
+++ src/test/org/apache/james/smtpserver/SMTPServerTest.java	2006-03-30 12:18:43.000000000 +0200
@@ -60,14 +60,14 @@
 /**
  * Tests the org.apache.james.smtpserver.SMTPServer unit 
  */
-public class SMTPServerTestOld extends TestCase {
+public class SMTPServerTest extends TestCase {
     private int m_smtpListenerPort = Util.getRandomNonPrivilegedPort();
     private MockMailServer m_mailServer;
     private SMTPTestConfiguration m_testConfiguration;
     private SMTPServer m_smtpServer;
     private MockUsersRepository m_usersRepository = new MockUsersRepository();
 
-    public SMTPServerTestOld() {
+    public SMTPServerTest() {
         super("SMTPServerTest");
     }
 
@@ -266,7 +266,35 @@
 
         smtpProtocol1.quit();
     }
+    public void testHeloResolv() throws Exception, SMTPException {
+        m_testConfiguration.setHeloResolv();
+        finishSetUp(m_testConfiguration);
+
+
+        MySMTPProtocol smtpProtocol1 = new MySMTPProtocol("127.0.0.1", m_smtpListenerPort);
+        smtpProtocol1.openPort();
 
+        assertEquals("first connection taken", 1, smtpProtocol1.getState());
+
+        // no message there, yet
+        assertNull("no mail received by mail server", m_mailServer.getLastMail());
+
+        String[] helo1 = new String[] { "abgsfe3rsf.de"};
+        String[] helo2 = new String[] { "james.apache.org" };
+        
+        smtpProtocol1.sendCommand("helo",helo1);
+        SMTPResponse response = smtpProtocol1.getResponse();
+        // this should give a 501 code cause the helo could not resolved
+        assertEquals("expected error: helo could not resolved", 501, response.getCode());
+            
+        smtpProtocol1.sendCommand("helo", helo2);
+        SMTPResponse response2 = smtpProtocol1.getResponse();
+        // helo is resolvable. so this should give a 250 code
+        assertEquals("Helo accepted", 250, response2.getCode());
+
+        smtpProtocol1.quit();
+    }
+    
     public void testHeloEnforcement() throws Exception, SMTPException {
         finishSetUp(m_testConfiguration);
 
--- src/test/org/apache/james/smtpserver/SMTPTestConfigurationOld.java	2006-03-30 12:15:45.000000000 +0200
+++ src/test/org/apache/james/smtpserver/SMTPTestConfiguration.java	2006-03-30 12:16:00.000000000 +0200
@@ -18,10 +18,11 @@
 
 package org.apache.james.smtpserver;
 
+import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
 import org.apache.james.test.util.Util;
 
-public class SMTPTestConfigurationOld extends DefaultConfiguration {
+public class SMTPTestConfiguration extends DefaultConfiguration {
 
     private int m_smtpListenerPort;
     private int m_maxMessageSize = 0;
@@ -29,8 +30,9 @@
     private String m_authorizingMode = "false";
     private boolean m_verifyIdentity = false;
     private Integer m_connectionLimit = null;
+    private boolean m_heloResolv = false;
 
-    public SMTPTestConfigurationOld(int smtpListenerPort) {
+    public SMTPTestConfiguration(int smtpListenerPort) {
         super("smptserver");
 
         m_smtpListenerPort = smtpListenerPort;
@@ -71,6 +73,10 @@
     public void setConnectionLimit(int iConnectionLimit) {
         m_connectionLimit = new Integer(iConnectionLimit);
     }
+    
+    public void setHeloResolv() {
+        m_heloResolv = true; 
+    }
 
     public void init() {
 
@@ -86,8 +92,15 @@
         handlerConfig.addChild(Util.getValuedConfiguration("maxmessagesize", "" + m_maxMessageSize));
         handlerConfig.addChild(Util.getValuedConfiguration("authRequired", m_authorizingMode));
         if (m_verifyIdentity) handlerConfig.addChild(Util.getValuedConfiguration("verifyIdentity", "" + m_verifyIdentity));
-
+        
         handlerConfig.addChild(Util.createRemoteManagerHandlerChainConfiguration());
+        
+        // Add Configuration for Helo checks
+        DefaultConfiguration heloConfig = (DefaultConfiguration) handlerConfig.getChild("handlerchain").getChild("handler");
+        DefaultConfiguration hConfig = new DefaultConfiguration("checkValidHelo");
+        hConfig.setValue(m_heloResolv);
+        heloConfig.addChild(hConfig);     
+        
         addChild(handlerConfig);
     }
 
