Index: /home/maurer/stuff/workspace/james-dev/src/test/org/apache/james/smtpserver/SMTPServerTest.java
===================================================================
--- /home/maurer/stuff/workspace/james-dev/src/test/org/apache/james/smtpserver/SMTPServerTest.java	(revision 393167)
+++ /home/maurer/stuff/workspace/james-dev/src/test/org/apache/james/smtpserver/SMTPServerTest.java	(working copy)
@@ -292,6 +292,7 @@
     
     public void testHeloResolv() throws Exception, SMTPException {
         m_testConfiguration.setHeloResolv();
+        m_testConfiguration.setAuthorizedAddresses("192.168.0.1");
         finishSetUp(m_testConfiguration);
 
 
@@ -333,6 +334,36 @@
         smtpProtocol1.quit();
     }
     
+    public void testHeloResolvIgnoreRelayClientDisabled() throws Exception, SMTPException {
+        m_testConfiguration.setHeloResolv();
+        m_testConfiguration.setIgnoreRelayClients(false);
+        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 testSenderDomainResolv() throws Exception, SMTPException {
         m_testConfiguration.setSenderDomainResolv();
         finishSetUp(m_testConfiguration);
@@ -444,6 +475,7 @@
   
     public void testEhloResolv() throws Exception, SMTPException {
         m_testConfiguration.setEhloResolv();
+        m_testConfiguration.setAuthorizedAddresses("192.168.0.1");
         finishSetUp(m_testConfiguration);
 
 
@@ -485,6 +517,36 @@
         smtpProtocol1.quit();
     }
     
+    public void testEhloResolvIgnoreClientDisabled() throws Exception, SMTPException {
+        m_testConfiguration.setEhloResolv();
+        m_testConfiguration.setIgnoreRelayClients(false);
+        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[] ehlo1 = new String[] { "abgsfe3rsf.de"};
+        String[] ehlo2 = new String[] { "james.apache.org" };
+        
+        smtpProtocol1.sendCommand("ehlo", ehlo1);
+        SMTPResponse response = smtpProtocol1.getResponse();
+        // this should give a 501 code cause the ehlo could not resolved
+        assertEquals("expected error: ehlo could not resolved", 501, response.getCode());
+            
+        smtpProtocol1.sendCommand("ehlo", ehlo2);
+        SMTPResponse response2 = smtpProtocol1.getResponse();
+        // ehlo is resolvable. so this should give a 250 code
+        assertEquals("ehlo accepted", 250, response2.getCode());
+
+        smtpProtocol1.quit();
+    }
+    
     public void testHeloEnforcement() throws Exception, SMTPException {
         finishSetUp(m_testConfiguration);
 
