[jira] [Created] (JAMES-1360) Use protocols 1.6.0-RC2-SNAPSHOT
Use protocols 1.6.0-RC2-SNAPSHOT Key: JAMES-1360 URL: https://issues.apache.org/jira/browse/JAMES-1360 Project: JAMES Server Issue Type: New Feature Affects Versions: Trunk Reporter: Eric Charles Assignee: Eric Charles Fix For: 3.0-beta4 There are a bunch of API changes between protocols-1.6-beta3 and protocols-1.6.0-RC2-SNAPSHOT. We need to update server code (mainly pop3/imap/smtp server projects) to align to the current protocols implementation. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228090 - in /james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger: ProtocolLoggerAdapter.java Slf4jLogger.java Slf4jLoggerAdapter.java
Author: eric Date: Fri Jan 6 11:18:24 2012 New Revision: 1228090 URL: http://svn.apache.org/viewvc?rev=1228090view=rev Log: We need some logger adapters from/to slf4j (JAMES-1360) Added: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/ProtocolLoggerAdapter.java - copied, changed from r1226898, james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLogger.java james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLoggerAdapter.java Removed: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLogger.java Copied: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/ProtocolLoggerAdapter.java (from r1226898, james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLogger.java) URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/ProtocolLoggerAdapter.java?p2=james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/ProtocolLoggerAdapter.javap1=james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLogger.javar1=1226898r2=1228090rev=1228090view=diff == --- james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLogger.java (original) +++ james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/ProtocolLoggerAdapter.java Fri Jan 6 11:18:24 2012 @@ -22,11 +22,11 @@ package org.apache.james.protocols.api.l * Adapter class for SLF4J * */ -public class Slf4jLogger implements Logger{ +public class ProtocolLoggerAdapter implements Logger{ private final org.slf4j.Logger logger; -public Slf4jLogger(org.slf4j.Logger logger) { +public ProtocolLoggerAdapter(org.slf4j.Logger logger) { this.logger = logger; } Added: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLoggerAdapter.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLoggerAdapter.java?rev=1228090view=auto == --- james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLoggerAdapter.java (added) +++ james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLoggerAdapter.java Fri Jan 6 11:18:24 2012 @@ -0,0 +1,319 @@ +/ + * 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.api.logger; + +import org.slf4j.Marker; + +/** + * Adapter class for SLF4J + * + */ +public class Slf4jLoggerAdapter implements org.slf4j.Logger { + +private final Logger logger; + +public Slf4jLoggerAdapter(Logger logger) { +this.logger = logger; +} + +public boolean isDebugEnabled() { +return logger.isDebugEnabled(); +} + +public boolean isErrorEnabled() { +return logger.isErrorEnabled(); +} +public boolean isInfoEnabled() { +return logger.isInfoEnabled(); +} + +public boolean isTraceEnabled() { +return logger.isTraceEnabled(); +} + +public boolean isWarnEnabled() { +return logger.isWarnEnabled(); +} + +public void trace(String message) { +logger.trace(message); +} + +public void trace(String message, Throwable t) { +logger.trace(message, t); +} + +public void debug(String message) { +logger.debug(message); +} + +public void debug(String message, Throwable t) { +logger.debug(message, t); +} + +public void info(String message) { +logger.info(message); +
svn commit: r1228093 - /james/server/trunk/pom.xml
Author: eric Date: Fri Jan 6 11:20:26 2012 New Revision: 1228093 URL: http://svn.apache.org/viewvc?rev=1228093view=rev Log: Bump protocols version from 1.6-beta3 to 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/pom.xml Modified: james/server/trunk/pom.xml URL: http://svn.apache.org/viewvc/james/server/trunk/pom.xml?rev=1228093r1=1228092r2=1228093view=diff == --- james/server/trunk/pom.xml (original) +++ james/server/trunk/pom.xml Fri Jan 6 11:20:26 2012 @@ -106,7 +106,7 @@ jsieve.version0.4/jsieve.version mailbox.version0.4-SNAPSHOT/mailbox.version productNameApache-James Mail Server/productName -protocols.version1.6-beta3/protocols.version +protocols.version1.6.0-RC2-SNAPSHOT/protocols.version spring.version3.0.5.RELEASE/spring.version /properties - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228094 - /james/server/trunk/container-spring/pom.xml
Author: eric Date: Fri Jan 6 11:21:07 2012 New Revision: 1228094 URL: http://svn.apache.org/viewvc?rev=1228094view=rev Log: We now depend on james-server-protocols-library for the protocol handlers (JAMES-1360) Modified: james/server/trunk/container-spring/pom.xml Modified: james/server/trunk/container-spring/pom.xml URL: http://svn.apache.org/viewvc/james/server/trunk/container-spring/pom.xml?rev=1228094r1=1228093r2=1228094view=diff == --- james/server/trunk/container-spring/pom.xml (original) +++ james/server/trunk/container-spring/pom.xml Fri Jan 6 11:21:07 2012 @@ -74,6 +74,10 @@ /dependency dependency groupIdorg.apache.james/groupId +artifactIdjames-server-protocols-library/artifactId +/dependency +dependency +groupIdorg.apache.james/groupId artifactIdjames-server-data-api/artifactId /dependency dependency - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228097 - /james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java
Author: eric Date: Fri Jan 6 11:23:37 2012 New Revision: 1228097 URL: http://svn.apache.org/viewvc?rev=1228097view=rev Log: Import and Class rename to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java Modified: james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java?rev=1228097r1=1228096r2=1228097view=diff == --- james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java (original) +++ james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java Fri Jan 6 11:23:37 2012 @@ -27,7 +27,9 @@ import org.apache.james.imap.api.ImapSes import org.apache.james.imap.api.process.ImapLineHandler; import org.apache.james.imap.api.process.ImapSession; import org.apache.james.imap.api.process.SelectedMailbox; -import org.apache.james.protocols.api.SessionLog; +import org.apache.james.protocols.api.logger.ProtocolLoggerAdapter; +import org.apache.james.protocols.api.logger.ProtocolSessionLogger; +import org.apache.james.protocols.api.logger.Slf4jLoggerAdapter; import org.jboss.netty.channel.Channel; import org.jboss.netty.handler.codec.compression.ZlibDecoder; import org.jboss.netty.handler.codec.compression.ZlibEncoder; @@ -43,14 +45,14 @@ public class NettyImapSession implements private SSLContext sslContext; private String[] enabledCipherSuites; private boolean compress; -private SessionLog log; +private ProtocolSessionLogger log; private Channel channel; private int handlerCount; private boolean plainAuthDisallowed; public NettyImapSession(Channel channel, Logger log, SSLContext sslContext, String[] enabledCipherSuites, boolean compress, boolean plainAuthDisallowed) { this.channel = channel; -this.log = new SessionLog(channel.getId() + , log); +this.log = new ProtocolSessionLogger(channel.getId() + , new ProtocolLoggerAdapter(log)); this.sslContext = sslContext; this.enabledCipherSuites = enabledCipherSuites; this.compress = compress; @@ -228,7 +230,7 @@ public class NettyImapSession implements * @see org.apache.james.imap.api.process.ImapSession#getLog() */ public Logger getLog() { -return log; +return new Slf4jLoggerAdapter(log); } /** - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228095 - /james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/bean/factory/protocols/ProtocolHandlerLoaderBeanFactory.java
Author: eric Date: Fri Jan 6 11:22:20 2012 New Revision: 1228095 URL: http://svn.apache.org/viewvc?rev=1228095view=rev Log: Use an InitializingLifecycleAwareProtocolHandler interface with the init method (JAMES-1360) Modified: james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/bean/factory/protocols/ProtocolHandlerLoaderBeanFactory.java Modified: james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/bean/factory/protocols/ProtocolHandlerLoaderBeanFactory.java URL: http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/bean/factory/protocols/ProtocolHandlerLoaderBeanFactory.java?rev=1228095r1=1228094r2=1228095view=diff == --- james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/bean/factory/protocols/ProtocolHandlerLoaderBeanFactory.java (original) +++ james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/bean/factory/protocols/ProtocolHandlerLoaderBeanFactory.java Fri Jan 6 11:22:20 2012 @@ -23,7 +23,8 @@ import org.apache.commons.configuration. import org.apache.james.container.spring.bean.AbstractBeanFactory; import org.apache.james.protocols.api.handler.LifecycleAwareProtocolHandler; import org.apache.james.protocols.api.handler.ProtocolHandler; -import org.apache.james.protocols.api.handler.ProtocolHandlerLoader; +import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader; +import org.apache.james.protocols.lib.lifecycle.InitializingLifecycleAwareProtocolHandler; import org.springframework.beans.BeansException; public class ProtocolHandlerLoaderBeanFactory extends AbstractBeanFactory implements ProtocolHandlerLoader{ @@ -37,12 +38,11 @@ public class ProtocolHandlerLoaderBeanFa ClassProtocolHandler c = (ClassProtocolHandler) getBeanFactory().getBeanClassLoader().loadClass(name); ProtocolHandler handler = (ProtocolHandler) getBeanFactory().createBean(c); if (handler instanceof LifecycleAwareProtocolHandler) { -((LifecycleAwareProtocolHandler) handler).init(config); +((InitializingLifecycleAwareProtocolHandler) handler).init(config); } return handler; } catch (ClassNotFoundException e) { throw new LoadingException(Unable to load handler, e); - } catch (BeansException e) { throw new LoadingException(Unable to load handler, e); } catch (ConfigurationException e) { - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228096 - /james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
Author: eric Date: Fri Jan 6 11:23:24 2012 New Revision: 1228096 URL: http://svn.apache.org/viewvc?rev=1228096view=rev Log: Import and Class rename to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java Modified: james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java?rev=1228096r1=1228095r2=1228096view=diff == --- james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java (original) +++ james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java Fri Jan 6 11:23:24 2012 @@ -32,7 +32,9 @@ import org.apache.james.imap.encode.Imap import org.apache.james.imap.encode.ImapResponseComposer; import org.apache.james.imap.encode.base.ImapResponseComposerImpl; import org.apache.james.imap.main.ResponseEncoder; -import org.apache.james.protocols.api.SessionLog; +import org.apache.james.protocols.api.logger.ProtocolLoggerAdapter; +import org.apache.james.protocols.api.logger.ProtocolSessionLogger; +import org.apache.james.protocols.api.logger.Slf4jLoggerAdapter; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelFutureListener; @@ -84,7 +86,7 @@ public class ImapChannelUpstreamHandler } private Logger getLogger(Channel channel) { -return new SessionLog( + channel.getId(), logger); +return new Slf4jLoggerAdapter(new ProtocolSessionLogger( + channel.getId(), new ProtocolLoggerAdapter(logger))); } @Override - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228098 - /james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java
Author: eric Date: Fri Jan 6 11:24:10 2012 New Revision: 1228098 URL: http://svn.apache.org/viewvc?rev=1228098view=rev Log: Import and Class rename to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java URL: http://svn.apache.org/viewvc/james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java?rev=1228098r1=1228097r2=1228098view=diff == --- james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java (original) +++ james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java Fri Jan 6 11:24:10 2012 @@ -23,19 +23,19 @@ import java.util.LinkedList; import java.util.List; import org.apache.james.lmtpserver.hook.MailboxDeliverToRecipientHandler; -import org.apache.james.protocols.api.handler.HandlersPackage; -import org.apache.james.protocols.lmtp.LhloCmdHandler; -import org.apache.james.protocols.lmtp.WelcomeMessageHandler; +import org.apache.james.protocols.api.handler.CommandDispatcher; +import org.apache.james.protocols.lib.handler.HandlersPackage; +import org.apache.james.protocols.lmtp.core.LhloCmdHandler; +import org.apache.james.protocols.lmtp.core.WelcomeMessageHandler; import org.apache.james.protocols.smtp.core.ExpnCmdHandler; -import org.apache.james.protocols.smtp.core.log.HookResultLogger; import org.apache.james.protocols.smtp.core.NoopCmdHandler; import org.apache.james.protocols.smtp.core.PostmasterAbuseRcptHook; import org.apache.james.protocols.smtp.core.QuitCmdHandler; 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; +import org.apache.james.protocols.smtp.core.log.HookResultLogger; import org.apache.james.smtpserver.AuthRequiredToRelayRcptHook; import org.apache.james.smtpserver.JamesDataCmdHandler; import org.apache.james.smtpserver.JamesMailCmdHandler; @@ -48,7 +48,7 @@ import org.apache.james.smtpserver.fastf */ public class CoreCmdHandlerLoader implements HandlersPackage { -private final String COMMANDDISPATCHER = SMTPCommandDispatcherLineHandler.class.getName(); +private final String COMMANDDISPATCHER = CommandDispatcher.class.getName(); private final String DATACMDHANDLER = JamesDataCmdHandler.class.getName(); private final String EXPNCMDHANDLER = ExpnCmdHandler.class.getName(); private final String LHLOCMDHANDLER = LhloCmdHandler.class.getName(); - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228099 - /james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java
Author: eric Date: Fri Jan 6 11:24:34 2012 New Revision: 1228099 URL: http://svn.apache.org/viewvc?rev=1228099view=rev Log: Import and Class rename to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java?rev=1228099r1=1228098r2=1228099view=diff == --- james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java (original) +++ james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java Fri Jan 6 11:24:34 2012 @@ -29,6 +29,7 @@ import org.apache.james.protocols.api.Re import org.apache.james.protocols.api.handler.WiringException; import org.apache.james.protocols.lmtp.LMTPMultiResponse; import org.apache.james.protocols.lmtp.hook.DeliverToRecipientHook; +import org.apache.james.protocols.smtp.MailAddress; import org.apache.james.protocols.smtp.SMTPResponse; import org.apache.james.protocols.smtp.SMTPRetCode; import org.apache.james.protocols.smtp.SMTPSession; @@ -36,7 +37,6 @@ import org.apache.james.protocols.smtp.c import org.apache.james.protocols.smtp.dsn.DSNStatus; import org.apache.james.smtpserver.DataLineJamesMessageHookHandler; import org.apache.mailet.Mail; -import org.apache.mailet.MailAddress; /** * Handler which takes care of deliver the mail to the recipients INBOX - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228100 - /james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java
Author: eric Date: Fri Jan 6 11:24:51 2012 New Revision: 1228100 URL: http://svn.apache.org/viewvc?rev=1228100view=rev Log: Import and Class rename to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java?rev=1228100r1=1228099r2=1228100view=diff == --- james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java (original) +++ james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java Fri Jan 6 11:24:51 2012 @@ -28,7 +28,9 @@ import org.apache.james.mailbox.MailboxE import org.apache.james.mailbox.MailboxManager; import org.apache.james.mailbox.MailboxPath; import org.apache.james.mailbox.MailboxSession; +import org.apache.james.protocols.api.logger.Slf4jLoggerAdapter; import org.apache.james.protocols.lmtp.hook.DeliverToRecipientHook; +import org.apache.james.protocols.smtp.MailAddress; import org.apache.james.protocols.smtp.MailEnvelope; import org.apache.james.protocols.smtp.SMTPRetCode; import org.apache.james.protocols.smtp.SMTPSession; @@ -37,7 +39,6 @@ import org.apache.james.protocols.smtp.h import org.apache.james.protocols.smtp.hook.HookReturnCode; import org.apache.james.user.api.UsersRepository; import org.apache.james.user.api.UsersRepositoryException; -import org.apache.mailet.MailAddress; /** * {@link DeliverToRecipientHook} which deliver the message directly to the recipients mailbox. @@ -72,7 +73,7 @@ public class MailboxDeliverToRecipientHa username = recipient.getLocalPart(); } -MailboxSession mailboxSession = mailboxManager.createSystemSession(username, session.getLogger()); +MailboxSession mailboxSession = mailboxManager.createSystemSession(username, new Slf4jLoggerAdapter(session.getLogger())); MailboxPath inbox = MailboxPath.inbox(mailboxSession); mailboxManager.startProcessingRequest(mailboxSession); - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
ACL Support - cont. from server-user
Gentlemen, Please read and comment. I have started to implement the ACL support. In the very first phase I would like to - add support for IMAP GETACL command and - add support for storing ACL at least for one storage backend. During this first phase I would like to learn how to do things in a James-compiliant way so that I will be able to implement other ACL commands later. 1. A new interface org.apache.james.mailbox.MailboxACL and default implementation org.apache.james.mailbox.store.SimpleMailboxACL Stores an ACL applicable to a mailbox. Inspired by RFC4314 IMAP4 Access Control List (ACL) Extension. Note: An ACL class that could serve our purpose exists in com.sun.mail.imap. We will not stick to a proprietary API, will we? 2. MailboxACL usage: org.apache.james.mailbox.store.mail.model.MailboxId and implementations will be extended to store the related ACL: MailboxACL getACL(); void setACL(MailboxACL acl); This is probably OK. 3. MailboxACL usage: org.apache.james.mailbox.MessageManager.MetaData will be extended to offer a read access to the ACL of the related mailbox. This was approved by Norman Maurer. MailboxACL getACL(); 4. MailboxACL usage: Under org.apache.james.imap ACL-related requests, decoders, responses, encoders and processors will use MailboxACL. It is probably OK as there is a lot of org.apache.james.mailbox.* usage under org.apache.james.imap. 5. MailboxACL instantiation: Clearly, there will be (at least) two places where MailboxACL will be instantiated: i. In Mailbox implementations when reading ACLs from their backends ii. In org.apache.james.imap decoders when parsing the ACL related IMAP requests. At the moment I have hardcoded a constructor of my default implementation on both places. I am asking myself if some kind of factory pattern should be used instead. 6. How to access an ACL stored in a mailbox backend from a subclass of org.apache.james.imap.processor.AbstractMailboxProcessor: At the moment I have this code to prepare a response for GETACL IMAP command: MessageManager messageManager = getMailboxManager().getMailbox(buildFullPath(session, mailboxName), mailboxSession); MetaData metaData = messageManager.getMetaData(false, mailboxSession, FetchGroup.NO_COUNT); I have not tested it yet, but principally, it should work. I only wonder at two things with that code: i. org.apache.james.mailbox.MailboxManager.getMailbox(MailboxPath, MailboxSession) It returns a MessageManager rather than a Mailbox. Should it not rather be called getMessageManager? ii. org.apache.james.mailbox.MessageManager.getMetaData(boolean, MailboxSession, FetchGroup) Javadoc says Gets current meta data for the mailbox. Why is this method in MessageManager and not in MailboxManager? 7. What and in which order should the GetACLProcessor say after sending the ACL response? i. Should it send also unsolicitedResponses? ii. unsolicitedResponses should be sent before or after okComplete? iii. on MailboxException, we send no() and I wonder what should its HumanReadableText say? iv. is the no() sufficient for all exceptions? What if somebody is asking for ACL of a folder which (a) does not exist or (b) cannot be looked up by the current user? Isn't taggedBad more suitable for (a) and/or (b)? Here is what I have now: @Override protected void doProcess(GetACLRequest message, ImapSession session, String tag, ImapCommand command, Responder responder) { final MailboxManager mailboxManager = getMailboxManager(); final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session); try { String mailboxName = message.getMailboxName(); MessageManager messageManager = mailboxManager.getMailbox(buildFullPath(session, mailboxName), mailboxSession); MetaData metaData = messageManager.getMetaData(false, mailboxSession, FetchGroup.NO_COUNT); ACLResponse aclResponse = new ACLResponse(mailboxName, metaData.getACL()); responder.respond(aclResponse); okComplete(command, tag, responder); //FIXME should we send unsolicited responses here? //unsolicitedResponses(session, responder, false); } catch (MailboxException e) { // FIXME: be more specific in the human readable text. no(command, tag, responder, HumanReadableText.GENERIC_FAILURE_DURING_PROCESSING); } } 8. Interpretation of ACLs: To have ACL stored on every mailbox is far from being able to tell if the given user can perform the given operation for the given mailbox(es when copying/moving). A new service responsible for resolving of ACLs is necessary. I propose to call it MailboxACLResolver. In which package should it be placed? Also in org.apache.james.mailbox? Probably every single operation between IMAP and mailbox stores should pass through this service. Where in the code should such a permission
svn commit: r1228101 - /james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/jmx/JMXHandlersLoader.java
Author: eric Date: Fri Jan 6 11:25:41 2012 New Revision: 1228101 URL: http://svn.apache.org/viewvc?rev=1228101view=rev Log: Import and Class rename to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/jmx/JMXHandlersLoader.java Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/jmx/JMXHandlersLoader.java URL: http://svn.apache.org/viewvc/james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/jmx/JMXHandlersLoader.java?rev=1228101r1=1228100r2=1228101view=diff == --- james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/jmx/JMXHandlersLoader.java (original) +++ james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/jmx/JMXHandlersLoader.java Fri Jan 6 11:25:41 2012 @@ -21,7 +21,7 @@ package org.apache.james.lmtpserver.jmx; import java.util.ArrayList; import java.util.List; -import org.apache.james.protocols.api.handler.HandlersPackage; +import org.apache.james.protocols.lib.handler.HandlersPackage; public class JMXHandlersLoader implements HandlersPackage { - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228102 - /james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java
Author: eric Date: Fri Jan 6 11:26:18 2012 New Revision: 1228102 URL: http://svn.apache.org/viewvc?rev=1228102view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java URL: http://svn.apache.org/viewvc/james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java?rev=1228102r1=1228101r2=1228102view=diff == --- james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java (original) +++ james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java Fri Jan 6 11:26:18 2012 @@ -23,7 +23,8 @@ import org.apache.commons.configuration. import org.apache.commons.configuration.HierarchicalConfiguration; import org.apache.james.lmtpserver.CoreCmdHandlerLoader; import org.apache.james.lmtpserver.jmx.JMXHandlersLoader; -import org.apache.james.protocols.api.handler.HandlersPackage; +import org.apache.james.protocols.api.logger.ProtocolLoggerAdapter; +import org.apache.james.protocols.lib.handler.HandlersPackage; import org.apache.james.protocols.lib.netty.AbstractProtocolAsyncServer; import org.apache.james.protocols.lmtp.LMTPConfiguration; import org.apache.james.protocols.smtp.SMTPProtocol; @@ -137,7 +138,7 @@ public class LMTPServer extends Abstract @Override protected ChannelUpstreamHandler createCoreHandler() { -SMTPProtocol protocol = new SMTPProtocol(getProtocolHandlerChain(), lmtpConfig); +SMTPProtocol protocol = new SMTPProtocol(getProtocolHandlerChain(), lmtpConfig, new ProtocolLoggerAdapter(getLogger())); return new SMTPChannelUpstreamHandler(protocol, getLogger()); } - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228103 - /james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java
Author: eric Date: Fri Jan 6 11:26:32 2012 New Revision: 1228103 URL: http://svn.apache.org/viewvc?rev=1228103view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java URL: http://svn.apache.org/viewvc/james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java?rev=1228103r1=1228102r2=1228103view=diff == --- james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java (original) +++ james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java Fri Jan 6 11:26:32 2012 @@ -25,7 +25,7 @@ import javax.annotation.Resource; import org.apache.commons.configuration.HierarchicalConfiguration; import org.apache.james.filesystem.api.FileSystem; -import org.apache.james.protocols.api.handler.ProtocolHandlerLoader; +import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader; import org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer; import org.apache.james.protocols.lib.netty.AbstractServerFactory; import org.slf4j.Logger; - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228104 - /james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java
Author: eric Date: Fri Jan 6 11:26:46 2012 New Revision: 1228104 URL: http://svn.apache.org/viewvc?rev=1228104view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java?rev=1228104r1=1228103r2=1228104view=diff == --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java Fri Jan 6 11:26:46 2012 @@ -22,12 +22,12 @@ package org.apache.james.pop3server.core import java.util.LinkedList; import java.util.List; -import org.apache.james.protocols.api.handler.HandlersPackage; +import org.apache.james.protocols.api.handler.CommandDispatcher; +import org.apache.james.protocols.lib.handler.HandlersPackage; import org.apache.james.protocols.pop3.core.CapaCmdHandler; import org.apache.james.protocols.pop3.core.DeleCmdHandler; import org.apache.james.protocols.pop3.core.ListCmdHandler; import org.apache.james.protocols.pop3.core.NoopCmdHandler; -import org.apache.james.protocols.pop3.core.POP3CommandDispatcherLineHandler; import org.apache.james.protocols.pop3.core.QuitCmdHandler; import org.apache.james.protocols.pop3.core.RetrCmdHandler; import org.apache.james.protocols.pop3.core.RsetCmdHandler; @@ -56,7 +56,7 @@ public class CoreCmdHandlerLoader implem private final static String UNKOWNCMDHANDLER = UnknownCmdHandler.class.getName(); private final static String STLSCMDHANDLER = StlsCmdHandler.class.getName(); -private final static String COMMANDDISPATCHER = POP3CommandDispatcherLineHandler.class.getName(); +private final static String COMMANDDISPATCHER = CommandDispatcher.class.getName(); // logging stuff private final String COMMANDHANDLERRESULTLOGGER = POP3CommandHandlerResultLogger.class.getName(); - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228105 - /james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java
Author: eric Date: Fri Jan 6 11:27:18 2012 New Revision: 1228105 URL: http://svn.apache.org/viewvc?rev=1228105view=rev Log: This class needs to be fixed, it doesn't fullfill what's excepted when loded via spring (JAMES-1360) Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java?rev=1228105r1=1228104r2=1228105view=diff == --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java Fri Jan 6 11:27:18 2012 @@ -18,8 +18,6 @@ / package org.apache.james.pop3server.core; -import javax.annotation.Resource; - import org.apache.james.protocols.api.Request; import org.apache.james.protocols.api.Response; import org.apache.james.protocols.lib.POP3BeforeSMTPHelper; @@ -35,16 +33,20 @@ import org.apache.james.protocols.pop3.m */ public class JamesPassCmdHandler extends PassCmdHandler { -@Resource(name = mailboxfactory) -public void setMailboxFactory(MailboxFactory factory) { -super.setMailboxFactory(factory); +// TODO Check that this constructor is correctly called and can replace the mailboxfactory injection +public JamesPassCmdHandler(MailboxFactory factory) { +super(factory); } +//@Resource(name = mailboxfactory) +//public void setMailboxFactory(MailboxFactory factory) { +//super.setMailboxFactory(factory); +//} @Override public Response onCommand(POP3Session session, Request request) { Response response = super.onCommand(session, request); if (POP3Response.OK_RESPONSE.equals(response.getRetCode())) { -POP3BeforeSMTPHelper.addIPAddress(session.getRemoteIPAddress()); + POP3BeforeSMTPHelper.addIPAddress(session.getRemoteAddress().getAddress().toString()); } return response; } - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228106 - /james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/WelcomeMessageHandler.java
Author: eric Date: Fri Jan 6 11:27:52 2012 New Revision: 1228106 URL: http://svn.apache.org/viewvc?rev=1228106view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/WelcomeMessageHandler.java Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/WelcomeMessageHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/WelcomeMessageHandler.java?rev=1228106r1=1228105r2=1228106view=diff == --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/WelcomeMessageHandler.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/WelcomeMessageHandler.java Fri Jan 6 11:27:52 2012 @@ -37,7 +37,7 @@ public class WelcomeMessageHandler imple StringBuilder responseBuffer = new StringBuilder(); // Initially greet the connector // Format is: Sat, 24 Jan 1998 13:16:09 -0500 - responseBuffer.append(session.getConfigurationData().getHelloName()).append( POP3 server ().append(softwaretype).append() ready ); + responseBuffer.append(session.getConfiguration().getHelloName()).append( POP3 server ().append(softwaretype).append() ready ); POP3Response response = new POP3Response(POP3Response.OK_RESPONSE, responseBuffer.toString()); return response; } - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228107 - /james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/JMXHandlersLoader.java
Author: eric Date: Fri Jan 6 11:28:02 2012 New Revision: 1228107 URL: http://svn.apache.org/viewvc?rev=1228107view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/JMXHandlersLoader.java Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/JMXHandlersLoader.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/JMXHandlersLoader.java?rev=1228107r1=1228106r2=1228107view=diff == --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/JMXHandlersLoader.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/JMXHandlersLoader.java Fri Jan 6 11:28:02 2012 @@ -21,7 +21,7 @@ package org.apache.james.pop3server.jmx; import java.util.ArrayList; import java.util.List; -import org.apache.james.protocols.api.handler.HandlersPackage; +import org.apache.james.protocols.lib.handler.HandlersPackage; public class JMXHandlersLoader implements HandlersPackage { - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228108 - /james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java
Author: eric Date: Fri Jan 6 11:28:22 2012 New Revision: 1228108 URL: http://svn.apache.org/viewvc?rev=1228108view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java?rev=1228108r1=1228107r2=1228108view=diff == --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java Fri Jan 6 11:28:22 2012 @@ -28,6 +28,7 @@ import org.apache.james.mailbox.MailboxM import org.apache.james.mailbox.MailboxPath; import org.apache.james.mailbox.MailboxSession; import org.apache.james.mailbox.MessageManager; +import org.apache.james.protocols.api.logger.Slf4jLoggerAdapter; import org.apache.james.protocols.pop3.POP3Session; import org.apache.james.protocols.pop3.mailbox.Mailbox; import org.apache.james.protocols.pop3.mailbox.MailboxFactory; @@ -45,7 +46,7 @@ public class JamesMailboxFactory impleme public Mailbox getMailbox(POP3Session session, String password) throws IOException { MailboxSession mSession = null; try { -mSession = manager.login(session.getUser(), password, session.getLogger()); +mSession = manager.login(session.getUser(), password, new Slf4jLoggerAdapter(session.getLogger())); manager.startProcessingRequest(mSession); MailboxPath inbox = MailboxPath.inbox(mSession); - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228110 - in /james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty: POP3Server.java POP3ServerFactory.java
Author: eric Date: Fri Jan 6 11:29:00 2012 New Revision: 1228110 URL: http://svn.apache.org/viewvc?rev=1228110view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ServerFactory.java Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java?rev=1228110r1=1228109r2=1228110view=diff == --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java Fri Jan 6 11:29:00 2012 @@ -21,9 +21,10 @@ package org.apache.james.pop3server.nett import org.apache.james.pop3server.core.CoreCmdHandlerLoader; import org.apache.james.pop3server.jmx.JMXHandlersLoader; -import org.apache.james.protocols.api.handler.HandlersPackage; -import org.apache.james.protocols.netty.BasicChannelUpstreamHandler; +import org.apache.james.protocols.api.logger.ProtocolLoggerAdapter; +import org.apache.james.protocols.lib.handler.HandlersPackage; import org.apache.james.protocols.lib.netty.AbstractProtocolAsyncServer; +import org.apache.james.protocols.netty.BasicChannelUpstreamHandler; import org.apache.james.protocols.pop3.POP3Configuration; import org.apache.james.protocols.pop3.POP3Protocol; import org.jboss.netty.channel.ChannelUpstreamHandler; @@ -53,7 +54,7 @@ public class POP3Server extends Abstract /** * A class to provide POP3 handler configuration to the handlers */ -private class POP3HandlerConfigurationDataImpl implements POP3Configuration { +private class POP3HandlerConfigurationDataImpl extends POP3Configuration { /** * @see org.apache.james.pop3server.POP3HandlerConfiguration#getHelloName() @@ -66,12 +67,10 @@ public class POP3Server extends Abstract @Override protected void preInit() throws Exception { super.preInit(); -POP3Protocol protocol = new POP3Protocol(getProtocolHandlerChain(), theConfigData); - -coreHandler = new BasicChannelUpstreamHandler(protocol, getLogger(), getEncryption()); +POP3Protocol protocol = new POP3Protocol(getProtocolHandlerChain(), theConfigData, new ProtocolLoggerAdapter(getLogger())); +coreHandler = new BasicChannelUpstreamHandler(protocol, getEncryption()); } - @Override protected String getDefaultJMXName() { return pop3server; Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ServerFactory.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ServerFactory.java?rev=1228110r1=1228109r2=1228110view=diff == --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ServerFactory.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ServerFactory.java Fri Jan 6 11:29:00 2012 @@ -7,14 +7,13 @@ import javax.annotation.Resource; import org.apache.commons.configuration.HierarchicalConfiguration; import org.apache.james.filesystem.api.FileSystem; -import org.apache.james.protocols.api.handler.ProtocolHandlerLoader; +import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader; import org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer; import org.apache.james.protocols.lib.netty.AbstractServerFactory; import org.slf4j.Logger; public class POP3ServerFactory extends AbstractServerFactory{ - private ProtocolHandlerLoader loader; private FileSystem fileSystem; - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228111 - /james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java
Author: eric Date: Fri Jan 6 11:29:36 2012 New Revision: 1228111 URL: http://svn.apache.org/viewvc?rev=1228111view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java Modified: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java URL: http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java?rev=1228111r1=1228110r2=1228111view=diff == --- james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java (original) +++ james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java Fri Jan 6 11:29:36 2012 @@ -27,13 +27,12 @@ import org.apache.commons.configuration. import org.apache.commons.configuration.ConfigurationUtils; import org.apache.commons.configuration.DefaultConfigurationBuilder; import org.apache.commons.configuration.HierarchicalConfiguration; - import org.apache.james.protocols.api.handler.ExtensibleHandler; -import org.apache.james.protocols.api.handler.HandlersPackage; -import org.apache.james.protocols.api.handler.LifecycleAwareProtocolHandler; import org.apache.james.protocols.api.handler.ProtocolHandlerChain; -import org.apache.james.protocols.api.handler.ProtocolHandlerLoader; import org.apache.james.protocols.api.handler.WiringException; +import org.apache.james.protocols.lib.handler.HandlersPackage; +import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader; +import org.apache.james.protocols.lib.lifecycle.InitializingLifecycleAwareProtocolHandler; public class ProtocolHandlerChainImpl implements ProtocolHandlerChain{ @@ -160,11 +159,11 @@ public class ProtocolHandlerChainImpl im } /** - * Destroy all loaded {@link LifecycleAwareProtocolHandler} + * Destroy all loaded {@link InitializingLifecycleAwareProtocolHandler} */ public void destroy() { -LinkedListLifecycleAwareProtocolHandler lHandlers = getHandlers(LifecycleAwareProtocolHandler.class); -for (LifecycleAwareProtocolHandler handler: lHandlers) { +LinkedListInitializingLifecycleAwareProtocolHandler lHandlers = getHandlers(InitializingLifecycleAwareProtocolHandler.class); +for (InitializingLifecycleAwareProtocolHandler handler: lHandlers) { handler.destroy(); } } - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228113 - in /james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/lifecycle: ./ InitializingLifecycleAwareProtocolHandler.java
Author: eric Date: Fri Jan 6 11:32:20 2012 New Revision: 1228113 URL: http://svn.apache.org/viewvc?rev=1228113view=rev Log: Add the InitializingLifecycleAwareProtocolHandler interface (JAMES-1360) Added: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/lifecycle/ james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/lifecycle/InitializingLifecycleAwareProtocolHandler.java Added: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/lifecycle/InitializingLifecycleAwareProtocolHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/lifecycle/InitializingLifecycleAwareProtocolHandler.java?rev=1228113view=auto == --- james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/lifecycle/InitializingLifecycleAwareProtocolHandler.java (added) +++ james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/lifecycle/InitializingLifecycleAwareProtocolHandler.java Fri Jan 6 11:32:20 2012 @@ -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.lib.lifecycle; + +import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.ConfigurationException; +import org.apache.james.protocols.api.handler.LifecycleAwareProtocolHandler; + +public interface InitializingLifecycleAwareProtocolHandler extends LifecycleAwareProtocolHandler { + +/** + * Init with the given {@link Configuration} + * + * @param config + * @throws ConfigurationException + */ +public void init(Configuration config) throws ConfigurationException; + +} - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228115 - in /james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx: AbstractCommandHandlerResultJMXMonitor.java AbstractConnectHandlerResultJMXMonitor.jav
Author: eric Date: Fri Jan 6 11:33:25 2012 New Revision: 1228115 URL: http://svn.apache.org/viewvc?rev=1228115view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractCommandHandlerResultJMXMonitor.java james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractConnectHandlerResultJMXMonitor.java james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractLineHandlerResultJMXMonitor.java Modified: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractCommandHandlerResultJMXMonitor.java URL: http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractCommandHandlerResultJMXMonitor.java?rev=1228115r1=1228114r2=1228115view=diff == --- james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractCommandHandlerResultJMXMonitor.java (original) +++ james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractCommandHandlerResultJMXMonitor.java Fri Jan 6 11:33:25 2012 @@ -29,16 +29,16 @@ import org.apache.commons.configuration. import org.apache.james.protocols.api.ProtocolSession; import org.apache.james.protocols.api.Response; import org.apache.james.protocols.api.handler.CommandHandler; +import org.apache.james.protocols.api.handler.ExtensibleHandler; import org.apache.james.protocols.api.handler.ProtocolHandler; import org.apache.james.protocols.api.handler.ProtocolHandlerResultHandler; -import org.apache.james.protocols.api.handler.ExtensibleHandler; -import org.apache.james.protocols.api.handler.LifecycleAwareProtocolHandler; import org.apache.james.protocols.api.handler.WiringException; +import org.apache.james.protocols.lib.lifecycle.InitializingLifecycleAwareProtocolHandler; /** * Expose JMX statistics for {@link CommandHandler} */ -public abstract class AbstractCommandHandlerResultJMXMonitorR extends Response, S extends ProtocolSession implements ProtocolHandlerResultHandlerR, S, ExtensibleHandler, LifecycleAwareProtocolHandler { +public abstract class AbstractCommandHandlerResultJMXMonitorR extends Response, S extends ProtocolSession implements ProtocolHandlerResultHandlerR, S, ExtensibleHandler, InitializingLifecycleAwareProtocolHandler { private MapString, AbstractCommandHandlerStatsR cStats = new HashMapString, AbstractCommandHandlerStatsR(); private String jmxName; Modified: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractConnectHandlerResultJMXMonitor.java URL: http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractConnectHandlerResultJMXMonitor.java?rev=1228115r1=1228114r2=1228115view=diff == --- james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractConnectHandlerResultJMXMonitor.java (original) +++ james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractConnectHandlerResultJMXMonitor.java Fri Jan 6 11:33:25 2012 @@ -30,17 +30,17 @@ import org.apache.james.protocols.api.Pr import org.apache.james.protocols.api.Response; import org.apache.james.protocols.api.handler.ConnectHandler; import org.apache.james.protocols.api.handler.ExtensibleHandler; -import org.apache.james.protocols.api.handler.LifecycleAwareProtocolHandler; import org.apache.james.protocols.api.handler.ProtocolHandler; import org.apache.james.protocols.api.handler.ProtocolHandlerResultHandler; import org.apache.james.protocols.api.handler.WiringException; +import org.apache.james.protocols.lib.lifecycle.InitializingLifecycleAwareProtocolHandler; /** * Handler which will gather statistics for {@link ConnectHandler}'s * * @param S */ -public abstract class AbstractConnectHandlerResultJMXMonitorR extends Response, S extends ProtocolSession implements ProtocolHandlerResultHandlerR,S, ExtensibleHandler, LifecycleAwareProtocolHandler { +public abstract class AbstractConnectHandlerResultJMXMonitorR extends Response, S extends ProtocolSession implements ProtocolHandlerResultHandlerR,S, ExtensibleHandler, InitializingLifecycleAwareProtocolHandler { private MapString, ConnectHandlerStats cStats = new HashMapString, ConnectHandlerStats(); private String jmxName; Modified: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractLineHandlerResultJMXMonitor.java URL:
svn commit: r1228116 - /james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java
Author: eric Date: Fri Jan 6 11:33:34 2012 New Revision: 1228116 URL: http://svn.apache.org/viewvc?rev=1228116view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java Modified: james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java URL: http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java?rev=1228116r1=1228115r2=1228116view=diff == --- james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java (original) +++ james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java Fri Jan 6 11:33:34 2012 @@ -22,11 +22,11 @@ import javax.annotation.Resource; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.HierarchicalConfiguration; -import org.apache.james.protocols.api.handler.HandlersPackage; import org.apache.james.protocols.api.handler.ProtocolHandler; import org.apache.james.protocols.api.handler.ProtocolHandlerChain; -import org.apache.james.protocols.api.handler.ProtocolHandlerLoader; import org.apache.james.protocols.lib.ProtocolHandlerChainImpl; +import org.apache.james.protocols.lib.handler.HandlersPackage; +import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader; /** * Abstract base class which use a {@link ProtocolHandlerLoader} for loading the {@link ProtocolHandler} - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228117 - /james/server/trunk/protocols-library/src/test/java/org/apache/james/protocols/lib/mock/MockProtocolHandlerLoader.java
Author: eric Date: Fri Jan 6 11:33:49 2012 New Revision: 1228117 URL: http://svn.apache.org/viewvc?rev=1228117view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/protocols-library/src/test/java/org/apache/james/protocols/lib/mock/MockProtocolHandlerLoader.java Modified: james/server/trunk/protocols-library/src/test/java/org/apache/james/protocols/lib/mock/MockProtocolHandlerLoader.java URL: http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/test/java/org/apache/james/protocols/lib/mock/MockProtocolHandlerLoader.java?rev=1228117r1=1228116r2=1228117view=diff == --- james/server/trunk/protocols-library/src/test/java/org/apache/james/protocols/lib/mock/MockProtocolHandlerLoader.java (original) +++ james/server/trunk/protocols-library/src/test/java/org/apache/james/protocols/lib/mock/MockProtocolHandlerLoader.java Fri Jan 6 11:33:49 2012 @@ -13,7 +13,7 @@ import javax.annotation.Resource; import org.apache.commons.configuration.Configuration; import org.apache.james.protocols.api.handler.ProtocolHandler; -import org.apache.james.protocols.api.handler.ProtocolHandlerLoader; +import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader; public class MockProtocolHandlerLoader implements ProtocolHandlerLoader{ - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228118 - /james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/
Author: eric Date: Fri Jan 6 11:34:29 2012 New Revision: 1228118 URL: http://svn.apache.org/viewvc?rev=1228118view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/CoreCmdHandlerLoader.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/ExtendedSMTPSession.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/JamesWelcomeMessageHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/MailPriorityHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/POP3BeforeSMTPHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/SendMailHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/SenderAuthIdentifyVerificationRcptHook.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/SetMimeHeaderHandler.java Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java?rev=1228118r1=1228117r2=1228118view=diff == --- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java (original) +++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java Fri Jan 6 11:34:29 2012 @@ -43,8 +43,8 @@ public class AddDefaultAttributesMessage if (mail instanceof MailImpl) { final MailImpl mailImpl = (MailImpl) mail; -mailImpl.setRemoteHost(session.getRemoteHost()); -mailImpl.setRemoteAddr(session.getRemoteIPAddress()); +mailImpl.setRemoteHost(session.getRemoteAddress().getHostName()); + mailImpl.setRemoteAddr(session.getRemoteAddress().getAddress().toString()); if (session.getUser() != null) { mail.setAttribute(SMTP_AUTH_USER_ATTRIBUTE_NAME, session.getUser()); } Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/CoreCmdHandlerLoader.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/CoreCmdHandlerLoader.java?rev=1228118r1=1228117r2=1228118view=diff == --- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/CoreCmdHandlerLoader.java (original) +++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/CoreCmdHandlerLoader.java Fri Jan 6 11:34:29 2012 @@ -22,31 +22,29 @@ package org.apache.james.smtpserver; import java.util.LinkedList; import java.util.List; -import org.apache.james.protocols.api.handler.HandlersPackage; - +import org.apache.james.protocols.api.handler.CommandDispatcher; +import org.apache.james.protocols.lib.handler.HandlersPackage; import org.apache.james.protocols.smtp.core.ExpnCmdHandler; import org.apache.james.protocols.smtp.core.HeloCmdHandler; import org.apache.james.protocols.smtp.core.HelpCmdHandler; -import org.apache.james.protocols.smtp.core.log.HookResultLogger; - import org.apache.james.protocols.smtp.core.NoopCmdHandler; import org.apache.james.protocols.smtp.core.PostmasterAbuseRcptHook; import org.apache.james.protocols.smtp.core.QuitCmdHandler; 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.AuthCmdHandler; import org.apache.james.protocols.smtp.core.esmtp.EhloCmdHandler; import org.apache.james.protocols.smtp.core.esmtp.MailSizeEsmtpExtension; import org.apache.james.protocols.smtp.core.esmtp.StartTlsCmdHandler; +import org.apache.james.protocols.smtp.core.log.HookResultLogger; /** * This class represent the base command handlers which are shipped with james. */ public class CoreCmdHandlerLoader implements HandlersPackage { -private final String COMMANDDISPATCHER = SMTPCommandDispatcherLineHandler.class.getName(); +private final String COMMANDDISPATCHER = CommandDispatcher.class.getName(); private final String AUTHCMDHANDLER = AuthCmdHandler.class.getName(); private final String DATACMDHANDLER =
svn commit: r1228120 - /james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/
Author: eric Date: Fri Jan 6 11:35:16 2012 New Revision: 1228120 URL: http://svn.apache.org/viewvc?rev=1228120view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/JDBCGreylistHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/MaxRcptHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/ResolvableEhloHeloHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/ReverseEqualsEhloHeloHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/SPFHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/SpamAssassinHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/SpamTrapHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/URIRBLHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptMX.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/ValidSenderDomainHandler.java Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java?rev=1228120r1=1228119r2=1228120view=diff == --- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java (original) +++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java Fri Jan 6 11:35:16 2012 @@ -22,21 +22,12 @@ package org.apache.james.smtpserver.fast import java.util.ArrayList; import java.util.List; -import javax.annotation.Resource; - import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.HierarchicalConfiguration; -import org.apache.james.dnsservice.api.DNSService; -import org.apache.james.protocols.api.handler.LifecycleAwareProtocolHandler; -import org.apache.james.smtpserver.SMTPServerDNSServiceAdapter; - -public class DNSRBLHandler extends org.apache.james.protocols.smtp.core.fastfail.DNSRBLHandler implements LifecycleAwareProtocolHandler { - -@Resource(name = dnsservice) -public void setDNSService(DNSService dns) { -super.setDNSService(new SMTPServerDNSServiceAdapter(dns)); -} +import org.apache.james.protocols.lib.lifecycle.InitializingLifecycleAwareProtocolHandler; + +public class DNSRBLHandler extends org.apache.james.protocols.smtp.core.fastfail.DNSRBLHandler implements InitializingLifecycleAwareProtocolHandler { @SuppressWarnings(unchecked) @Override @@ -82,7 +73,6 @@ public class DNSRBLHandler extends org.a @Override public void destroy() { -// TODO Auto-generated method stub - +// Do nothing } } Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/JDBCGreylistHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/JDBCGreylistHandler.java?rev=1228120r1=1228119r2=1228120view=diff == --- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/JDBCGreylistHandler.java (original) +++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/JDBCGreylistHandler.java Fri Jan 6 11:35:16 2012 @@ -41,7 +41,8 @@ import org.apache.commons.configuration. import org.apache.james.dnsservice.api.DNSService; import org.apache.james.dnsservice.library.netmatcher.NetMatcher; import org.apache.james.filesystem.api.FileSystem; -import org.apache.james.protocols.api.handler.LifecycleAwareProtocolHandler; +import org.apache.james.protocols.lib.lifecycle.InitializingLifecycleAwareProtocolHandler; +import org.apache.james.protocols.smtp.MailAddress; import org.apache.james.protocols.smtp.SMTPSession; import org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler; import org.apache.james.protocols.smtp.hook.HookResult; @@ -49,14 +50,13 @@ import org.apache.james.protocols.smtp.h import org.apache.james.util.TimeConverter; import org.apache.james.util.sql.JDBCUtil; import org.apache.james.util.sql.SqlResources; -import
svn commit: r1228123 - in /james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model: ./ MailetMailAddressAdapter.java ProtocolMailAddressAdapter.java
Author: eric Date: Fri Jan 6 11:36:47 2012 New Revision: 1228123 URL: http://svn.apache.org/viewvc?rev=1228123view=rev Log: New MailAddress Adapters between mailet and protocol MailAddress (JAMES-1360) Added: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/MailetMailAddressAdapter.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/ProtocolMailAddressAdapter.java Added: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/MailetMailAddressAdapter.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/MailetMailAddressAdapter.java?rev=1228123view=auto == --- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/MailetMailAddressAdapter.java (added) +++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/MailetMailAddressAdapter.java Fri Jan 6 11:36:47 2012 @@ -0,0 +1,33 @@ +/ + * 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.smtpserver.model; + +import javax.mail.internet.AddressException; + +import org.apache.mailet.MailAddress; + +public class MailetMailAddressAdapter extends MailAddress { + +private static final long serialVersionUID = 1L; + +public MailetMailAddressAdapter(org.apache.james.protocols.smtp.MailAddress mailAddress) throws AddressException { +super(mailAddress.toString()); +} + +} Added: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/ProtocolMailAddressAdapter.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/ProtocolMailAddressAdapter.java?rev=1228123view=auto == --- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/ProtocolMailAddressAdapter.java (added) +++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/model/ProtocolMailAddressAdapter.java Fri Jan 6 11:36:47 2012 @@ -0,0 +1,30 @@ +/ + * 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.smtpserver.model; + +import org.apache.james.protocols.smtp.MailAddress; +import org.apache.james.protocols.smtp.MailAddressException; + +public class ProtocolMailAddressAdapter extends MailAddress { + +public ProtocolMailAddressAdapter(org.apache.mailet.MailAddress mailAddress) throws MailAddressException { +
svn commit: r1228124 - in /james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty: SMTPChannelUpstreamHandler.java SMTPServer.java SMTPServerFactory.java
Author: eric Date: Fri Jan 6 11:36:58 2012 New Revision: 1228124 URL: http://svn.apache.org/viewvc?rev=1228124view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPChannelUpstreamHandler.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServerFactory.java Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPChannelUpstreamHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPChannelUpstreamHandler.java?rev=1228124r1=1228123r2=1228124view=diff == --- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPChannelUpstreamHandler.java (original) +++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPChannelUpstreamHandler.java Fri Jan 6 11:36:58 2012 @@ -37,11 +37,11 @@ public class SMTPChannelUpstreamHandler public SMTPChannelUpstreamHandler(Protocol protocol, Logger logger, Encryption encryption) { -super(protocol, logger, encryption); +super(protocol, encryption); } public SMTPChannelUpstreamHandler(Protocol protocol, Logger logger) { -super(protocol, logger); +super(protocol); } /** Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java?rev=1228124r1=1228123r2=1228124view=diff == --- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java (original) +++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java Fri Jan 6 11:36:58 2012 @@ -28,7 +28,8 @@ import org.apache.james.dnsservice.api.D import org.apache.james.dnsservice.library.netmatcher.NetMatcher; import org.apache.james.protocols.api.ProtocolSession; import org.apache.james.protocols.api.ProtocolTransport; -import org.apache.james.protocols.api.handler.HandlersPackage; +import org.apache.james.protocols.api.logger.ProtocolLoggerAdapter; +import org.apache.james.protocols.lib.handler.HandlersPackage; import org.apache.james.protocols.lib.netty.AbstractProtocolAsyncServer; import org.apache.james.protocols.smtp.SMTPConfiguration; import org.apache.james.protocols.smtp.SMTPProtocol; @@ -106,7 +107,7 @@ public class SMTPServer extends Abstract } authorizedNetworks = new NetMatcher(networks, dns); } -SMTPProtocol transport = new SMTPProtocol(getProtocolHandlerChain(), theConfigData) { +SMTPProtocol transport = new SMTPProtocol(getProtocolHandlerChain(), theConfigData, new ProtocolLoggerAdapter(getLogger())) { @Override public ProtocolSession newSession(ProtocolTransport transport) { @@ -273,6 +274,18 @@ public class SMTPServer extends Abstract return SMTPServer.this.verifyIdentity; } +@Override +public String getGreeting() { +// TODO Auto-generated method stub +return null; +} + +@Override +public String getSoftwareName() { +// TODO Auto-generated method stub +return null; +} + } /** Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServerFactory.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServerFactory.java?rev=1228124r1=1228123r2=1228124view=diff == --- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServerFactory.java (original) +++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPServerFactory.java Fri Jan 6 11:36:58 2012 @@ -27,14 +27,13 @@ import javax.annotation.Resource; import org.apache.commons.configuration.HierarchicalConfiguration; import org.apache.james.dnsservice.api.DNSService; import org.apache.james.filesystem.api.FileSystem; -import org.apache.james.protocols.api.handler.ProtocolHandlerLoader; +import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader; import org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer; import org.apache.james.protocols.lib.netty.AbstractServerFactory; import org.slf4j.Logger; public class SMTPServerFactory extends AbstractServerFactory{ - private
svn commit: r1228125 - in /james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver: SMTPServerTest.java SPFHandlerTest.java ValidRcptHandlerTest.java ValidRcptMXTest.java
Author: eric Date: Fri Jan 6 11:37:10 2012 New Revision: 1228125 URL: http://svn.apache.org/viewvc?rev=1228125view=rev Log: Import and Class rename / usage to use the new protocols 1.6.0-RC2-SNAPSHOT (JAMES-1360) Modified: james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SPFHandlerTest.java james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/ValidRcptMXTest.java Modified: james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java?rev=1228125r1=1228124r2=1228125view=diff == --- james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java (original) +++ james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java Fri Jan 6 11:37:10 2012 @@ -41,18 +41,18 @@ import junit.framework.TestCase; import org.apache.commons.net.smtp.SMTPClient; import org.apache.commons.net.smtp.SMTPReply; -import org.apache.james.protocols.netty.AbstractChannelPipelineFactory; +import org.apache.james.dnsservice.api.DNSService; +import org.apache.james.domainlist.api.mock.SimpleDomainList; +import org.apache.james.filesystem.api.mock.MockFileSystem; +import org.apache.james.mailrepository.mock.MockMailRepositoryStore; import org.apache.james.protocols.lib.PortUtil; import org.apache.james.protocols.lib.mock.MockProtocolHandlerLoader; +import org.apache.james.protocols.netty.AbstractChannelPipelineFactory; import org.apache.james.queue.api.mock.MockMailQueue; import org.apache.james.queue.api.mock.MockMailQueueFactory; import org.apache.james.rrt.api.RecipientRewriteTable; import org.apache.james.rrt.api.RecipientRewriteTableException; import org.apache.james.smtpserver.netty.SMTPServer; -import org.apache.james.dnsservice.api.DNSService; -import org.apache.james.domainlist.api.mock.SimpleDomainList; -import org.apache.james.filesystem.api.mock.MockFileSystem; -import org.apache.james.mailrepository.mock.MockMailRepositoryStore; import org.apache.james.user.lib.mock.MockUsersRepository; import org.apache.mailet.HostAddress; import org.apache.mailet.Mail; @@ -147,7 +147,7 @@ public class SMTPServerTest extends Test protected AlterableDNSServer m_dnsServer; protected MockMailRepositoryStore store; protected MockFileSystem fileSystem; -protected SMTPServerDNSServiceAdapter dnsAdapter; +protected DNSService dnsService; protected MockProtocolHandlerLoader chain; protected MockMailQueueFactory queueFactory; protected MockMailQueue queue; @@ -294,7 +294,7 @@ public class SMTPServerTest extends Test fileSystem = new MockFileSystem(); chain.put(filesystem, fileSystem); -chain.put(org.apache.james.smtpserver.protocol.DNSService, dnsAdapter); +chain.put(org.apache.james.smtpserver.protocol.DNSService, dnsService); chain.put(recipientrewritetable, new RecipientRewriteTable() { public void addRegexMapping(String user, String domain, String regex) throws RecipientRewriteTableException { @@ -359,7 +359,7 @@ public class SMTPServerTest extends Test } }); -chain.put(org.apache.james.smtpserver.protocol.DNSService, dnsAdapter); +chain.put(org.apache.james.smtpserver.protocol.DNSService, dnsService); queueFactory = new MockMailQueueFactory(); queue = (MockMailQueue) queueFactory.getQueue(MockMailQueueFactory.SPOOL); chain.put(mailqueuefactory, queueFactory); Modified: james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SPFHandlerTest.java URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SPFHandlerTest.java?rev=1228125r1=1228124r2=1228125view=diff == --- james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SPFHandlerTest.java (original) +++ james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SPFHandlerTest.java Fri Jan 6 11:37:10 2012 @@ -24,18 +24,18 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import junit.framework.TestCase; + import org.apache.james.jspf.core.DNSRequest; import org.apache.james.jspf.core.DNSService; import org.apache.james.jspf.core.exceptions.TimeoutException; import org.apache.james.protocols.smtp.BaseFakeSMTPSession; +import org.apache.james.protocols.smtp.MailAddress; import org.apache.james.protocols.smtp.SMTPSession; import
svn commit: r1228127 - /james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/SMTPServerDNSServiceAdapter.java
Author: eric Date: Fri Jan 6 11:39:12 2012 New Revision: 1228127 URL: http://svn.apache.org/viewvc?rev=1228127view=rev Log: Remove SMTPServerDNSServiceAdapter (JAMES-1360) Removed: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/SMTPServerDNSServiceAdapter.java - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Re: ACL Support - cont. from server-user
Hi Jochen, comments inside.. Am Freitag, 6. Januar 2012 um 12:25 schrieb Jochen Gazda: Gentlemen, Please read and comment. I have started to implement the ACL support. In the very first phase I would like to - add support for IMAP GETACL command and - add support for storing ACL at least for one storage backend. During this first phase I would like to learn how to do things in a James-compiliant way so that I will be able to implement other ACL commands later. 1. A new interface org.apache.james.mailbox.MailboxACL and default implementation org.apache.james.mailbox.store.SimpleMailboxACL Stores an ACL applicable to a mailbox. Inspired by RFC4314 IMAP4 Access Control List (ACL) Extension. Note: An ACL class that could serve our purpose exists in com.sun.mail.imap. We will not stick to a proprietary API, will we? Nope we should not use it here. I would even be in favor to remove the usage of javamail at all in mailbox but thats another story.. 2. MailboxACL usage: org.apache.james.mailbox.store.mail.model.MailboxId and implementations will be extended to store the related ACL: MailboxACL getACL(); void setACL(MailboxACL acl); This is probably OK. Yes 3. MailboxACL usage: org.apache.james.mailbox.MessageManager.MetaData will be extended to offer a read access to the ACL of the related mailbox. This was approved by Norman Maurer. MailboxACL getACL(); 4. MailboxACL usage: Under org.apache.james.imap ACL-related requests, decoders, responses, encoders and processors will use MailboxACL. It is probably OK as there is a lot of org.apache.james.mailbox.* usage under org.apache.james.imap. yeah... 5. MailboxACL instantiation: Clearly, there will be (at least) two places where MailboxACL will be instantiated: i. In Mailbox implementations when reading ACLs from their backends ii. In org.apache.james.imap decoders when parsing the ACL related IMAP requests. At the moment I have hardcoded a constructor of my default implementation on both places. I am asking myself if some kind of factory pattern should be used instead. Just use the constructor for now, we can change later if needed... 6. How to access an ACL stored in a mailbox backend from a subclass of org.apache.james.imap.processor.AbstractMailboxProcessor: At the moment I have this code to prepare a response for GETACL IMAP command: MessageManager messageManager = getMailboxManager().getMailbox(buildFullPath(session, mailboxName), mailboxSession); MetaData metaData = messageManager.getMetaData(false, mailboxSession, FetchGroup.NO_COUNT); I have not tested it yet, but principally, it should work. I only wonder at two things with that code: i. org.apache.james.mailbox.MailboxManager.getMailbox(MailboxPath, MailboxSession) It returns a MessageManager rather than a Mailbox. Should it not rather be called getMessageManager? Yeah it should. Its called getMailbox(..) for historic reasons.. I guess we should change it like you suggested.. ii. org.apache.james.mailbox.MessageManager.getMetaData(boolean, MailboxSession, FetchGroup) Javadoc says Gets current meta data for the mailbox. Why is this method in MessageManager and not in MailboxManager? As the info you need to retrieve is depend to the MessageManager you got. Like getting the message count, unseen messages etc.. 7. What and in which order should the GetACLProcessor say after sending the ACL response? i. Should it send also unsolicitedResponses? ii. unsolicitedResponses should be sent before or after okComplete? iii. on MailboxException, we send no() and I wonder what should its HumanReadableText say? iv. is the no() sufficient for all exceptions? What if somebody is asking for ACL of a folder which (a) does not exist or (b) cannot be looked up by the current user? Isn't taggedBad more suitable for (a) and/or (b)? I will need to review the RFC for this to answer.. Here is what I have now: @Override protected void doProcess(GetACLRequest message, ImapSession session, String tag, ImapCommand command, Responder responder) { final MailboxManager mailboxManager = getMailboxManager(); final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session); try { String mailboxName = message.getMailboxName(); MessageManager messageManager = mailboxManager.getMailbox(buildFullPath(session, mailboxName), mailboxSession); MetaData metaData = messageManager.getMetaData(false, mailboxSession, FetchGroup.NO_COUNT); ACLResponse aclResponse = new ACLResponse(mailboxName, metaData.getACL()); responder.respond(aclResponse); okComplete(command, tag, responder); //FIXME should we send unsolicited responses here? //unsolicitedResponses(session, responder, false); } catch (MailboxException e) { // FIXME: be more specific in the human readable text. no(command, tag, responder,
svn commit: r1228161 - /james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java
Author: eric Date: Fri Jan 6 13:00:39 2012 New Revision: 1228161 URL: http://svn.apache.org/viewvc?rev=1228161view=rev Log: Temporary workaround to allow james start with spring injection - needs to be fixed later, see TODO (JAMES-1360) Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java?rev=1228161r1=1228160r2=1228161view=diff == --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java Fri Jan 6 13:00:39 2012 @@ -18,6 +18,8 @@ / package org.apache.james.pop3server.core; +import javax.annotation.Resource; + import org.apache.james.protocols.api.Request; import org.apache.james.protocols.api.Response; import org.apache.james.protocols.lib.POP3BeforeSMTPHelper; @@ -29,18 +31,20 @@ import org.apache.james.protocols.pop3.m /** * {@link PassCmdHandler} which also handles POP3 Before SMTP * - * */ public class JamesPassCmdHandler extends PassCmdHandler { -// TODO Check that this constructor is correctly called and can replace the mailboxfactory injection -public JamesPassCmdHandler(MailboxFactory factory) { -super(factory); +// TODO fix me as a final field... +private MailboxFactory factory; + +public JamesPassCmdHandler() { +super(null); +} + +@Resource(name = mailboxfactory) +public void setMailboxFactory(MailboxFactory factory) { +this.factory = factory; } -//@Resource(name = mailboxfactory) -//public void setMailboxFactory(MailboxFactory factory) { -//super.setMailboxFactory(factory); -//} @Override public Response onCommand(POP3Session session, Request request) { @@ -51,5 +55,4 @@ public class JamesPassCmdHandler extends return response; } - } - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228162 - in /james/server/trunk/queue-jms: pom.xml src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
Author: eric Date: Fri Jan 6 13:01:40 2012 New Revision: 1228162 URL: http://svn.apache.org/viewvc?rev=1228162view=rev Log: Fix the mail queuing with org.apache.james.protocols.smtp.MailAddress usage (JAMES-1360) Modified: james/server/trunk/queue-jms/pom.xml james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java Modified: james/server/trunk/queue-jms/pom.xml URL: http://svn.apache.org/viewvc/james/server/trunk/queue-jms/pom.xml?rev=1228162r1=1228161r2=1228162view=diff == --- james/server/trunk/queue-jms/pom.xml (original) +++ james/server/trunk/queue-jms/pom.xml Fri Jan 6 13:01:40 2012 @@ -78,6 +78,10 @@ groupIdorg.apache.geronimo.specs/groupId artifactIdgeronimo-annotation_1.1_spec/artifactId /dependency +dependency +groupIdorg.apache.james.protocols/groupId +artifactIdprotocols-smtp/artifactId +/dependency !-- test dependencies -- dependency Modified: james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java URL: http://svn.apache.org/viewvc/james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java?rev=1228162r1=1228161r2=1228162view=diff == --- james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java (original) +++ james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java Fri Jan 6 13:01:40 2012 @@ -305,7 +305,7 @@ public class JMSMailQueue implements Man StringBuilder recipientsBuilder = new StringBuilder(); -IteratorMailAddress recipients = mail.getRecipients().iterator(); +Iteratororg.apache.james.protocols.smtp.MailAddress recipients = mail.getRecipients().iterator(); while (recipients.hasNext()) { String recipient = recipients.next().toString(); recipientsBuilder.append(recipient.trim()); - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1360) Use protocols 1.6.0-RC2-SNAPSHOT
[ https://issues.apache.org/jira/browse/JAMES-1360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13181288#comment-13181288 ] Eric Charles commented on JAMES-1360: - Committed to trunk and tested (send/read mails works) Still following commit to be reviewed : http://svn.apache.org/viewvc?view=revisionrevision=1228161 Use protocols 1.6.0-RC2-SNAPSHOT Key: JAMES-1360 URL: https://issues.apache.org/jira/browse/JAMES-1360 Project: JAMES Server Issue Type: New Feature Affects Versions: Trunk Reporter: Eric Charles Assignee: Eric Charles Fix For: 3.0-beta4 There are a bunch of API changes between protocols-1.6-beta3 and protocols-1.6.0-RC2-SNAPSHOT. We need to update server code (mainly pop3/imap/smtp server projects) to align to the current protocols implementation. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Re: ACL Support - cont. from server-user
Norman, 8. Interpretation of ACLs: To have ACL stored on every mailbox is far from being able to tell if the given user can perform the given operation for the given mailbox(es when copying/moving). A new service responsible for resolving of ACLs is necessary. I propose to call it MailboxACLResolver. In which package should it be placed? Also in org.apache.james.mailbox? Probably every single operation between IMAP and mailbox stores should pass through this service. Where in the code should such a permission enforcement be placed? How should MailboxACLResolver be instantiated? Yeah mailbox api I think… It should be instanced once and get injected in the constructor. Hmmm... I thought that MailboxACLResolver would offer a method like the following: boolean hasRight(User user, Mailbox mailbox, Right right); But org.apache.james.mailbox.store.mail.model.Mailbox is not visible in in mailbox-store. Should I place MailboxACLResolver to mailbox-store? Or I should rely on org.apache.james.mailbox.MailboxPath rather than Mailbox itself? [MailboxACLResolver] should be instanced once and get injected in the constructor. Which constructor? MessageManager or MailBoxManager or both? Best, Gazda - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Re: ACL Support - cont. from server-user
You should use the MailboxPath for resolve the ACLs. Where you need to inject the resolver depends on the needs. But I guess you need it in both.. Bye Norman Sent from my iPhone. Excuse any typos Am 06.01.2012 um 14:18 schrieb Jochen Gazda gazdahims...@gmail.com: Norman, 8. Interpretation of ACLs: To have ACL stored on every mailbox is far from being able to tell if the given user can perform the given operation for the given mailbox(es when copying/moving). A new service responsible for resolving of ACLs is necessary. I propose to call it MailboxACLResolver. In which package should it be placed? Also in org.apache.james.mailbox? Probably every single operation between IMAP and mailbox stores should pass through this service. Where in the code should such a permission enforcement be placed? How should MailboxACLResolver be instantiated? Yeah mailbox api I think… It should be instanced once and get injected in the constructor. Hmmm... I thought that MailboxACLResolver would offer a method like the following: boolean hasRight(User user, Mailbox mailbox, Right right); But org.apache.james.mailbox.store.mail.model.Mailbox is not visible in in mailbox-store. Should I place MailboxACLResolver to mailbox-store? Or I should rely on org.apache.james.mailbox.MailboxPath rather than Mailbox itself? [MailboxACLResolver] should be instanced once and get injected in the constructor. Which constructor? MessageManager or MailBoxManager or both? Best, Gazda - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Subject line encrypted
Hi Team, My understanding is when we are sending email during the transport the email is Encrypted and also the Subject line. Can you please confirm me if my understanding is correct? If not is there any configuration that I need to set to make the transport more secured. Thank you, Sai
Re: Server modules Naming/Grouping
If no negative feedback, I will start implementing the nested structure based on Stefano proposal this weekend. Thx, Eric On 06/01/12 06:32, Eric Charles wrote: Hi Stefano, Yes, I remember the work you did analysing the modules in that jira. I find the grouping in the jira not far away from the groups I defined. The key points here are: - Do we go to a 2 level structure ? (I would do it) - Even if those groups are not usable as standalone alone component, they can tend to. I don't care if a module depends on another module, but they should be deployable without a full james sever. If we group, we can smoothly tend to that. Thx, Eric On 05/01/12 19:40, Stefano Bagnara wrote: 2012/1/5 Eric Charlese...@apache.org: Hi there, Doing recent protocols trunk integration in server, it became clear to me that our server components can be grouped together to form coherent subcomponents (even usable outside James mail server, but that's another story). Please, read my comment to this issue from the last year (and maybe the other comments to that issue too): https://issues.apache.org/jira/browse/JAMES-1184?focusedCommentId=12983893page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12983893 As you can see my grouping proposal is opposite to your ;-) I never pushed the grouping idea after that comment because I felt it was not really necessary, yet. If you try to write dependency lines between the modules and the groups you will understand why. Here is an old graph I used when I made that proposal: https://issues.apache.org/jira/secure/attachment/12468787/graph-server.gif Using other words: the modules you are grouping are not really usable alone as on the library/function level they have twisted dependencies with other groups. Stefano btw, Recent Apache Hadoop mavenization gave birth to 38 modules (James server modules can be considered small compared to these 38, even when counting the mailbox and protocols modules). So here's my first shot (it goes over grouping on name level, not merging!!): Curent list (prefixed with a 'Subcomponent Group') 1 container-spring 2 core (1 class module) 3 dnsservice-api 3 dnsservice-dnsjava 3 dnsservice-library ? fetchmail 4 filesystem-api 5 imapserver 5 lmtpserver 6 data-api 6 data-library 6 hbase 6 jpa 6 jcr 6 jdbc 6 file 4 lifecycle-api 1 lifecycle-spring 7 mailbox-adapter 8 mailetcontainer-api 8 mailetcontainer-camel 8 mailets 5 protocols-library 5 pop3server 5 smtpserver 9 queue-api 9 queue-file 9 queue-jms 9 queue-activemq 5 ldap 2 util 2 cli Subcomponent Group Naming 1 container 2 util 3 dns 4 api 5 data 6 socket 7 adapter 8 mailet 9 queue Let's talk about it. (for the implementation, 2 options are possible : with or without subparent) Thx, Eric -- eric | http://about.echarles.net | @echarles - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org -- eric | http://about.echarles.net | @echarles - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Re: ACL Support - cont. from server-user
@Eric: I think Jochen should just code in the imap trunk for now.. We will merge it later then. As the code in protocols need many more work :/ Bye, Norman -- Norman Maurer Am Freitag, 6. Januar 2012 um 18:34 schrieb Eric Charles: As a side note, we are moving IMAP code from https://svn.apache.org/repos/asf/james/imap/trunk/ to https://svn.apache.org/repos/asf/james/protocols/trunk/imap/ I would be better that you code in the latter. Thx, Eric On 06/01/12 12:25, Jochen Gazda wrote: Gentlemen, Please read and comment. I have started to implement the ACL support. In the very first phase I would like to - add support for IMAP GETACL command and - add support for storing ACL at least for one storage backend. During this first phase I would like to learn how to do things in a James-compiliant way so that I will be able to implement other ACL commands later. 1. A new interface org.apache.james.mailbox.MailboxACL and default implementation org.apache.james.mailbox.store.SimpleMailboxACL Stores an ACL applicable to a mailbox. Inspired by RFC4314 IMAP4 Access Control List (ACL) Extension. Note: An ACL class that could serve our purpose exists in com.sun.mail.imap. We will not stick to a proprietary API, will we? 2. MailboxACL usage: org.apache.james.mailbox.store.mail.model.MailboxId and implementations will be extended to store the related ACL: MailboxACL getACL(); void setACL(MailboxACL acl); This is probably OK. 3. MailboxACL usage: org.apache.james.mailbox.MessageManager.MetaData will be extended to offer a read access to the ACL of the related mailbox. This was approved by Norman Maurer. MailboxACL getACL(); 4. MailboxACL usage: Under org.apache.james.imap ACL-related requests, decoders, responses, encoders and processors will use MailboxACL. It is probably OK as there is a lot of org.apache.james.mailbox.* usage under org.apache.james.imap. 5. MailboxACL instantiation: Clearly, there will be (at least) two places where MailboxACL will be instantiated: i. In Mailbox implementations when reading ACLs from their backends ii. In org.apache.james.imap decoders when parsing the ACL related IMAP requests. At the moment I have hardcoded a constructor of my default implementation on both places. I am asking myself if some kind of factory pattern should be used instead. 6. How to access an ACL stored in a mailbox backend from a subclass of org.apache.james.imap.processor.AbstractMailboxProcessor: At the moment I have this code to prepare a response for GETACL IMAP command: MessageManager messageManager = getMailboxManager().getMailbox(buildFullPath(session, mailboxName), mailboxSession); MetaData metaData = messageManager.getMetaData(false, mailboxSession, FetchGroup.NO_COUNT); I have not tested it yet, but principally, it should work. I only wonder at two things with that code: i. org.apache.james.mailbox.MailboxManager.getMailbox(MailboxPath, MailboxSession) It returns a MessageManager rather than a Mailbox. Should it not rather be called getMessageManager? ii. org.apache.james.mailbox.MessageManager.getMetaData(boolean, MailboxSession, FetchGroup) Javadoc says Gets current meta data for the mailbox. Why is this method in MessageManager and not in MailboxManager? 7. What and in which order should the GetACLProcessor say after sending the ACL response? i. Should it send also unsolicitedResponses? ii. unsolicitedResponses should be sent before or after okComplete? iii. on MailboxException, we send no() and I wonder what should its HumanReadableText say? iv. is the no() sufficient for all exceptions? What if somebody is asking for ACL of a folder which (a) does not exist or (b) cannot be looked up by the current user? Isn't taggedBad more suitable for (a) and/or (b)? Here is what I have now: @Override protected void doProcess(GetACLRequest message, ImapSession session, String tag, ImapCommand command, Responder responder) { final MailboxManager mailboxManager = getMailboxManager(); final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session); try { String mailboxName = message.getMailboxName(); MessageManager messageManager = mailboxManager.getMailbox(buildFullPath(session, mailboxName), mailboxSession); MetaData metaData = messageManager.getMetaData(false, mailboxSession, FetchGroup.NO_COUNT); ACLResponse aclResponse = new ACLResponse(mailboxName, metaData.getACL()); responder.respond(aclResponse); okComplete(command, tag, responder); //FIXME should we send unsolicited responses here? //unsolicitedResponses(session, responder, false); } catch (MailboxException e) { // FIXME: be more specific in the human readable text. no(command, tag, responder, HumanReadableText.GENERIC_FAILURE_DURING_PROCESSING); } } 8. Interpretation of ACLs:
svn commit: r1228296 - in /james/protocols/trunk: api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTran
Author: norman Date: Fri Jan 6 17:37:05 2012 New Revision: 1228296 URL: http://svn.apache.org/viewvc?rev=1228296view=rev Log: Add optimization for zero-copy when possible Modified: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java Modified: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java?rev=1228296r1=1228295r2=1228296view=diff == --- james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java (original) +++ james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java Fri Jan 6 17:37:05 2012 @@ -222,10 +222,6 @@ public class CommandDispatcherSession e } curCommandName = curCommandName.toUpperCase(Locale.US); -if (session.getLogger().isDebugEnabled()) { -session.getLogger().debug(getClass().getName() + received: + cmdString); -} - BaseRequest request = new BaseRequest(curCommandName, curCommandArgument); return request; Modified: james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java?rev=1228296r1=1228295r2=1228296view=diff == --- james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java (original) +++ james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java Fri Jan 6 17:37:05 2012 @@ -19,17 +19,23 @@ package org.apache.james.protocols.netty; +import java.io.FileInputStream; +import java.io.IOException; import java.io.InputStream; import java.net.InetSocketAddress; +import java.nio.channels.FileChannel; +import java.util.Iterator; import javax.net.ssl.SSLEngine; import org.apache.james.protocols.api.AbstractProtocolTransport; +import org.apache.james.protocols.api.CombinedInputStream; import org.apache.james.protocols.api.ProtocolSession; import org.apache.james.protocols.api.handler.LineHandler; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelFutureListener; +import org.jboss.netty.channel.DefaultFileRegion; import org.jboss.netty.handler.ssl.SslHandler; import org.jboss.netty.handler.stream.ChunkedStream; @@ -135,6 +141,39 @@ public class NettyProtocolTransport exte if (startTLS) { prepareStartTLS(); } +if (!isTLSStarted()) { +if (in instanceof FileInputStream) { +FileChannel fChannel = ((FileInputStream) in).getChannel(); +try { +channel.write(new DefaultFileRegion(fChannel, 0, fChannel.size(), true)); + +} catch (IOException e) { +// We handle this later +channel.write(new ChunkedStream(in)); +} +return; + +} else if (in instanceof CombinedInputStream) { +IteratorInputStream streams = ((CombinedInputStream) in).iterator(); +while(streams.hasNext()) { +InputStream pIn = streams.next(); +if (pIn instanceof FileInputStream) { +FileChannel fChannel = ((FileInputStream) in).getChannel(); +try { +channel.write(new DefaultFileRegion(fChannel, 0, fChannel.size(), true)); +return; + +} catch (IOException e) { +// We handle this later +channel.write(new ChunkedStream(in)); +} +} else { +channel.write(new ChunkedStream(in)); +} +} +return; +} +} channel.write(new ChunkedStream(in)); } - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Created] (JAMES-1361) Delivery to Local Recipient should be allowed without SMTP Auth
Delivery to Local Recipient should be allowed without SMTP Auth --- Key: JAMES-1361 URL: https://issues.apache.org/jira/browse/JAMES-1361 Project: JAMES Server Issue Type: Bug Reporter: Eric Charles -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228297 - /james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java
Author: norman Date: Fri Jan 6 17:40:38 2012 New Revision: 1228297 URL: http://svn.apache.org/viewvc?rev=1228297view=rev Log: Use zero-copy if possible Added: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java Added: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java?rev=1228297view=auto == --- james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java (added) +++ james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java Fri Jan 6 17:40:38 2012 @@ -0,0 +1,80 @@ +/ + * 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.api; + +import java.io.InputStream; +import java.io.SequenceInputStream; +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * {@link SequenceInputStream} sub-class which allows direct access to the pair of {@link InputStream}'s. + * + * When ever you need to combine two {@link InputStream}'s you should use this class as it may allow the Transport to optimize the transfer of it! + * + * + */ +public class CombinedInputStream extends SequenceInputStream implements IterableInputStream{ + +private final InputStream[] streams; + +public CombinedInputStream(InputStream s1, InputStream s2) { +super(s1, s2); +streams = new InputStream[] {s1, s2}; +} + +/* + * (non-Javadoc) + * @see java.lang.Iterable#iterator() + */ +public IteratorInputStream iterator() { +return new IteratorInputStream() { +private int count = 0; + +/* + * (non-Javadoc) + * @see java.util.Iterator#hasNext() + */ +public boolean hasNext() { +return count streams.length; +} + +/* + * (non-Javadoc) + * @see java.util.Iterator#next() + */ +public InputStream next() { +if (hasNext()) { +return streams[count++]; +} else { +throw new NoSuchElementException(); +} +} + +/** + * Read-Only + */ +public void remove() { +throw new UnsupportedOperationException(Read-Only); +} +}; +} + +} - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228298 - /james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
Author: norman Date: Fri Jan 6 17:41:22 2012 New Revision: 1228298 URL: http://svn.apache.org/viewvc?rev=1228298view=rev Log: Fix writing back POP3Response with null argument to client Modified: james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java Modified: james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java?rev=1228298r1=1228297r2=1228298view=diff == --- james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java (original) +++ james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java Fri Jan 6 17:41:22 2012 @@ -71,7 +71,7 @@ public class POP3Response extends Abstra * */ public POP3Response(String code) { -this(code, null); +setRetCode(code); } protected POP3Response() { @@ -85,11 +85,15 @@ public class POP3Response extends Abstra */ public ListCharSequence getLines() { ListCharSequence responseList = new ArrayListCharSequence(); -for (int i = 0; i lines.size(); i++) { -if (i == 0) { -responseList.add(getRetCode() + WS +lines.get(i)); -} else { -responseList.add(lines.get(i)); +if (lines.isEmpty()) { +responseList.add(getRetCode()); +} else { +for (int i = 0; i lines.size(); i++) { +if (i == 0) { +responseList.add(getRetCode() + WS +lines.get(i)); +} else { +responseList.add(lines.get(i)); +} } } return responseList; - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228299 - in /james/protocols/trunk/pop3/src: main/java/org/apache/james/protocols/pop3/core/ test/java/org/apache/james/protocols/pop3/
Author: norman Date: Fri Jan 6 17:42:12 2012 New Revision: 1228299 URL: http://svn.apache.org/viewvc?rev=1228299view=rev Log: Make sure we correctly handle non existing message numbers. Also adding more test cases for this. Added: james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java Modified: james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/RetrCmdHandler.java james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/TopCmdHandler.java james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/UidlCmdHandler.java james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java Modified: james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java?rev=1228299r1=1228298r2=1228299view=diff == --- james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java (original) +++ james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java Fri Jan 6 17:42:12 2012 @@ -55,10 +55,14 @@ public class DeleCmdHandler implements C return SYNTAX_ERROR; } try { -ListMessageMetaData uidList = (ListMessageMetaData) session.getAttachment(POP3Session.UID_LIST, State.Transaction); +MessageMetaData meta = MessageMetaDataUtils.getMetaData(session, num); +if (meta == null) { +StringBuilder responseBuffer = new StringBuilder(64).append(Message ().append(num).append() does not exist.); +return new POP3Response(POP3Response.ERR_RESPONSE, responseBuffer.toString()); +} ListLong deletedUidList = (ListLong) session.getAttachment(POP3Session.DELETED_UID_LIST, State.Transaction); -Long uid = uidList.get(num - 1).getUid(); +Long uid = meta.getUid(); if (deletedUidList.contains(uid)) { StringBuilder responseBuffer = new StringBuilder(64).append(Message ().append(num).append() already deleted.); Modified: james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java?rev=1228299r1=1228298r2=1228299view=diff == --- james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java (original) +++ james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java Fri Jan 6 17:42:12 2012 @@ -87,7 +87,13 @@ public class ListCmdHandler implements C int num = 0; try { num = Integer.parseInt(parameters); -MessageMetaData data = uidList.get(num - 1); + +MessageMetaData data = MessageMetaDataUtils.getMetaData(session, num); +if (data == null) { +StringBuilder responseBuffer = new StringBuilder(64).append(Message ().append(num).append() does not exist.); +return new POP3Response(POP3Response.ERR_RESPONSE, responseBuffer.toString()); +} + if (deletedUidList.contains(data.getUid()) == false) { StringBuilder responseBuffer = new StringBuilder(64).append(num).append( ).append(data.getSize()); Added: james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java?rev=1228299view=auto == --- james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java (added) +++ james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java Fri Jan 6 17:42:12 2012 @@ -0,0 +1,47 @@ +/ + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional
Re: ACL Support - cont. from server-user
If protocols-imap is gonna move soon, then https://svn.apache.org/repos/asf/james/imap/trunk/ will be better yes. Eric On 06/01/12 18:36, Norman Maurer wrote: @Eric: I think Jochen should just code in the imap trunk for now.. We will merge it later then. As the code in protocols need many more work :/ Bye, Norman -- eric | http://about.echarles.net | @echarles - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Created] (HUPA-81) Fix emma-maven-plugin which gives compilation exception
Fix emma-maven-plugin which gives compilation exception --- Key: HUPA-81 URL: https://issues.apache.org/jira/browse/HUPA-81 Project: JAMES Hupa Issue Type: Bug Reporter: Eric Charles Assignee: Eric Charles Invoking maven build gives [INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. [INFO][ERROR] Errors in 'file:/Users/echarles/dev/apache-james/current/hupa/client/src/main/java/org/apache/hupa/client/Hupa.java' [INFO] [ERROR] Internal compiler error [INFO] java.lang.NoClassDefFoundError: com/vladium/emma/rt/RT [INFO] at org.apache.hupa.client.gin.HupaClientModule.$VRi(HupaClientModule.java) To quickly solve this, the emma maven plugin will be commented. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228363 - /james/hupa/trunk/pom.xml
Author: eric Date: Fri Jan 6 19:39:22 2012 New Revision: 1228363 URL: http://svn.apache.org/viewvc?rev=1228363view=rev Log: Comment emma-maven-plugin which gives compilation exception (HUPA-81) Modified: james/hupa/trunk/pom.xml Modified: james/hupa/trunk/pom.xml URL: http://svn.apache.org/viewvc/james/hupa/trunk/pom.xml?rev=1228363r1=1228362r2=1228363view=diff == --- james/hupa/trunk/pom.xml (original) +++ james/hupa/trunk/pom.xml Fri Jan 6 19:39:22 2012 @@ -379,19 +379,20 @@ /plugins /pluginManagement plugins -plugin -groupIdorg.codehaus.mojo/groupId -artifactIdemma-maven-plugin/artifactId -inheritedtrue/inherited -executions -execution -phaseprocess-classes/phase -goals -goalinstrument/goal -/goals -/execution -/executions -/plugin +!-- See https://issues.apache.org/jira/browse/HUPA-81 -- +!-- plugin -- +!-- groupIdorg.codehaus.mojo/groupId -- +!-- artifactIdemma-maven-plugin/artifactId -- +!-- inheritedtrue/inherited -- +!-- executions -- +!-- execution -- +!-- phaseprocess-classes/phase-- +!-- goals -- +!-- goalinstrument/goal -- +!-- /goals -- +!-- /execution -- +!-- /executions -- +!-- /plugin -- /plugins /build /project - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1228369 - /james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeSMTPSession.java
Author: eric Date: Fri Jan 6 19:48:04 2012 New Revision: 1228369 URL: http://svn.apache.org/viewvc?rev=1228369view=rev Log: Implement getRemoteAddress in BaseFakeSMTPSession to make test success (JAMES-1360) Modified: james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeSMTPSession.java Modified: james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeSMTPSession.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeSMTPSession.java?rev=1228369r1=1228368r2=1228369view=diff == --- james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeSMTPSession.java (original) +++ james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeSMTPSession.java Fri Jan 6 19:48:04 2012 @@ -29,8 +29,6 @@ import java.util.Map; import org.apache.james.protocols.api.Response; import org.apache.james.protocols.api.handler.LineHandler; import org.apache.james.protocols.api.logger.Logger; -import org.apache.james.protocols.smtp.SMTPConfiguration; -import org.apache.james.protocols.smtp.SMTPSession; /** * Abstract class to simplify the mocks @@ -179,8 +177,7 @@ public class BaseFakeSMTPSession impleme * @see org.apache.james.protocols.api.ProtocolSession#getRemoteAddress() */ public InetSocketAddress getRemoteAddress() { -throw new UnsupportedOperationException(Unimplemented Stub Method); - +return new InetSocketAddress(localhost, 22); } /* @@ -189,7 +186,6 @@ public class BaseFakeSMTPSession impleme */ public InetSocketAddress getLocalAddress() { throw new UnsupportedOperationException(Unimplemented Stub Method); - } /* - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Re: [jsieve] Is anyone looking at this at the moment?
Hi Robert Sorry for the tawdry reply, though I did enjoy my holiday season downtime. Wishing you a Happy New Year and I hope your recuperation from the injury is complete. Thanks for all of the work you have put into jSieve. Due to your efforts it is almost time for a full release. There may be a few minor tweaks required to enhance its capability to interoperate with ManageSieve (RFC 5804), principally advertising its capabilities, but this should not forestall a release. We can add them later. I'm working on a modular implementation of ManageSieve. The RFC conflates the transport mechanism with the application logic. Pluggable modules circumvent this by allowing any implemented transport mechanism to be plugged in and interact with the application logic module. The application logic module interacts with a pluggable repository to store and retrieve scripts and state. One day, your LocalDelivery mailet modifications will be updated to get the active script for the user from the configured ManageSieve implementation. You say that I would like to be able to maintain using HTTP. An application deployed on a HTTP server (such as a Servlet) could interact with a ManageSieve implementation using the RFC defined transport protocols. If you have the time and the inclination, let me know. Cheers --Steve On 23/12/2011 13:37, Robert Burrell Donkin wrote: On Sun, Dec 18, 2011 at 8:29 PM, Stefano Bagnaraapa...@bago.org wrote: 2011/12/13 Steve Brewinsbre...@synsys.com: Hi Is anyone actively working on jSieve at the moment? Not since University then injury limited my typing time... AFAIK, jsieve is used by Zimbra in a non-Avalon environment. I never looked at how they use jSieve, but it worked for them. JSieve works well for me, and a release is probably due... I suspect not as the code in trunk has a hard coded path that is relative to how things would be in an Avalon deployment - ..apps/james/var/sieve, so scripts will never be found (unless you read the source code to org.apache.james.transport.mailets.ResourceLocatorImpl) and create the appropriate fie structure. ResourceLocator is not really jSieve but a James Server implementation or the ResourceLocator needed by jSieve and used by the jSieve based Sieve mailet. +1 IMHO though the mailet works well enough, the mailet binding needs some TLC and would benefit from reworking. To be fair, there is a code comment that This is a toy implementation. To at least keep this working are there any objections to my changing the relative path to ../sieve. On a *nix platform I would expect this to be mapped to a subdirectory of /var, but we don't need to enforce this in the code base. Having everything under a single root directory improves portability but in general, I agree that hard coding is bad. Please feel free to dive in and change it. It's been a long since I looked at james sources, but I guess the right way would be to use the FileSystem service we already use elsewhere (there is even a TODO in the javadocs for that ResourceLocatorImpl about this). For reference BayesianAnalysis is another mailet that uses the FileSystem service. (One day I would like to be able to maintain using HTTP, so that was the direction the code was heading in.) Please feel free to dive in and change it. Robert - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org - - - - - - - - - - - - - - - - - - This private and confidential e-mail has been sent to you by Synergy Systems Limited. It may not represent the views of Synergy Systems Limited. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with received in error as the subject and then delete it from your mailbox. - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Re: [jsieve] Is anyone looking at this at the moment?
On Fri, Jan 6, 2012 at 7:55 PM, Steve Brewin sbre...@synsys.com wrote: Hi Robert Hi Steve Sorry for the tawdry reply, though I did enjoy my holiday season downtime. Wishing you a Happy New Year and I hope your recuperation from the injury is complete. (Good to hear from you again, and thanks for your good wishes. I expect to continue physiotherapy long term but I now have over 9 hours a day computer time and no functional impairment which is great :-) Thanks for all of the work you have put into jSieve. Due to your efforts it is almost time for a full release. There may be a few minor tweaks required to enhance its capability to interoperate with ManageSieve (RFC 5804), principally advertising its capabilities, but this should not forestall a release. We can add them later. +1 I'm working on a modular implementation of ManageSieve. The RFC conflates the transport mechanism with the application logic. Pluggable modules circumvent this by allowing any implemented transport mechanism to be plugged in and interact with the application logic module. The application logic module interacts with a pluggable repository to store and retrieve scripts and state. Great One day, your LocalDelivery mailet modifications will be updated to get the active script for the user from the configured ManageSieve implementation. You say that I would like to be able to maintain using HTTP. An application deployed on a HTTP server (such as a Servlet) could interact with a ManageSieve implementation using the RFC defined transport protocols. The mailet side needs a major reworking (as you've probably worked out). I have training material to prepare this weekend but please carry on posting your comments and I'll catch up later... Robert - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org