Author: norman Date: Tue Sep 27 19:04:14 2011 New Revision: 1176529 URL: http://svn.apache.org/viewvc?rev=1176529&view=rev Log: Finish the "import" of the lmtpserver code base. Its now reusable without any dependencies on james server. See PROTOCOLS-1
Added: james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java (with props) james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocol.java (with props) james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java (with props) james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/WelcomeMessageHandler.java - copied, changed from r1176508, james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LhloWelcomeMessageHandler.java Removed: james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LhloWelcomeMessageHandler.java Modified: james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java Added: james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java?rev=1176529&view=auto ============================================================================== --- james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java (added) +++ james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java Tue Sep 27 19:04:14 2011 @@ -0,0 +1,88 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.protocols.lmtp; + +import org.apache.james.protocols.smtp.SMTPConfiguration; + +public class LMTPConfiguration implements SMTPConfiguration{ + + private String helloName = "localhost"; + private long maxMessageSize = 0; + private String greeting = "JAMES Protocols LMTP Server"; + + @Override + public String getHelloName() { + return helloName; + } + + public void setHelloName(String helloName) { + this.helloName = helloName; + } + + @Override + public int getResetLength() { + return -1; + } + + @Override + public long getMaxMessageSize() { + return maxMessageSize; + } + + public void setMaxMessageSize(long maxMessageSize) { + this.maxMessageSize = maxMessageSize; + } + + + @Override + public boolean isRelayingAllowed(String remoteIP) { + return false; + } + + @Override + public boolean isAuthRequired(String remoteIP) { + return false; + } + + @Override + public boolean useHeloEhloEnforcement() { + return false; + } + + @Override + public String getSMTPGreeting() { + return greeting; + } + + public void setGreeting(String greeting) { + this.greeting = greeting; + } + + + @Override + public boolean useAddressBracketsEnforcement() { + return false; + } + + @Override + public boolean isStartTLSSupported() { + return false; + } + +} Propchange: james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocol.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocol.java?rev=1176529&view=auto ============================================================================== --- james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocol.java (added) +++ james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocol.java Tue Sep 27 19:04:14 2011 @@ -0,0 +1,35 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.protocols.lmtp; + +import org.apache.james.protocols.api.handler.ProtocolHandlerChain; +import org.apache.james.protocols.smtp.SMTPProtocol; + +public class LMTPProtocol extends SMTPProtocol{ + + public LMTPProtocol(ProtocolHandlerChain chain, LMTPConfiguration config) { + super(chain, config); + } + + @Override + public boolean isStartTLSSupported() { + return false; + } + +} Propchange: james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocol.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java?rev=1176529&view=auto ============================================================================== --- james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java (added) +++ james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java Tue Sep 27 19:04:14 2011 @@ -0,0 +1,66 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.protocols.lmtp; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.james.protocols.api.handler.WiringException; +import org.apache.james.protocols.smtp.SMTPProtocolHandlerChain; +import org.apache.james.protocols.smtp.core.DataCmdHandler; +import org.apache.james.protocols.smtp.core.ExpnCmdHandler; +import org.apache.james.protocols.smtp.core.HelpCmdHandler; +import org.apache.james.protocols.smtp.core.MailCmdHandler; +import org.apache.james.protocols.smtp.core.NoopCmdHandler; +import org.apache.james.protocols.smtp.core.QuitCmdHandler; +import org.apache.james.protocols.smtp.core.RcptCmdHandler; +import org.apache.james.protocols.smtp.core.ReceivedDataLineFilter; +import org.apache.james.protocols.smtp.core.RsetCmdHandler; +import org.apache.james.protocols.smtp.core.SMTPCommandDispatcherLineHandler; +import org.apache.james.protocols.smtp.core.VrfyCmdHandler; +import org.apache.james.protocols.smtp.core.esmtp.MailSizeEsmtpExtension; + +public class LMTPProtocolHandlerChain extends SMTPProtocolHandlerChain{ + + public LMTPProtocolHandlerChain() throws WiringException { + super(); + } + + @Override + protected List<Object> initDefaultHandlers() { + List<Object> defaultHandlers = new ArrayList<Object>(); + defaultHandlers.add(new SMTPCommandDispatcherLineHandler()); + defaultHandlers.add(new ExpnCmdHandler()); + defaultHandlers.add(new LhloCmdHandler()); + defaultHandlers.add(new HelpCmdHandler()); + defaultHandlers.add(new MailCmdHandler()); + defaultHandlers.add(new NoopCmdHandler()); + defaultHandlers.add(new QuitCmdHandler()); + defaultHandlers.add(new RcptCmdHandler()); + defaultHandlers.add(new RsetCmdHandler()); + defaultHandlers.add(new VrfyCmdHandler()); + defaultHandlers.add(new DataCmdHandler()); + defaultHandlers.add(new MailSizeEsmtpExtension()); + defaultHandlers.add(new WelcomeMessageHandler()); + defaultHandlers.add(new ReceivedDataLineFilter()); + defaultHandlers.add(new LMTPDataLineMessageHookHandler()); + return defaultHandlers; + } + +} Propchange: james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/WelcomeMessageHandler.java (from r1176508, james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LhloWelcomeMessageHandler.java) URL: http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/WelcomeMessageHandler.java?p2=james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/WelcomeMessageHandler.java&p1=james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LhloWelcomeMessageHandler.java&r1=1176508&r2=1176529&rev=1176529&view=diff ============================================================================== --- james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LhloWelcomeMessageHandler.java (original) +++ james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/WelcomeMessageHandler.java Tue Sep 27 19:04:14 2011 @@ -19,12 +19,11 @@ package org.apache.james.protocols.lmtp; -import org.apache.james.protocols.smtp.core.WelcomeMessageHandler; /** * Greeting for LMTP Server */ -public class LhloWelcomeMessageHandler extends WelcomeMessageHandler { +public class WelcomeMessageHandler extends org.apache.james.protocols.smtp.core.WelcomeMessageHandler { private final static String SOFTWARE_TYPE = "JAMES Protocols LMTP Server"; // + Modified: james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java?rev=1176529&r1=1176528&r2=1176529&view=diff ============================================================================== --- james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java (original) +++ james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java Tue Sep 27 19:04:14 2011 @@ -32,7 +32,7 @@ public class SMTPProtocol implements Pro private ProtocolHandlerChain chain; private SMTPConfiguration config; - private Logger logger = LoggerFactory.getLogger(SMTPProtocol.class); + private Logger logger = LoggerFactory.getLogger(getClass()); public SMTPProtocol(ProtocolHandlerChain chain, SMTPConfiguration config) { --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org