Author: norman Date: Mon Jul 17 10:41:09 2006 New Revision: 422770 URL: http://svn.apache.org/viewvc?rev=422770&view=rev Log: Add junit test to get sure it works with the new commit again
Modified: james/server/trunk/src/test/org/apache/james/smtpserver/SMTPServerTest.java Modified: james/server/trunk/src/test/org/apache/james/smtpserver/SMTPServerTest.java URL: http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/smtpserver/SMTPServerTest.java?rev=422770&r1=422769&r2=422770&view=diff ============================================================================== --- james/server/trunk/src/test/org/apache/james/smtpserver/SMTPServerTest.java (original) +++ james/server/trunk/src/test/org/apache/james/smtpserver/SMTPServerTest.java Mon Jul 17 10:41:09 2006 @@ -1121,4 +1121,34 @@ assertNotNull("mail received by mail server", m_mailServer .getLastMail()); } + + + public void testDNSRBLRejectWorks() throws Exception { + m_testConfiguration.setAuthorizedAddresses("192.168.0.1/32"); + m_testConfiguration.useRBL(true); + finishSetUp(m_testConfiguration); + + m_dnsServer.setLocalhostByName(InetAddress.getByName("127.0.0.1")); + + SMTPClient smtpProtocol = new SMTPClient(); + smtpProtocol.connect("127.0.0.1", m_smtpListenerPort); + + smtpProtocol.sendCommand("ehlo", InetAddress.getLocalHost().toString()); + + String sender = "[EMAIL PROTECTED]"; + + smtpProtocol.setSender(sender); + + smtpProtocol.addRecipient("[EMAIL PROTECTED]"); + assertEquals("reject", 550, smtpProtocol + .getReplyCode()); + + smtpProtocol.sendShortMessageData("Subject: test\r\n\r\nTest body\r\n"); + + smtpProtocol.quit(); + + // mail was rejected by SMTPServer + assertNull("mail reject by mail server", m_mailServer + .getLastMail()); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]