Author: bago Date: Wed Apr 12 02:36:45 2006 New Revision: 393422 URL: http://svn.apache.org/viewcvs?rev=393422&view=rev Log: Changed ignoreRelayClients to inverse checkAuthClients (related to JAMES-465) I don't like too much this option name, too: feel free to submit ideas.
Modified: james/server/trunk/src/conf/james-config.xml james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java james/server/trunk/src/test/org/apache/james/smtpserver/SMTPServerTest.java james/server/trunk/src/test/org/apache/james/smtpserver/SMTPTestConfiguration.java Modified: james/server/trunk/src/conf/james-config.xml URL: http://svn.apache.org/viewcvs/james/server/trunk/src/conf/james-config.xml?rev=393422&r1=393421&r2=393422&view=diff ============================================================================== --- james/server/trunk/src/conf/james-config.xml (original) +++ james/server/trunk/src/conf/james-config.xml Wed Apr 12 02:36:45 2006 @@ -725,9 +725,9 @@ <checkValidSenderDomain> false </checkValidSenderDomain> --> <!-- If is set to true sender domain from clients that are allowed to --> - <!-- relay will not checked. Default is true. --> + <!-- relay will be checked, too. Default is false. --> <!-- - <ignoreRelayClients> true </ignoreRelayClients> + <checkAuthClients> false </checkAuthClients> --> </handler> <handler command="RCPT" class="org.apache.james.smtpserver.RcptCmdHandler"> Modified: james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java?rev=393422&r1=393421&r2=393422&view=diff ============================================================================== --- james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java (original) +++ james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java Wed Apr 12 02:36:45 2006 @@ -45,7 +45,7 @@ private boolean checkValidSenderDomain = false; - private boolean ignoreRelay = true; + private boolean checkAuthClients = false; private DNSServer dnsServer = null; @@ -61,9 +61,9 @@ } } - Configuration configRelay = handlerConfiguration.getChild("ignoreRelayClients",false); + Configuration configRelay = handlerConfiguration.getChild("checkAuthClients",false); if(configRelay != null) { - ignoreRelay = configRelay.getValueAsBoolean(); + checkAuthClients = configRelay.getValueAsBoolean(); } } @@ -202,7 +202,7 @@ /** * don't check if the ip address is allowed to relay. Only check if it is set in the config. */ - if (!session.isRelayingAllowed() || !ignoreRelay) { + if (checkAuthClients || !session.isRelayingAllowed()) { // Maybe we should build a static method in org.apache.james.dnsserver.DNSServer ? Collection records; Modified: james/server/trunk/src/test/org/apache/james/smtpserver/SMTPServerTest.java URL: http://svn.apache.org/viewcvs/james/server/trunk/src/test/org/apache/james/smtpserver/SMTPServerTest.java?rev=393422&r1=393421&r2=393422&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 Wed Apr 12 02:36:45 2006 @@ -406,7 +406,7 @@ public void testSenderDomainResolvRelayClient() throws Exception, SMTPException { m_testConfiguration.setSenderDomainResolv(); - m_testConfiguration.setIgnoreRelayClients(false); + m_testConfiguration.setCheckAuthClients(true); finishSetUp(m_testConfiguration); SMTPProtocol smtpProtocol1 = new SMTPProtocol("127.0.0.1", m_smtpListenerPort); Modified: james/server/trunk/src/test/org/apache/james/smtpserver/SMTPTestConfiguration.java URL: http://svn.apache.org/viewcvs/james/server/trunk/src/test/org/apache/james/smtpserver/SMTPTestConfiguration.java?rev=393422&r1=393421&r2=393422&view=diff ============================================================================== --- james/server/trunk/src/test/org/apache/james/smtpserver/SMTPTestConfiguration.java (original) +++ james/server/trunk/src/test/org/apache/james/smtpserver/SMTPTestConfiguration.java Wed Apr 12 02:36:45 2006 @@ -34,7 +34,7 @@ private boolean m_heloResolv = false; private boolean m_ehloResolv = false; private boolean m_senderDomainResolv = false; - private boolean m_ignoreRelayClients = true; + private boolean m_checkAuthClients = false; private int m_maxRcpt = 0; @@ -92,8 +92,8 @@ m_senderDomainResolv = true; } - public void setIgnoreRelayClients(boolean ignore) { - m_ignoreRelayClients = ignore; + public void setCheckAuthClients(boolean ignore) { + m_checkAuthClients = ignore; } public void setMaxRcpt(int maxRcpt) { @@ -129,7 +129,7 @@ ((DefaultConfiguration) heloConfig[i]).addChild(Util.getValuedConfiguration("checkValidEhlo",m_ehloResolv+"")); } else if ("MAIL".equals(cmd)) { ((DefaultConfiguration) heloConfig[i]).addChild(Util.getValuedConfiguration("checkValidSenderDomain",m_senderDomainResolv+"")); - ((DefaultConfiguration) heloConfig[i]).addChild(Util.getValuedConfiguration("ignoreRelayClients",m_ignoreRelayClients+"")); + ((DefaultConfiguration) heloConfig[i]).addChild(Util.getValuedConfiguration("checkAuthClients",m_checkAuthClients+"")); } else if ("RCPT".equals(cmd)) { ((DefaultConfiguration) heloConfig[i]).addChild(Util.getValuedConfiguration("maxRcpt",m_maxRcpt+"")); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]