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 390122)
+++ /home/maurer/stuff/workspace/james-dev/src/test/org/apache/james/smtpserver/SMTPServerTest.java	(working copy)
@@ -310,6 +310,52 @@
         smtpProtocol1.quit();
     }
     
+    public void testSenderDomainResolv() throws Exception, SMTPException {
+        m_testConfiguration.setSenderDomainResolv();
+        finishSetUp(m_testConfiguration);
+
+
+        SMTPProtocol smtpProtocol1 = new SMTPProtocol("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());
+
+        smtpProtocol1.helo(InetAddress.getLocalHost());
+
+        String sender1 = "mail_sender1@xfwrqqfgfe.de";
+        String sender2 = "mail_sender2@james.apache.org";
+        
+        try {
+            smtpProtocol1.mail(new Address(sender1));
+            fail("sender should not accept");
+        } catch (SMTPException e) {
+            assertEquals("expected 501 error", 501, e.getCode());
+        }
+    
+        smtpProtocol1.mail(new Address(sender2));
+
+        smtpProtocol1.quit();
+        
+    }
+ 
+    public void testSenderDomainResolvDefault() throws Exception, SMTPException {
+        finishSetUp(m_testConfiguration);
+
+        SMTPProtocol smtpProtocol1 = new SMTPProtocol("127.0.0.1", m_smtpListenerPort);
+        smtpProtocol1.openPort();
+        
+        smtpProtocol1.helo(InetAddress.getLocalHost());
+        
+        String sender1 = "mail_sender1@xfwrqqfgfe.de";
+        
+        smtpProtocol1.mail(new Address(sender1));
+
+        smtpProtocol1.quit();
+    }
+    
     public void testEhloResolv() throws Exception, SMTPException {
         m_testConfiguration.setEhloResolv();
         finishSetUp(m_testConfiguration);
@@ -394,7 +440,7 @@
 
         String userName = "test_user_smtp";
         String noexistUserName = "noexist_test_user_smtp";
-        
+        String sender ="test_user_smtp@localhost";
         smtpProtocol.sendCommand("AUTH FOO", null);
         SMTPResponse response = smtpProtocol.getResponse();
         assertEquals("expected error: unrecognized authentication type", 504, response.getCode());
@@ -399,7 +445,7 @@
         SMTPResponse response = smtpProtocol.getResponse();
         assertEquals("expected error: unrecognized authentication type", 504, response.getCode());
 
-        smtpProtocol.mail(new Address(userName));
+        smtpProtocol.mail(new Address(sender));
 
         try {
             smtpProtocol.rcpt(new Address("mail@sample.com"));
