You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by do...@apache.org on 2001/04/19 06:07:44 UTC

cvs commit: jakarta-james/src/org/apache/mailet GenericMailet.java GenericMatcher.java GenericRecipientMatcher.java Mail.java MailAddress.java Mailet.java MailetConfig.java MailetContext.java MailetException.java Matcher.java MatcherConfig.java

donaldp     01/04/18 21:07:44

  Modified:    lib      avalonapi.jar cornerstone.bar phoenix-client.jar
                        phoenix-engine.jar phoenix-loader.jar
               src/org/apache/james AccessControlException.java
                        AuthenticationException.java
                        AuthorizationException.java James.java
               src/org/apache/james/core AvalonMailStore.java
                        AvalonUsersStore.java EnhancedMimeMessage.java
                        MailImpl.java MailetConfigImpl.java
                        MatcherConfigImpl.java
               src/org/apache/james/dnsserver DNSServer.java
               src/org/apache/james/imapserver ACLMailbox.java
                        BaseCommand.java CommandFetch.java FileMailbox.java
                        Host.java IMAPSystem.java ImapRequest.java
                        JamesHost.java Mailbox.java
                        MailboxEventListener.java MessageHeader.java
                        SimpleSystem.java
                        SingleThreadedConnectionHandler.java
               src/org/apache/james/mailrepository
                        AvalonMailRepository.java TownSpoolRepository.java
               src/org/apache/james/nntpserver ArticleWriter.java
                        AuthState.java LISTGroup.java NNTPHandler.java
                        NNTPServer.java
               src/org/apache/james/nntpserver/repository
                        NNTPRepository.java NNTPRepositoryImpl.java
                        NNTPSpooler.java NNTPUtil.java
               src/org/apache/james/pop3server POP3Handler.java
               src/org/apache/james/remotemanager RemoteManagerHandler.java
               src/org/apache/james/smtpserver MessageSizeException.java
                        SMTPHandler.java SizeLimitedInputStream.java
                        SizeLimitedSMTPHandler.java
               src/org/apache/james/transport JamesSpoolManager.java
                        LinearProcessor.java MailetLoader.java
                        MatchLoader.java Resources.java
               src/org/apache/james/transport/mailets AvalonListserv.java
                        AvalonListservManager.java
                        ExceptionThrowingMailet.java Forward.java
                        GenericListserv.java GenericListservManager.java
                        Identity.java LocalDelivery.java
                        NotifyPostmaster.java NotifySender.java Null.java
                        PostmasterAlias.java RemoteDelivery.java
                        ServerTime.java ToProcessor.java ToRepository.java
                        TownAlias.java TownListserv.java
                        UseHeaderRecipients.java
               src/org/apache/james/transport/matchers All.java
                        CommandForListserv.java HostIs.java
                        HostIsLocal.java InSpammerBlacklist.java
                        IsSingleRecipient.java RecipientIs.java
                        RecipientIsLocal.java RelayLimit.java
                        RemoteAddrInNetwork.java
                        RemoteAddrNotInNetwork.java SenderInFakeDomain.java
                        SenderIs.java SubjectIs.java SubjectStartsWith.java
                        UserIs.java
               src/org/apache/james/userrepository UsersFileRepository.java
                        UsersLDAPRepository.java UsersTownRepository.java
               src/org/apache/james/util CharTerminatedInputStream.java
                        InternetPrintWriter.java Lock.java
                        LockException.java RFC822DateFormat.java
               src/org/apache/mailet GenericMailet.java GenericMatcher.java
                        GenericRecipientMatcher.java Mail.java
                        MailAddress.java Mailet.java MailetConfig.java
                        MailetContext.java MailetException.java
                        Matcher.java MatcherConfig.java
  Log:
  Update to latest AvalonApi.
  
  Revision  Changes    Path
  1.11      +364 -357  jakarta-james/lib/avalonapi.jar
  
  	<<Binary file>>
  
  
  1.10      +181 -179  jakarta-james/lib/cornerstone.bar
  
  	<<Binary file>>
  
  
  1.5       +15 -22    jakarta-james/lib/phoenix-client.jar
  
  	<<Binary file>>
  
  
  1.5       +218 -212  jakarta-james/lib/phoenix-engine.jar
  
  	<<Binary file>>
  
  
  1.5       +12 -12    jakarta-james/lib/phoenix-loader.jar
  
  	<<Binary file>>
  
  
  1.2       +9 -14     jakarta-james/src/org/apache/james/AccessControlException.java
  
  Index: AccessControlException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/AccessControlException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AccessControlException.java	2001/01/15 12:55:26	1.1
  +++ AccessControlException.java	2001/04/19 04:06:30	1.2
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james;
   
   /**
  @@ -15,10 +14,9 @@
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version 0.1  on 14 Dec 2000
    */
  -public class AccessControlException extends Exception {
  -
  +public class AccessControlException 
  +    extends Exception {
   
  -
       /**
        * Construct a new <code>AccessControlException</code> instance.
        *
  @@ -27,7 +25,4 @@
       public AccessControlException(String message) {
           super(message);
       }
  -
  -
  - 
   }
  
  
  
  1.2       +16 -16    jakarta-james/src/org/apache/james/AuthenticationException.java
  
  Index: AuthenticationException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/AuthenticationException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AuthenticationException.java	2001/01/15 12:55:26	1.1
  +++ AuthenticationException.java	2001/04/19 04:06:31	1.2
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james;
   
   /**
  @@ -15,7 +14,8 @@
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version 0.1 on 14 Dec 2000
    */
  -public class AuthenticationException extends Exception {
  +public class AuthenticationException 
  +    extends Exception {
   
       private boolean userNotKnown;
       private boolean badCredentials;
  @@ -25,19 +25,19 @@
        *
        * @param message The detail message for this exception (mandatory).
        */
  -    public AuthenticationException(String message, boolean unknownUser,
  -				   boolean credentialsFailed) {
  +    public AuthenticationException( final String message, 
  +                                    final boolean unknownUser,
  +                                    final boolean credentialsFailed ) {
           super(message);
  -	this.userNotKnown = unknownUser;
  -	this.badCredentials = credentialsFailed;
  +        this.userNotKnown = unknownUser;
  +        this.badCredentials = credentialsFailed;
       }
   
       public boolean isUserNotKnown() {
  -	return userNotKnown;
  +        return userNotKnown;
       }
   
       public boolean isBadCredentials() {
  -	return badCredentials;
  +        return badCredentials;
       }
  - 
   }
  
  
  
  1.2       +11 -16    jakarta-james/src/org/apache/james/AuthorizationException.java
  
  Index: AuthorizationException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/AuthorizationException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AuthorizationException.java	2001/01/15 12:55:26	1.1
  +++ AuthorizationException.java	2001/04/19 04:06:31	1.2
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james;
   
   /**
  @@ -15,19 +14,15 @@
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version  0.1 on 14 Dec 2000
    */
  -public class AuthorizationException extends Exception {
  -
  +public class AuthorizationException 
  +    extends Exception {
   
  -
       /**
        * Construct a new <code>AuthorizationException</code> instance.
        *
        * @param message The detail message for this exception (mandatory).
        */
  -    public AuthorizationException(String message) {
  -        super(message);
  +    public AuthorizationException( final String message ) {
  +        super( message );
       }
  -
  -
  - 
   }
  
  
  
  1.32      +30 -30    jakarta-james/src/org/apache/james/James.java
  
  Index: James.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/James.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- James.java	2001/04/17 03:16:33	1.31
  +++ James.java	2001/04/19 04:06:31	1.32
  @@ -14,28 +14,28 @@
   import javax.mail.MessagingException;
   import javax.mail.Session;
   import javax.mail.internet.*;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.Component;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Context;
  -import org.apache.avalon.Contextualizable;
  -import org.apache.avalon.Contextualizable;
  -import org.apache.avalon.DefaultComponentManager;
  -import org.apache.avalon.DefaultContext;
   import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.Component;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
  +import org.apache.avalon.component.DefaultComponentManager;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
   import org.apache.avalon.configuration.DefaultConfiguration;
  +import org.apache.avalon.context.Context;
  +import org.apache.avalon.context.Contextualizable;
  +import org.apache.avalon.context.Contextualizable;
  +import org.apache.avalon.context.DefaultContext;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.excalibur.thread.ThreadPool;
   import org.apache.james.core.*;
   import org.apache.james.dnsserver.*;
   import org.apache.james.imapserver.*;
  +import org.apache.james.nntpserver.NNTPServer;
   import org.apache.james.pop3server.*;
   import org.apache.james.remotemanager.*;
  -import org.apache.james.nntpserver.NNTPServer;
   import org.apache.james.services.*;
   import org.apache.james.smtpserver.*;
   import org.apache.james.transport.*;
  @@ -52,15 +52,15 @@
    * <br> 2) Handles interactions between components
    * <br> 3) Provides container services for Mailets
    *
  - * @version 
  + * @version
    * @author  Federico Barbieri <sc...@pop.systemy.it>
    * @author Serge
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    */
  -public class James 
  -    extends AbstractLoggable 
  -    implements Block, Contextualizable, Composer, Configurable, Initializable, MailServer, MailetContext {
  -    
  +public class James
  +    extends AbstractLoggable
  +    implements Block, Contextualizable, Composable, Configurable, Initializable, MailServer, MailetContext {
  +
       public final static String VERSION = "James 1.2.2 Alpha";
   
       private DefaultComponentManager compMgr; //Components shared
  @@ -104,7 +104,7 @@
           this.conf = conf;
       }
   
  -    /** 
  +    /**
        * Override compose method of AbstractBlock to create new ComponentManager object
        */
       public void compose(ComponentManager comp) {
  @@ -133,14 +133,14 @@
           }
           getLogger().debug("Using UsersStore: " + usersStore.toString());
           context = new DefaultContext();
  -        
  +
           try {
               hostName = InetAddress.getLocalHost().getHostName();
           } catch  (UnknownHostException ue) {
               hostName = "localhost";
           }
           getLogger().info("Local host is: " + hostName);
  -        
  +
   
           helloName = null;
           Configuration helloConf = conf.getChild("helloName");
  @@ -161,7 +161,7 @@
               serverNames.add(hostName);
           }
   
  -        final Configuration[] serverNameConfs = 
  +        final Configuration[] serverNameConfs =
               conf.getChild( "servernames" ).getChildren( "servername" );
           for ( int i = 0; i < serverNameConfs.length; i++ )
           {
  @@ -170,7 +170,7 @@
           if (serverNames.isEmpty()) {
               throw new ConfigurationException( "Fatal configuration error: no servernames specified!");
           }
  -        
  +
           for (Iterator i = serverNames.iterator(); i.hasNext(); ) {
               getLogger().info("Handling mail for: " + i.next());
           }
  @@ -180,7 +180,7 @@
           // Get postmaster
           String postmaster = conf.getChild("postmaster").getValue("root@localhost");
           context.put(Constants.POSTMASTER, new MailAddress(postmaster));
  -        
  +
           // Get services to provide
           Configuration services = conf.getChild("services");
           if (services.getAttribute("SMTP").equals("TRUE")) {
  @@ -213,7 +213,7 @@
           //}
           compMgr.put("org.apache.james.services.UsersRepository", (Component)localusers);
           getLogger().info("Local users repository opened");
  -      
  +
           // Get storage system
           if (conf.getChild("storage").getValue().equals("IMAP")) {
               useIMAPstorage = true;
  @@ -280,8 +280,8 @@
           }
           getLogger().info("Private SpoolRepository Spool opened");
           compMgr.put("org.apache.james.services.SpoolRepository", (Component)spool);
  +
   
  -   
           POP3Server pop3Server = null;
           if (providePOP3) {
               pop3Server = new POP3Server();
  @@ -401,8 +401,8 @@
   
           getLogger().info("JAMES ...init end");
       }
  -    
   
  +
       public void sendMail(MimeMessage message) throws MessagingException {
           MailAddress sender = new MailAddress((InternetAddress)message.getFrom()[0]);
           Collection recipients = new HashSet();
  @@ -432,7 +432,7 @@
   
       public synchronized void sendMail(MailAddress sender, Collection recipients, InputStream msg)
           throws MessagingException {
  -        
  +
           // parse headers
           MailHeaders headers = new MailHeaders(msg);
           // if headers do not contains minimum REQUIRED headers fields throw Exception
  @@ -443,8 +443,8 @@
           ByteArrayInputStream headersIn = new ByteArrayInputStream(headers.toByteArray());
           sendMail(new MailImpl(getId(), sender, recipients, new SequenceInputStream(headersIn, msg)));
       }
  -    
   
  +
       public synchronized void sendMail(Mail mail) throws MessagingException {
           MailImpl mailimpl = (MailImpl)mail;
           try {
  @@ -465,9 +465,9 @@
       public synchronized MailRepository getUserInbox(String userName) {
   
           MailRepository userInbox = (MailRepository) null;
  -        
  +
           userInbox = (MailRepository) mailboxes.get(userName);
  -       
  +
           if (userInbox != null) {
               return userInbox;
           } else if (mailboxes.containsKey(userName)) {
  @@ -511,7 +511,7 @@
           DNSServer dnsServer = null;
           try {
               dnsServer = (DNSServer) compMgr.lookup("DNS_SERVER");
  -        } catch ( final ComponentManagerException cme ) {
  +        } catch ( final ComponentException cme ) {
               getLogger().error("Fatal configuration error - DNS Servers lost!", cme );
               throw new RuntimeException("Fatal configuration error - DNS Servers lost!");
           }
  
  
  
  1.7       +32 -32    jakarta-james/src/org/apache/james/core/AvalonMailStore.java
  
  Index: AvalonMailStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/AvalonMailStore.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AvalonMailStore.java	2001/04/05 15:09:36	1.6
  +++ AvalonMailStore.java	2001/04/19 04:06:34	1.7
  @@ -11,17 +11,17 @@
   import java.net.URL;
   import java.util.HashMap;
   import java.util.Iterator;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.Component;
  -import org.apache.avalon.ComponentNotAccessibleException;
  -import org.apache.avalon.ComponentNotFoundException;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.ComponentManager;
  +import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.Component;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.avalon.Initializable;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.james.services.MailRepository;
   import org.apache.james.services.MailStore;
   import org.apache.log.LogKit;
  @@ -32,9 +32,9 @@
    *
    * @author <a href="mailto:fede@apache.org">Federico Barbieri</a>
    */
  -public class AvalonMailStore 
  -    extends AbstractLoggable 
  -    implements Block, Composer, Configurable, MailStore, Initializable {
  +public class AvalonMailStore
  +    extends AbstractLoggable
  +    implements Block, Composable, Configurable, MailStore, Initializable {
   
       private static final String REPOSITORY_NAME = "Repository";
       private static long id;
  @@ -45,7 +45,7 @@
       protected ComponentManager       componentManager;
   
       public void compose( final ComponentManager componentManager )
  -        throws ComponentManagerException
  +        throws ComponentException
       {
           this.componentManager = componentManager;
       }
  @@ -55,10 +55,10 @@
       {
           this.configuration = configuration;
       }
  -    
  -    public void init() 
  +
  +    public void init()
           throws Exception {
  -    
  +
           getLogger().info("JamesMailStore init...");
           repositories = new HashMap();
           models = new HashMap();
  @@ -71,9 +71,9 @@
           }
           getLogger().info("James RepositoryManager ...init");
       }
  -    
  +
       public void registerRepository(Configuration repConf)
  -            throws ConfigurationException {
  +        throws ConfigurationException {
           String className = repConf.getAttribute("class");
           getLogger().info("Registering Repository " + className);
           Configuration[] protocols
  @@ -103,23 +103,23 @@
       public void release(Component component)
       {
       }
  +
  +    public Component select(Object hint) throws ComponentException,
  +    ComponentException {
   
  -    public Component select(Object hint) throws ComponentNotFoundException,
  -        ComponentNotAccessibleException {
  -        
           Configuration repConf = null;
           try {
               repConf = (Configuration) hint;
           } catch (ClassCastException cce) {
  -            throw new ComponentNotAccessibleException("hint is of the wrong type. Must be a Configuration", cce);
  +            throw new ComponentException("hint is of the wrong type. Must be a Configuration", cce);
           }
           URL destination = null;
           try {
               destination = new URL(repConf.getAttribute("destinationURL"));
           } catch (ConfigurationException ce) {
  -            throw new ComponentNotAccessibleException("Malformed configuration has no destinationURL attribute", ce);
  +            throw new ComponentException("Malformed configuration has no destinationURL attribute", ce);
           } catch (MalformedURLException mue) {
  -            throw new ComponentNotAccessibleException("destination is malformed. Must be a valid URL", mue);
  +            throw new ComponentException("destination is malformed. Must be a valid URL", mue);
           }
   
           try
  @@ -132,13 +132,13 @@
                   if (models.get(repID).equals(model)) {
                       return (Component)reply;
                   } else {
  -                    throw new ComponentNotFoundException("There is already another repository with the same destination and type but with different model");
  +                    throw new ComponentException("There is already another repository with the same destination and type but with different model");
                   }
               } else {
                   String protocol = destination.getProtocol();
                   String repClass = (String) classes.get( protocol + type + model );
   
  -                getLogger().debug( "Need instance of " + repClass + 
  +                getLogger().debug( "Need instance of " + repClass +
                                      " to handle: " + protocol + type + model );
   
                   try {
  @@ -146,8 +146,8 @@
                       if (reply instanceof Configurable) {
                           ((Configurable) reply).configure(repConf);
                       }
  -                    if (reply instanceof Composer) {
  -                        ((Composer) reply).compose( componentManager );
  +                    if (reply instanceof Composable) {
  +                        ((Composable) reply).compose( componentManager );
                       }
   /*                if (reply instanceof Contextualizable) {
                     ((Contextualizable) reply).contextualize(context);
  @@ -157,22 +157,22 @@
                       }
                       repositories.put(repID, reply);
                       models.put(repID, model);
  -                    getLogger().info( "New instance of " + repClass + 
  +                    getLogger().info( "New instance of " + repClass +
                                         " created for " + destination );
                       return (Component)reply;
                   } catch (Exception e) {
                       getLogger().warn( "Exception while creating repository:" +
                                         e.getMessage(), e );
   
  -                    throw new 
  -                        ComponentNotAccessibleException( "Cannot find or init repository", e );
  +                    throw new
  +                        ComponentException( "Cannot find or init repository", e );
                   }
               }
           } catch( final ConfigurationException ce ) {
  -            throw new ComponentNotAccessibleException( "Malformed configuration", ce );
  +            throw new ComponentException( "Malformed configuration", ce );
           }
       }
  -        
  +
       public static final String getName() {
           return REPOSITORY_NAME + id++;
       }
  
  
  
  1.8       +16 -16    jakarta-james/src/org/apache/james/core/AvalonUsersStore.java
  
  Index: AvalonUsersStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/AvalonUsersStore.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AvalonUsersStore.java	2001/03/13 22:08:48	1.7
  +++ AvalonUsersStore.java	2001/04/19 04:06:34	1.8
  @@ -11,15 +11,15 @@
   import java.net.URL;
   import java.util.HashMap;
   import java.util.Iterator;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.Component;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  +import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.Component;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.avalon.Initializable;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.james.services.UsersRepository;
   import org.apache.james.services.UsersStore;
   import org.apache.phoenix.Block;
  @@ -28,9 +28,9 @@
    *
    * @author <a href="mailto:fede@apache.org">Federico Barbieri</a>
    */
  -public class AvalonUsersStore 
  -    extends AbstractLoggable 
  -    implements Block, Composer, Configurable, UsersStore, Initializable {
  +public class AvalonUsersStore
  +    extends AbstractLoggable
  +    implements Block, Composable, Configurable, UsersStore, Initializable {
   
       private HashMap repositories;
       protected Configuration          configuration;
  @@ -42,16 +42,16 @@
       }
   
       public void compose( final ComponentManager componentManager )
  -        throws ComponentManagerException {
  +        throws ComponentException {
           this.componentManager = componentManager;
       }
  -      
  -    public void init() 
  +
  +    public void init()
           throws Exception {
   
           getLogger().info("AvalonUsersStore init...");
           repositories = new HashMap();
  -     
  +
           Configuration[] repConfs = configuration.getChildren("repository");
           for ( int i = 0; i < repConfs.length; i++ )
           {
  @@ -63,8 +63,8 @@
   
               setupLogger((Component)rep);
   
  -            if (rep instanceof Composer) {
  -                ((Composer) rep).compose( componentManager );
  +            if (rep instanceof Composable) {
  +                ((Composable) rep).compose( componentManager );
               }
   
               if (rep instanceof Configurable) {
  @@ -83,7 +83,7 @@
           }
           getLogger().info("AvalonUsersStore ...init");
       }
  -    
  +
   
       public UsersRepository getRepository(String request) {
           UsersRepository response = (UsersRepository) repositories.get(request);
  
  
  
  1.2       +41 -45    jakarta-james/src/org/apache/james/core/EnhancedMimeMessage.java
  
  Index: EnhancedMimeMessage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/EnhancedMimeMessage.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EnhancedMimeMessage.java	2001/01/09 12:21:23	1.1
  +++ EnhancedMimeMessage.java	2001/04/19 04:06:34	1.2
  @@ -14,16 +14,16 @@
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version 0.1  on 14 Dec 2000
    */
  -public class EnhancedMimeMessage extends MimeMessage {
  -  
  +public class EnhancedMimeMessage 
  +    extends MimeMessage {
   
       public EnhancedMimeMessage(Session session, InputStream in)
  -	throws MessagingException {
  +        throws MessagingException {
           super(session, in);
       }
   
       public  EnhancedMimeMessage(MimeMessage message)
  -	throws MessagingException {
  +        throws MessagingException {
           super(message);
       }
   
  @@ -34,24 +34,24 @@
        * to avoid memory hogging.
        */
       public int getLineCount() throws MessagingException {
  -	if (content == null) {
  -	    return -1;
  -	}
  -	int size = content.length; // size of byte array
  -	int lineCount = 0;
  -	if (size < 5000) {
  -	    for (int i=0; i < size -2; i++) {
  -		if (content[i] == '\r' && content[i+1] == '\n') {
  -		    lineCount++;
  -		}
  -	    }
  -	    if (content[size -2] != '\r' || content[size-1] != '\n') {
  -		//message has a non-empty final line.
  -		lineCount++;
  -	    }
  -	} else {
  -	    lineCount = -1;
  -	}
  +        if (content == null) {
  +            return -1;
  +        }
  +        int size = content.length; // size of byte array
  +        int lineCount = 0;
  +        if (size < 5000) {
  +            for (int i=0; i < size -2; i++) {
  +                if (content[i] == '\r' && content[i+1] == '\n') {
  +                    lineCount++;
  +                }
  +            }
  +            if (content[size -2] != '\r' || content[size-1] != '\n') {
  +                //message has a non-empty final line.
  +                lineCount++;
  +            }
  +        } else {
  +            lineCount = -1;
  +        }
           return lineCount;
       }
   
  @@ -60,18 +60,18 @@
        * Writes content only, ie not headers, to the specified outputstream.
        */
       public void writeContentTo(OutputStream outs)
  -	throws java.io.IOException, MessagingException {
  -	int size = content.length; // size of byte array
  -	int chunk = 1000; //arbitrary choice - ideas welcome
  -	int pointer = 0;
  -	while (pointer < size) {
  -	    if ((size - pointer) > chunk) {
  -		outs.write(content, pointer, chunk);
  -	    } else {
  -		outs.write(content, pointer, size-pointer);
  -	    }
  -	    pointer += chunk;
  -	}
  +        throws java.io.IOException, MessagingException {
  +        int size = content.length; // size of byte array
  +        int chunk = 1000; //arbitrary choice - ideas welcome
  +        int pointer = 0;
  +        while (pointer < size) {
  +            if ((size - pointer) > chunk) {
  +                outs.write(content, pointer, chunk);
  +            } else {
  +                outs.write(content, pointer, size-pointer);
  +            }
  +            pointer += chunk;
  +        }
       }
   
       /**
  @@ -80,16 +80,12 @@
        * in the internal content byte array.
        */
       public int getMessageSize() throws MessagingException {
  -	int contentSize = content.length;
  -	int headerSize = 0;
  -	Enumeration e = getAllHeaderLines();
  -	while (e.hasMoreElements()) {
  -	    headerSize += ((String)e.nextElement()).length();
  -	}
  -	return headerSize + contentSize;
  +        int contentSize = content.length;
  +        int headerSize = 0;
  +        Enumeration e = getAllHeaderLines();
  +        while (e.hasMoreElements()) {
  +            headerSize += ((String)e.nextElement()).length();
  +        }
  +        return headerSize + contentSize;
       }
  -
  -
   }
  -
  -
  
  
  
  1.10      +7 -8      jakarta-james/src/org/apache/james/core/MailImpl.java
  
  Index: MailImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/MailImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MailImpl.java	2001/01/09 12:21:23	1.9
  +++ MailImpl.java	2001/04/19 04:06:35	1.10
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.core;
   
   import java.io.*;
  
  
  
  1.5       +23 -24    jakarta-james/src/org/apache/james/core/MailetConfigImpl.java
  
  Index: MailetConfigImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/MailetConfigImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MailetConfigImpl.java	2001/03/05 15:14:23	1.4
  +++ MailetConfigImpl.java	2001/04/19 04:06:35	1.5
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.core;
   
   import java.io.*;
  @@ -13,9 +12,9 @@
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import org.apache.mailet.*;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.mailet.*;
   
   /**
    *
  @@ -34,25 +33,25 @@
       }
   
       public String getInitParameter(String name) {
  -	try {
  -	    String result = null;
  +        try {
  +            String result = null;
   
               final Configuration[] values = configuration.getChildren( name );
               for ( int i = 0; i < values.length; i++ )
               {
  -		if (result == null) {
  -		    result = "";
  -		} else {
  -		    result += ",";
  -		}
  -		Configuration conf = values[i];
  -		result += conf.getValue();
  -	    }
  -	    return result;
  -	    //return params.getProperty(name);
  -	} catch (ConfigurationException ce) {
  -	    throw new RuntimeException("Embedded configuration exception was: " + ce.getMessage());
  -	}
  +                if (result == null) {
  +                    result = "";
  +                } else {
  +                    result += ",";
  +                }
  +                Configuration conf = values[i];
  +                result += conf.getValue();
  +            }
  +            return result;
  +            //return params.getProperty(name);
  +        } catch (ConfigurationException ce) {
  +            throw new RuntimeException("Embedded configuration exception was: " + ce.getMessage());
  +        }
   
       }
   
  
  
  
  1.2       +7 -8      jakarta-james/src/org/apache/james/core/MatcherConfigImpl.java
  
  Index: MatcherConfigImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/MatcherConfigImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MatcherConfigImpl.java	2000/09/13 00:38:17	1.1
  +++ MatcherConfigImpl.java	2001/04/19 04:06:35	1.2
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.core;
   
   import java.io.*;
  
  
  
  1.11      +18 -17    jakarta-james/src/org/apache/james/dnsserver/DNSServer.java
  
  Index: DNSServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/dnsserver/DNSServer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DNSServer.java	2001/03/13 22:08:54	1.10
  +++ DNSServer.java	2001/04/19 04:06:39	1.11
  @@ -7,19 +7,20 @@
    */
   package org.apache.james.dnsserver;
   
  -import java.net.UnknownHostException;
   import java.net.InetAddress;
  -import java.util.Collection;
  +import java.net.UnknownHostException;
   import java.util.Arrays;
  -import java.util.Vector;
  +import java.util.Collection;
   import java.util.Comparator;
   import java.util.Enumeration;
   import java.util.Iterator;
  -import org.apache.avalon.AbstractLoggable;
  +import java.util.Vector;
  +import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.Component;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.avalon.Initializable;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.james.transport.Resources;
   import org.xbill.DNS.*;
   
  @@ -27,21 +28,21 @@
    * @version 1.0.0, 18/06/2000
    * @author  Serge Knystautas <se...@lokitech.com>
    */
  -public class DNSServer 
  +public class DNSServer
       extends AbstractLoggable
  -    implements Configurable, Initializable {
  +    implements Component, Configurable, Initializable {
   
       private Resolver resolver;
       private Cache cache;
       private byte dnsCredibility;
       private Collection servers = new Vector();
   
  -    public void configure( final Configuration configuration ) 
  +    public void configure( final Configuration configuration )
           throws ConfigurationException {
   
           // Get this servers that this block will use for lookups
           final Configuration serversConfiguration = configuration.getChild( "servers" );
  -        final Configuration[] serverConfigurations = 
  +        final Configuration[] serverConfigurations =
               serversConfiguration.getChildren( "server" );
   
           for ( int i = 0; i < serverConfigurations.length; i++ )
  @@ -49,12 +50,12 @@
               servers.add( serverConfigurations[ i ].getValue() );
           }
   
  -        final boolean authoritative = 
  +        final boolean authoritative =
               configuration.getChild( "authoritative" ).getValueAsBoolean( false );
           dnsCredibility = authoritative ? Credibility.AUTH_ANSWER : Credibility.NONAUTH_ANSWER;
       }
   
  -    public void init() 
  +    public void init()
           throws Exception {
   
           getLogger().info("DNSServer init...");
  @@ -95,12 +96,12 @@
               }
   
               Comparator prioritySort = new Comparator () {
  -                public int compare (Object a, Object b) {
  -                    MXRecord ma = (MXRecord)a;
  -                    MXRecord mb = (MXRecord)b;
  -                    return ma.getPriority () - mb.getPriority ();
  -                }
  -            };
  +                    public int compare (Object a, Object b) {
  +                        MXRecord ma = (MXRecord)a;
  +                        MXRecord mb = (MXRecord)b;
  +                        return ma.getPriority () - mb.getPriority ();
  +                    }
  +                };
   
               Arrays.sort(mxAnswers, prioritySort);
   
  
  
  
  1.4       +6 -6      jakarta-james/src/org/apache/james/imapserver/ACLMailbox.java
  
  Index: ACLMailbox.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/ACLMailbox.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ACLMailbox.java	2001/03/06 07:39:03	1.3
  +++ ACLMailbox.java	2001/04/19 04:06:40	1.4
  @@ -7,23 +7,23 @@
    */
   package org.apache.james.imapserver;
   
  -import org.apache.avalon.Contextualizable;
   import org.apache.avalon.Disposable;
   import org.apache.avalon.Initializable;
  +import org.apache.avalon.context.Contextualizable;
   
   /**
    * Interface for objects representing an IMAP4rev1 mailbox (folder) with
    * embedded Access Control List.
    *
  - * Reference: RFC 2060 
  + * Reference: RFC 2060
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version 0.1 on 14 Dec 2000
    * @see Mailbox
    * @see ACL
    */
  -public interface ACLMailbox 
  +public interface ACLMailbox
       extends ACL, Mailbox, Contextualizable, Initializable, Disposable {
  - 
  +
       /**
        * Set the details particular to this Mailbox. Should only be called once,
        * at creation, and not when restored from storage.
  @@ -39,8 +39,8 @@
        * setConfiguration, setContext, setComponentManager, if they are called,
        * but before any opertional methods are called.
        */
  -    void reInit() 
  +    void reInit()
           throws Exception;
   }
  - 
  +
   
  
  
  
  1.4       +14 -14    jakarta-james/src/org/apache/james/imapserver/BaseCommand.java
  
  Index: BaseCommand.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/BaseCommand.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BaseCommand.java	2001/03/07 03:55:25	1.3
  +++ BaseCommand.java	2001/04/19 04:06:41	1.4
  @@ -13,7 +13,7 @@
   import java.util.*;
   import javax.mail.MessagingException;
   import javax.mail.internet.InternetHeaders;
  -import org.apache.avalon.AbstractLoggable;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.james.AccessControlException;
   import org.apache.james.AuthorizationException;
   import org.apache.james.core.EnhancedMimeMessage;
  @@ -27,10 +27,10 @@
    * @version 0.1 on 17 Jan 2001
    */
   
  -public abstract class BaseCommand 
  +public abstract class BaseCommand
       extends AbstractLoggable {
   
  -    //mainly to switch on stack traces and catch responses;  
  +    //mainly to switch on stack traces and catch responses;
       private static final boolean DEEP_DEBUG = true;
   
       /**
  @@ -48,7 +48,7 @@
               throw new IllegalArgumentException("Null argument");
           } else if (rawSet.equals("")) {
               getLogger().debug("Empty argument in decodeSet");
  -            throw new IllegalArgumentException("Empty string argument"); 
  +            throw new IllegalArgumentException("Empty string argument");
           }
           getLogger().debug(" decodeSet called for: " + rawSet);
           List response = new ArrayList();
  @@ -58,7 +58,7 @@
               if (checkColon == -1) {
                   Integer seqNum = new Integer(rawSet.trim());
                   if (seqNum.intValue() < 1) {
  -                    throw new IllegalArgumentException("Not a positive integer"); 
  +                    throw new IllegalArgumentException("Not a positive integer");
                   } else {
                       response.add(seqNum);
                   }
  @@ -75,7 +75,7 @@
                       last = lastNum.intValue();
                   }
                   if (first < 1 || last < 1) {
  -                    throw new IllegalArgumentException("Not a positive integer"); 
  +                    throw new IllegalArgumentException("Not a positive integer");
                   } else if (first < last) {
                       response.add(firstNum);
                       for (int i = (first + 1); i < last; i++) {
  @@ -85,10 +85,10 @@
                   } else if (first == last) {
                       response.add(firstNum);
                   } else {
  -                    throw new IllegalArgumentException("Not an increasing range"); 
  +                    throw new IllegalArgumentException("Not an increasing range");
                   }
               }
  -  
  +
           } else {
               try {
                   String firstRawSet = rawSet.substring(0, checkComma);
  @@ -120,7 +120,7 @@
               throw new IllegalArgumentException("Null argument");
           } else if (rawSet.equals("")) {
               getLogger().debug("Empty argument in decodeSet");
  -            throw new IllegalArgumentException("Empty string argument"); 
  +            throw new IllegalArgumentException("Empty string argument");
           }
           getLogger().debug(" decodeUIDSet called for: " + rawSet);
           Iterator it = uidsList.iterator();
  @@ -134,7 +134,7 @@
               if (checkColon == -1) {
                   Integer seqNum = new Integer(rawSet.trim());
                   if (seqNum.intValue() < 1) {
  -                    throw new IllegalArgumentException("Not a positive integer"); 
  +                    throw new IllegalArgumentException("Not a positive integer");
                   } else {
                       response.add(seqNum);
                   }
  @@ -151,7 +151,7 @@
                   int last;
                   last = lastNum.intValue();
                   if (first < 1 || last < 1) {
  -                    throw new IllegalArgumentException("Not a positive integer"); 
  +                    throw new IllegalArgumentException("Not a positive integer");
                   } else if (first < last) {
                       response.add(firstNum);
                       Collection uids;
  @@ -167,15 +167,15 @@
                           }
                       }
                       response.add(lastNum);
  -                    
  +
                   } else if (first == last) {
                       response.add(firstNum);
                   } else {
  -                    throw new IllegalArgumentException("Not an increasing range"); 
  +                    throw new IllegalArgumentException("Not an increasing range");
                   }
   
               }
  -            
  +
           } else {
               try {
                   String firstRawSet = rawSet.substring(0, checkComma);
  
  
  
  1.5       +21 -21    jakarta-james/src/org/apache/james/imapserver/CommandFetch.java
  
  Index: CommandFetch.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/CommandFetch.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CommandFetch.java	2001/03/07 03:55:25	1.4
  +++ CommandFetch.java	2001/04/19 04:06:41	1.5
  @@ -24,10 +24,10 @@
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version 0.1 on 17 Jan 2001
    */
  -public class CommandFetch 
  +public class CommandFetch
       extends BaseCommand {
   
  -    //mainly to switch on stack traces and catch responses;  
  +    //mainly to switch on stack traces and catch responses;
       private static final boolean DEEP_DEBUG = true;
   
       private static final String OK = "OK";
  @@ -65,7 +65,7 @@
       }
   
       /**
  -     * Implements IMAP fetch commands given an ImapRequest. 
  +     * Implements IMAP fetch commands given an ImapRequest.
        * This implementation attempts to satisfy the fetch command with the
        * smallest objects deserialized from storage.
        * <p>Warning - maybecome service(ImapRequest request)
  @@ -115,13 +115,13 @@
                       attrWithFields.append(" " + field);
                       if (field.indexOf(")") != -1) {
                           endOfFields = true;
  -                    } 
  +                    }
                   }
                   fetchAttrs.add(attrWithFields.toString());
               }
           }
  +
   
  -    
           // convert macro fetch commands to basic commands
           for(int k = 0; k < fetchAttrs.size(); k++) {
               String arg = (String)fetchAttrs.get(k);
  @@ -177,7 +177,7 @@
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message flags.");
                               getLogger().error("Retrieved null flags for msn:" + msn);
                               return;
  -                        } 
  +                        }
                           if (responseAdded) {
                               response += SP + "FLAGS " + flags ;
                           } else {
  @@ -198,7 +198,7 @@
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
                               getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
  -                        } 
  +                        }
                           if (responseAdded) {
                               response += SP + "INTERNALDATE \""
                                   + attrs.getInternalDateAsString() + "\")" ;
  @@ -219,7 +219,7 @@
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
                               getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
  -                        } 
  +                        }
                           if (responseAdded) {
                               response += SP + "RFC822.SIZE " + attrs.getSize();
                           } else {
  @@ -238,7 +238,7 @@
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
                               getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
  -                        } 
  +                        }
                           if (responseAdded) {
                               response += SP + "ENVELOPE " + attrs.getEnvelope();
                           } else {
  @@ -257,7 +257,7 @@
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
                               getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
  -                        } 
  +                        }
                           if (responseAdded) {
                               response += SP + "BODY " + attrs.getBodyStructure();
                           } else {
  @@ -276,7 +276,7 @@
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
                               getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
  -                        } 
  +                        }
                           if (responseAdded) {
                               response += SP + "BODYSTRUCTURE "+ attrs.getBodyStructure();
                           } else {
  @@ -293,8 +293,8 @@
                                   out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
                                   getLogger().error("Retrieved null attributes for msn:" + msn);
                                   return;
  -                            } 
  -                        
  +                            }
  +
                               if (responseAdded) {
                                   response += SP + "UID "+ uid;
                               } else {
  @@ -303,7 +303,7 @@
                               }
                           } // don't duplicate on UID FETCH requests
                       }
  -                    // commands that can be satisifed with just top-level headers of message and flags 
  +                    // commands that can be satisifed with just top-level headers of message and flags
                       else if (arg.equalsIgnoreCase("BODY[HEADER]")
                                || arg.equalsIgnoreCase("BODY.PEEK[HEADER]")) {
                           if (responseAdded) { // unlikely
  @@ -325,7 +325,7 @@
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message.");
                               getLogger().error("Retrieved null headers for msn:" + msn);
                               return;
  -                        } 
  +                        }
                           if (flags == null) {
                               if (useUIDs) {
                                   flags = currentMailbox.getFlagsUID(uid, user);
  @@ -388,12 +388,12 @@
                               } catch (Exception e) {
                                   getLogger().error("Unanticipated exception storing flags for message: " + e);
                               }
  -                        }        
  +                        }
                           response = UNTAGGED + SP + msn + SP + "FETCH (";
                           responseAdded = false;
                       } else if (arg.toUpperCase().startsWith("BODY[HEADER.FIELDS")
                                  || arg.toUpperCase().startsWith("BODY.PEEK[HEADER.FIELDS")) {
  -                        if (responseAdded) { 
  +                        if (responseAdded) {
                               if (useUIDs) {
                                   response += " UID " + uid + ")";
                               } else {
  @@ -412,7 +412,7 @@
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message.");
                               getLogger().error("Retrieved null headers for msn:" + msn);
                               return;
  -                        } 
  +                        }
                           if (flags == null) {
                               if (useUIDs) {
                                   flags = currentMailbox.getFlagsUID(uid, user);
  @@ -534,7 +534,7 @@
                               out.println(tag + SP + msn + SP + BAD + "Error retrieving message.");
                               getLogger().error("Retrieved null message");
                               return;
  -                        } 
  +                        }
                           try {
                               int size = msg.getMessageSize();
                               if (arg.equalsIgnoreCase("RFC822")) {
  @@ -605,7 +605,7 @@
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message.");
                               getLogger().error("Retrieved null message");
                               return;
  -                        } 
  +                        }
                           try {
                               int size = msg.getSize();
                               if (arg.equalsIgnoreCase("RFC822.TEXT")) {
  @@ -671,7 +671,7 @@
                       out.println(response);
                   }
               } // end for loop
  -        
  +
               out.println(tag + SP + OK + SP + "FETCH completed");
               caller.checkSize();
               return;
  
  
  
  1.6       +38 -38    jakarta-james/src/org/apache/james/imapserver/FileMailbox.java
  
  Index: FileMailbox.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/FileMailbox.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FileMailbox.java	2001/03/06 07:39:05	1.5
  +++ FileMailbox.java	2001/04/19 04:06:42	1.6
  @@ -12,10 +12,10 @@
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.Context;
  +import org.apache.avalon.component.ComponentManager;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.context.Context;
   import org.apache.james.AccessControlException;
   import org.apache.james.AuthorizationException;
   import org.apache.james.Constants;
  @@ -44,7 +44,7 @@
    * <br>      \Unmarked      The mailbox does not contain any additional
    * messages since the last time the mailbox was selected.
    *
  - * <p>Message related flags. 
  + * <p>Message related flags.
    * <br>The flags allowed per message are specific to each mailbox.
    * <br>The minimum list (rfc2060 system flags) is:
    * <br> \Seen       Message has been read
  @@ -82,11 +82,11 @@
    * <p> Deserialization. On recover from disc, configure, compose,
    * contextualize and reInit must be called before object is ready for use.
    *
  - * Reference: RFC 2060 
  + * Reference: RFC 2060
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version 0.1 on 14 Dec 2000
    */
  -public class FileMailbox 
  +public class FileMailbox
       implements ACLMailbox, Serializable {
   
       public static final String MAILBOX_FILE_NAME = "mailbox.mbr";
  @@ -158,7 +158,7 @@
       public void contextualize(Context context) {
           this.context = context;
       }
  -    
  +
       public void compose(ComponentManager comp) {
           compMgr = comp;
       }
  @@ -174,7 +174,7 @@
           if (absName != null && (absName.length() > 0)) {
               absoluteName = absName;
           } else {
  -            throw new RuntimeException("Incorrect absoluteName argument for a" 
  +            throw new RuntimeException("Incorrect absoluteName argument for a"
                                          + " FileMailbox constructor.");
           }
           if (initialAdminUser != null && (initialAdminUser.length() > 0)) {
  @@ -190,7 +190,7 @@
       public void init() throws Exception {
           uidValidity = 1;
           highestUID = 0;
  -        mailboxSize = 0; 
  +        mailboxSize = 0;
           inferiorsAllowed = true;
           marked = false;
           notSelectableByAnyone = false;
  @@ -239,8 +239,8 @@
           } else {
               logger.error("FileMailbox init error: unknown namespace - "
                            + absoluteName);
  -            throw new RuntimeException("Unknown namespace for absoluteName" 
  -                                       +" argument for a FileMailbox" 
  +            throw new RuntimeException("Unknown namespace for absoluteName"
  +                                       +" argument for a FileMailbox"
                                          +" constructor." + absoluteName);
           }
           //Check for writable directory
  @@ -259,7 +259,7 @@
       /**
        * Re-initialises mailbox after reading from file-system. Cannot assume that this is the same instance of James that wrote it.
        *
  -     * <p> Contract is that re-init must be called after configure, contextualize, compose. 
  +     * <p> Contract is that re-init must be called after configure, contextualize, compose.
        */
       public void reInit() throws Exception {
           listeners = new HashSet();
  @@ -427,8 +427,8 @@
           return recentMessages.size();
       }
   
  -    /** 
  -     * Indicates the oldest unseen message for the specified user. 
  +    /**
  +     * Indicates the oldest unseen message for the specified user.
        *
        * @returns int Message Sequence Number of first message without \Seen
        * flag set for this User.  0 means no unseen messages in this mailbox.
  @@ -459,9 +459,9 @@
       public  synchronized  int getExists() {
           return sequence.size();
       }
  -    
  -    /** 
  -     * Indicates the number of  unseen messages for the specified user. 
  +
  +    /**
  +     * Indicates the number of  unseen messages for the specified user.
        *
        * @returns int number of messages without \Seen flag set for this User.
        */
  @@ -486,7 +486,7 @@
               return sequence.size();
           }
       }
  -    
  +
       /** Mailbox Events are used to inform registered listeners of events in the Mailbox.
        * E.g. if mail is delivered to an Inbox or if another user appends/ deletes a message.
        */
  @@ -500,7 +500,7 @@
       }
   
       /**
  -     * Mark this mailbox as not selectable by anyone. 
  +     * Mark this mailbox as not selectable by anyone.
        * Example folders at the roots of hierarchies, e. #mail for each user.
        *
        * @param state true if folder is not selectable by anyone
  @@ -569,7 +569,7 @@
   
           boolean change;
           boolean[] rights = new boolean[NUMBER_OF_RIGHTS];
  -          
  +
           if (mods[0] == ADD_RIGHTS) {
               change = true;
               System.arraycopy(existingRights, 0, rights, 0,
  @@ -698,7 +698,7 @@
               throw new AccessControlException(DENY_ACCESS);
           } else if (!getter.equals(identity) && gettersRights[ADMIN] == false) {
               throw new AuthorizationException(DENY_AUTH + getter);
  -        }        
  +        }
           boolean[] rights = (boolean[]) acl.get(identity);
           if (rights == null) {
               return null;
  @@ -747,7 +747,7 @@
               }
               response.append("> ");
           }
  -         
  +
           return response.toString();
       }
   
  @@ -898,7 +898,7 @@
           throws AccessControlException {
           return (!notSelectableByAnyone && hasReadRights(username));
       }
  -  
  +
       /**
        * Indicates if specified user can change any flag on a permanent basis,
        * except for \Recent which can never be changed by a user.
  @@ -910,7 +910,7 @@
           throws AccessControlException {
           // relies on implementation that each right implies those
           // before it in list:  l,r,s,w,i,p,c,d,a
  -        return hasDeleteRights(username); 
  +        return hasDeleteRights(username);
       }
   
       /**
  @@ -976,12 +976,12 @@
        */
       public synchronized boolean store(MimeMessage message, String username)
           throws AccessControlException, AuthorizationException,
  -        IllegalArgumentException {
  +               IllegalArgumentException {
   
           if (message == null || username == null) {
               logger.error("Null argument received in store.");
               throw new IllegalArgumentException("Null argument received in store.");
  -        } 
  +        }
           if (!hasInsertRights(username)) { //throws AccessControlException
               throw new AuthorizationException("Not authorized to insert.");
           }
  @@ -999,7 +999,7 @@
   
       /**
        * Stores a message in this mailbox, using passed MessageAttributes and
  -     * Flags. User must have insert rights. 
  +     * Flags. User must have insert rights.
        * <br>Current implementation requires MessageAttributs to be of
        * class SimpleMessageAttributes
        *
  @@ -1015,7 +1015,7 @@
       public boolean store(MimeMessage message, String username,
                            MessageAttributes msgAttrs, Flags flags)
           throws AccessControlException, AuthorizationException,
  -        IllegalArgumentException {
  +               IllegalArgumentException {
   
           if (msgAttrs == null || message == null || username == null) {
               logger.error("Null argument received in store.");
  @@ -1024,9 +1024,9 @@
           if (! (msgAttrs instanceof SimpleMessageAttributes)) {
               logger.error("Wrong class for Attributes");
               throw new IllegalArgumentException("Wrong class for Attributes");
  -        } 
  +        }
           SimpleMessageAttributes attrs = (SimpleMessageAttributes)msgAttrs;
  -        
  +
           int newUID = ++highestUID;
           attrs.setUID(newUID);
           sequence.add(new Integer(newUID));
  @@ -1082,7 +1082,7 @@
       /**
        * Retrieves a message given a message sequence number.
        *
  -     * @param msn the message sequence number 
  +     * @param msn the message sequence number
        * @param username String represnting user
        * @returns an  EnhancedMimeMessage object containing the message, null if no message with
        * the given msn.
  @@ -1153,7 +1153,7 @@
       /**
        * Marks a message for deletion given a message sequence number.
        *
  -     * @param msn the message sequence number 
  +     * @param msn the message sequence number
        * @param username String represnting user
        * @returns boolean true if successful.
        * @throws AccessControlException if user does not have read rights for
  @@ -1301,7 +1301,7 @@
                   }
               }
               logger.info("MessageAttributes for " + uid + " written in " + absoluteName);
  -            
  +
               return true;
           } else {
               return false;
  @@ -1370,7 +1370,7 @@
        */
       public synchronized  boolean setFlags(int msn, String user, String request)
           throws AccessControlException, AuthorizationException,
  -        IllegalArgumentException {
  +               IllegalArgumentException {
           if (!hasKeepSeenRights(user)) { //throws AccessControlException
               throw new AuthorizationException("Not authorized to store any flags.");
           }
  @@ -1396,7 +1396,7 @@
        */
       public synchronized boolean setFlagsUID(int uid, String user, String request)
           throws AccessControlException, AuthorizationException,
  -        IllegalArgumentException {
  +               IllegalArgumentException {
           if (!hasKeepSeenRights(user)) { //throws AccessControlException
               throw new AuthorizationException("Not authorized to store any flags.");
           }
  @@ -1404,7 +1404,7 @@
               throw new AuthorizationException("Not authorized to delete.");
           }
           if (sequence.contains(new Integer(uid))) {
  -          
  +
               Flags flags = readFlags(uid);
               boolean wasRecent = flags.isRecent();
               boolean wasDeleted = flags.isDeleted();
  @@ -1438,7 +1438,7 @@
           } else {
               return false;
           }
  -        
  +
       }
   
       private int findOldestUnseen(String user, int previousOld)
  @@ -1544,7 +1544,7 @@
           }
           for (int i = 0; i < sequence.size(); i++) {
               System.err.println("Message with msn " + i + " has uid " + sequence.get(i));
  -        }        
  +        }
           return true;
       }
   
  @@ -1677,6 +1677,6 @@
           }
       }
   }
  +
   
  - 
   
  
  
  
  1.6       +22 -22    jakarta-james/src/org/apache/james/imapserver/Host.java
  
  Index: Host.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/Host.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Host.java	2001/03/06 07:39:07	1.5
  +++ Host.java	2001/04/19 04:06:42	1.6
  @@ -7,13 +7,13 @@
    */
   package org.apache.james.imapserver;
   
  -import java.util.List;
   import java.util.Collection;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Contextualizable;
  +import java.util.List;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.context.Contextualizable;
   import org.apache.james.AccessControlException;
   import org.apache.james.AuthorizationException;
   
  @@ -23,9 +23,9 @@
    * An IMAP messaging system may span more than one host.
    * <p><code>String</code> parameters representing mailbox names must be the
    * full hierarchical name of the target, with namespace, as used by the
  - * specified user. Examples: 
  + * specified user. Examples:
    * '#mail.Inbox' or '#shared.finance.Q2Earnings'.
  - * <p>An imap Host must keep track of existing and deleted mailboxes. 
  + * <p>An imap Host must keep track of existing and deleted mailboxes.
    *
    * References: rfc 2060, rfc 2193, rfc 2221
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
  @@ -33,9 +33,9 @@
    * @see FolderRecord
    * @see RecordRepository
    */
  -public interface Host 
  -    extends Configurable, Composer, Contextualizable, org.apache.phoenix.Service {
  -   
  +public interface Host
  +    extends Configurable, Composable, Contextualizable, org.apache.phoenix.Service {
  +
       String IMAP_HOST = "IMAP_HOST";
   
       /**
  @@ -45,7 +45,7 @@
        *
        * @param username an email address
        * @returns true if inbox (and private mailfolders) are accessible through
  -     * this host. 
  +     * this host.
        */
       boolean isHomeServer (String username);
   
  @@ -84,7 +84,7 @@
        * request to create a mailbox in a namespace not served by this host would
        * be an error.
        * It is an error to create a mailbox with the name of a mailbox that has
  -     * been deleted, if that name is still in use. 
  +     * been deleted, if that name is still in use.
        *
        * @param user email address on whose behalf the request is made.
        * @param mailboxName String name of the target
  @@ -132,7 +132,7 @@
        * folder with the new name, but INBOX is not deleted. If INBOX has
        * inferior mailboxes these are not renamed.
        * It is an error to create a mailbox with the name of a mailbox that has
  -     * been deleted, if that name is still in use. 
  +     * been deleted, if that name is still in use.
        * Implementations must track deleted mailboxes
        *
        * @param user email address on whose behalf the request is made.
  @@ -140,12 +140,12 @@
        * @param newMailboxName String target new name
        * @returns true if rename completed successfully
        * @throws MailboxException if mailbox does not exist locally, or there
  -     * is an existing mailbox with the new name. 
  +     * is an existing mailbox with the new name.
        * @throws AuthorizationException if user does not have rights to delete
        * the existing mailbox or create the new mailbox.
        * @see FolderRecord
        */
  -    boolean renameMailbox( String user, 
  +    boolean renameMailbox( String user,
                              String oldMailboxName,
                              String newMailboxName )
           throws MailboxException, AuthorizationException;
  @@ -157,11 +157,11 @@
        * @param mbox a non-null reference to an ACL Mailbox.
        */
       void releaseMailbox( String user, ACLMailbox mbox );
  - 
  +
       /**
        * Returns the namespace which should be used for this user unless they
        * expicitly request another.
  -     * 
  +     *
        * @param username String an email address
        * @returns a String of a namespace
        */
  @@ -170,7 +170,7 @@
   
       /**
        * Return UIDValidity for named mailbox. Implementations should track
  -     * existing and deleted folders. 
  +     * existing and deleted folders.
        *
        * @param mailbox String name of the existing mailbox
        * @returns  an integer containing the current UID Validity value.
  @@ -191,7 +191,7 @@
        * implementations must not throw either exception but must return a single
        * String (described below) if the reference name specifies a local mailbox
        * accessible to the user and a one-character String containing the
  -     * hierarchy delimiter of the referenced namespace, otherwise. 
  +     * hierarchy delimiter of the referenced namespace, otherwise.
        * <p>Each String returned should be a space seperated triple of name
        * attributes, hierarchy delimiter and full mailbox name.   The mailbox
        * name should include the namespace and be relative to the specified user.
  @@ -219,9 +219,9 @@
        * referenceName and mailbox name resolve to a single mailbox which does
        * not exist locally.
        */
  -    Collection listMailboxes( String username, 
  +    Collection listMailboxes( String username,
                                 String referenceName,
  -                              String mailboxName, 
  +                              String mailboxName,
                                 boolean subscribedOnly )
           throws MailboxException, AccessControlException;
   
  @@ -240,7 +240,7 @@
           throws MailboxException, AccessControlException;
   
       /**
  -     * Unsubscribes from a given mailbox. 
  +     * Unsubscribes from a given mailbox.
        *
        * @param username String representation of an email address
        * @param mailbox String representation of a mailbox name.
  @@ -267,9 +267,9 @@
        * dataItem-space-number.
        * @throws AccessControlException if the user does not have at least
        * lookup rights to the mailbox requested.
  -     * @throws MailboxException if the mailboxName does not exist locally. 
  +     * @throws MailboxException if the mailboxName does not exist locally.
        */
  -    String getMailboxStatus( String username, 
  +    String getMailboxStatus( String username,
                                String mailboxName,
                                List dataItems )
           throws MailboxException, AccessControlException;
  
  
  
  1.6       +7 -7      jakarta-james/src/org/apache/james/imapserver/IMAPSystem.java
  
  Index: IMAPSystem.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/IMAPSystem.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IMAPSystem.java	2001/03/06 07:39:08	1.5
  +++ IMAPSystem.java	2001/04/19 04:06:43	1.6
  @@ -8,11 +8,11 @@
   package org.apache.james.imapserver;
   
   import java.util.Iterator;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Context;
  -import org.apache.avalon.Contextualizable;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
  +import org.apache.avalon.context.Context;
  +import org.apache.avalon.context.Contextualizable;
   import org.apache.james.AuthenticationException;
   
   /**
  @@ -25,8 +25,8 @@
    * @version 0.1 on 14 Dec 2000
    * @see Host
    */
  -public interface IMAPSystem 
  -    extends Configurable, Contextualizable, Composer {
  +public interface IMAPSystem
  +    extends Configurable, Contextualizable, Composable {
   
       String IMAP_SYSTEM = "IMAP_SYSTEM";
       String PRIVATE = "Private";
  @@ -73,7 +73,7 @@
        * <code>IMAPHosts</code>
        *
        * @param username String identifying a user of this System
  -     * @returns String whose contents should be a space seperated triple 
  +     * @returns String whose contents should be a space seperated triple
        * <personal namespaces(s)> space <other users' namespace(s)> space
        * <shared namespace(s)>, per RFC2342
        */
  
  
  
  1.3       +0 -1      jakarta-james/src/org/apache/james/imapserver/ImapRequest.java
  
  Index: ImapRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/ImapRequest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ImapRequest.java	2001/03/06 07:39:08	1.2
  +++ ImapRequest.java	2001/04/19 04:06:43	1.3
  @@ -11,7 +11,6 @@
   import java.io.PrintWriter;
   import java.util.StringTokenizer;
   
  -
   /**
    * An single client request to an IMAP server, with necessary details for
    * command processing
  
  
  
  1.7       +4 -1      jakarta-james/src/org/apache/james/imapserver/JamesHost.java
  
  Index: JamesHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/JamesHost.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JamesHost.java	2001/03/06 07:39:08	1.6
  +++ JamesHost.java	2001/04/19 04:06:44	1.7
  @@ -12,7 +12,10 @@
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import org.apache.avalon.*;
  +import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.Component;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.context.Context;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
   import org.apache.james.AccessControlException;
  
  
  
  1.6       +2 -2      jakarta-james/src/org/apache/james/imapserver/Mailbox.java
  
  Index: Mailbox.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/Mailbox.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Mailbox.java	2001/03/06 07:39:09	1.5
  +++ Mailbox.java	2001/04/19 04:06:44	1.6
  @@ -11,7 +11,7 @@
   import java.util.Map;
   import javax.mail.internet.InternetHeaders;
   import javax.mail.internet.MimeMessage;
  -import org.apache.avalon.Composer;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.james.AccessControlException;
   import org.apache.james.AuthorizationException;
  @@ -63,7 +63,7 @@
    * @version 0.1 on 14 Dec 2000
    */
   public interface Mailbox 
  -    extends Configurable, Composer {
  +    extends Configurable, Composable {
   
       String SYSTEM_FLAGS = "\\Seen \\Answered \\Flagged \\Deleted \\Draft";
       String RECENT_FLAG =  "\\Recent"; 
  
  
  
  1.4       +1 -1      jakarta-james/src/org/apache/james/imapserver/MailboxEventListener.java
  
  Index: MailboxEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/MailboxEventListener.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MailboxEventListener.java	2001/03/06 07:39:10	1.3
  +++ MailboxEventListener.java	2001/04/19 04:06:45	1.4
  @@ -18,7 +18,7 @@
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version 0.1 on 14 Dec 2000
    */
  -public interface MailboxEventListener 
  +public interface MailboxEventListener
       extends EventListener, Serializable {
   
       void receiveEvent( MailboxEvent me );
  
  
  
  1.3       +0 -1      jakarta-james/src/org/apache/james/imapserver/MessageHeader.java
  
  Index: MessageHeader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/MessageHeader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MessageHeader.java	2001/03/06 07:39:12	1.2
  +++ MessageHeader.java	2001/04/19 04:06:45	1.3
  @@ -16,7 +16,6 @@
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version 0.1 on 14 Dec 2000
    */
  -
   public class MessageHeader implements Serializable {
       public static final String CRLF =  "\r\n";
       public static final String CRLFHTAB =  "\r\n\t";
  
  
  
  1.5       +5 -5      jakarta-james/src/org/apache/james/imapserver/SimpleSystem.java
  
  Index: SimpleSystem.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/SimpleSystem.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SimpleSystem.java	2001/03/06 07:39:14	1.4
  +++ SimpleSystem.java	2001/04/19 04:06:46	1.5
  @@ -8,12 +8,12 @@
   package org.apache.james.imapserver;
   
   import java.util.*;
  -import org.apache.avalon.Component;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.Context;
   import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.Component;
  +import org.apache.avalon.component.ComponentManager;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.context.Context;
   import org.apache.james.AuthenticationException;
   
   /**
  @@ -23,7 +23,7 @@
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    * @version 0.1 on 14 Dec 2000
    */
  -public class SimpleSystem 
  +public class SimpleSystem
       implements IMAPSystem, Component, Initializable {
   
       private static final String namespaceToken = "#";
  @@ -101,7 +101,7 @@
        * <code>IMAPHosts</code>
        *
        * @param username String identifying a user of this System
  -     * @returns String whose contents should be a space seperated triple 
  +     * @returns String whose contents should be a space seperated triple
        * <personal namespaces(s)> space <other users' namespace(s)> space
        * <shared namespace(s)>, per RFC2342
        */
  
  
  
  1.12      +114 -114  jakarta-james/src/org/apache/james/imapserver/SingleThreadedConnectionHandler.java
  
  Index: SingleThreadedConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/SingleThreadedConnectionHandler.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SingleThreadedConnectionHandler.java	2001/03/07 04:01:30	1.11
  +++ SingleThreadedConnectionHandler.java	2001/04/19 04:06:46	1.12
  @@ -12,16 +12,16 @@
   import java.text.*;
   import java.util.*;
   import javax.mail.internet.*;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Context;
  -import org.apache.avalon.Contextualizable;
   import org.apache.avalon.Initializable;
   import org.apache.avalon.Stoppable;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.context.Context;
  +import org.apache.avalon.context.Contextualizable;
   import org.apache.cornerstone.services.connection.ConnectionHandler;
   import org.apache.cornerstone.services.scheduler.PeriodicTimeTrigger;
   import org.apache.cornerstone.services.scheduler.Target;
  @@ -46,10 +46,10 @@
    */
   public class SingleThreadedConnectionHandler
       extends BaseCommand
  -    implements ConnectionHandler, Contextualizable, Composer, Configurable, 
  -    Initializable, Stoppable, Target, MailboxEventListener {
  +    implements ConnectionHandler, Contextualizable, Composable, Configurable,
  +               Initializable, Stoppable, Target, MailboxEventListener {
   
  -    //mainly to switch on stack traces and catch responses;  
  +    //mainly to switch on stack traces and catch responses;
       private static final boolean DEEP_DEBUG = true;
   
       // Connection states
  @@ -121,7 +121,7 @@
   
       //currentFolder holds the client-dependent absolute address of the current
       //folder, that is current Namespace and full mailbox hierarchy.
  -    private String currentFolder = null;       
  +    private String currentFolder = null;
       private ACLMailbox currentMailbox = null;
       private boolean currentIsReadOnly = false;
       private boolean connectionClosed = false;
  @@ -131,8 +131,8 @@
       private int recent;
       private List sequence;
   
  -    public void compose( final ComponentManager componentManager ) 
  -        throws ComponentManagerException {
  +    public void compose( final ComponentManager componentManager )
  +        throws ComponentException {
   
           mailServer = (MailServer)componentManager.
               lookup("org.apache.james.services.MailServer");
  @@ -145,12 +145,12 @@
           imapHost = (Host)componentManager.
               lookup("org.apache.james.imapserver.Host");
       }
  - 
  +
       public void contextualize( final Context context ) {
           servername = (String)context.get( Constants.HELO_NAME );
       }
   
  -    public void configure( final Configuration configuration ) 
  +    public void configure( final Configuration configuration )
           throws ConfigurationException {
           timeout = configuration.getChild( "connectiontimeout" ).getValueAsInt( 1800000 );
       }
  @@ -169,27 +169,27 @@
        * @exception IOException if an error reading from socket occurs
        * @exception ProtocolException if an error handling connection occurs
        */
  -    public void handleConnection( final Socket connection ) 
  +    public void handleConnection( final Socket connection )
           throws IOException {
   
           try {
               this.socket = connection;
               in = new BufferedReader(new
  -                                    InputStreamReader(socket.getInputStream()));
  +                InputStreamReader(socket.getInputStream()));
               outs = socket.getOutputStream();
               out = new InternetPrintWriter(outs, true);
               remoteHost = socket.getInetAddress ().getHostName ();
               remoteIP = socket.getInetAddress ().getHostAddress ();
           } catch (Exception e) {
               getLogger().error("Cannot open connection from " + remoteHost + " ("
  -                         + remoteIP + "): " + e.getMessage());
  +                              + remoteIP + "): " + e.getMessage());
           }
           getLogger().info("Connection from " + remoteHost + " (" + remoteIP + ")");
   
           try {
               final PeriodicTimeTrigger trigger = new PeriodicTimeTrigger( timeout, -1 );
               scheduler.addTrigger( this.toString(), trigger, this );
  -           
  +
               if (false) { // arbitrary rejection of connection
                   // could screen connections by IP or host or implement
                   // connection pool management
  @@ -221,15 +221,15 @@
               }
   
               if (!connectionClosed) {
  -                connectionClosed 
  +                connectionClosed
                       = closeConnection(UNTAGGED_BYE,
  -                                      "Server error, closing connection", ""); 
  +                                      "Server error, closing connection", "");
               }
  -           
  +
           } catch (Exception e) {
               // This should never happen once code is debugged
               getLogger().error("Exception during connection from " + remoteHost
  -                         + " (" + remoteIP + ") : " + e.getMessage());
  +                              + " (" + remoteIP + ") : " + e.getMessage());
               e.printStackTrace();
               connectionClosed = closeConnection(UNTAGGED_BYE,
                                                  "Error processing command.", "");
  @@ -244,7 +244,7 @@
                                              "Autologout. Idle too long.", "");
       }
   
  -    private boolean closeConnection( int exitStatus, 
  +    private boolean closeConnection( int exitStatus,
                                        String message1,
                                        String message2 ) {
           scheduler.removeTrigger(this.toString());
  @@ -277,10 +277,10 @@
               out.flush();
               socket.close();
               getLogger().info("Connection closed" + SP + exitStatus + SP + message1
  -                        +  SP + message2);
  +                             +  SP + message2);
           } catch (IOException ioe) {
               getLogger().error("Exception while closing connection from " + remoteHost
  -                         + " (" + remoteIP + ") : " + ioe.getMessage());
  +                              + " (" + remoteIP + ") : " + ioe.getMessage());
               try {
                   socket.close();
               } catch (IOException ioe2) {
  @@ -329,7 +329,7 @@
               out.println(UNTAGGED + SP + BAD + SP + "no command sent");
               return true;
           }
  -        
  +
           // At this stage we have a tag and a string which may be a command
           // Start with commands that are valid in any state
           // CAPABILITY, NOOP, LOGOUT
  @@ -342,9 +342,9 @@
               }
               out.println(tag + SP + OK + SP + "CAPABILITY completed");
               getLogger().debug("Capability command completed for " + remoteHost
  -                         + "(" + remoteIP  + ")");
  +                              + "(" + remoteIP  + ")");
               return true;
  -            
  +
           } else if (command.equalsIgnoreCase("NOOP")) {
               if (state == SELECTED ) {
                   checkSize();
  @@ -353,23 +353,23 @@
               // we could send optional untagged status responses as well
               out.println(tag + SP + OK + SP + "NOOP completed");
               getLogger().debug("Noop command completed for " + remoteHost
  -                         + "(" + remoteIP  + ")");
  +                              + "(" + remoteIP  + ")");
               return true;
  -            
  +
           } else if (command.equalsIgnoreCase("LOGOUT")) {
               connectionClosed = closeConnection(NORMAL_CLOSE, "", "");
               return false;
  -            
  +
           }
  -        
  +
           // Commands only valid in NON_AUTHENTICATED state
           // AUTHENTICATE, LOGIN
  -        
  +
           if (state == NON_AUTHENTICATED) {
               if (command.equalsIgnoreCase("AUTHENTICATE")) {
                   out.println(tag + SP + NO + SP + "Auth type not supported.");
                   getLogger().info("Attempt to use Authenticate command by "
  -                            + remoteHost  + "(" + remoteIP  + ")");
  +                                 + remoteHost  + "(" + remoteIP  + ")");
                   securityLogger.info("Attempt to use Authenticate command by "
                                       + remoteHost  + "(" + remoteIP  + ")");
                   return true;
  @@ -378,7 +378,7 @@
                       out.println(tag + SP + BAD + SP
                                   + "Command should be <tag> <LOGIN> <username> <password>");
                       getLogger().info("Wrong number of arguments for LOGIN command from "
  -                                + remoteHost  + "(" + remoteIP  + ")");
  +                                     + remoteHost  + "(" + remoteIP  + ")");
                       return true;
                   }
                   user = decodeAstring(commandLine.nextToken());
  @@ -389,11 +389,11 @@
                       // four possibilites handled:
                       // private mail: isLocal, is Remote
                       // other mail (shared, news, etc.) is Local, is Remote
  -                    
  +
                       if (imapHost.isHomeServer(user)) {
                           out.println(tag + SP + OK + SP + "LOGIN completed");
                           state = AUTHENTICATED;
  -                        
  +
                       } else  {
                           String remoteServer = null;
                           try {
  @@ -406,16 +406,16 @@
                                                     "");
                               return false;
                           }
  -                        
  +
                           if (imapHost.hasLocalAccess(user)) {
                               out.println(tag + SP + OK + SP + "[REFERRAL "
  -                                        + remoteServer +"]" + SP 
  +                                        + remoteServer +"]" + SP
                                           + "Your home server is remote, other mailboxes available here");
                               state = AUTHENTICATED;
  -                           
  +
                           } else {
                               closeConnection(TAGGED_NO, " [REFERRAL" + SP
  -                                            + remoteServer +"]" + SP 
  +                                            + remoteServer +"]" + SP
                                               + "No mailboxes available here, try remote server", "");
                               return false;
                           }
  @@ -427,8 +427,8 @@
                       // which is not actually a folder
                       currentFolder = currentNamespace + currentSeperator + "";
                       getLogger().debug("Current folder for user "  + user + " from "
  -                                 + remoteHost  + "(" + remoteIP  + ") is "
  -                                 + currentFolder);
  +                                      + remoteHost  + "(" + remoteIP  + ") is "
  +                                      + currentFolder);
                       return true;
   
   
  @@ -439,16 +439,16 @@
                                        + user + " from "  + remoteHost  + "(" + remoteIP
                                        + ")");
                   return true;
  -            } 
  +            }
               // bad client
               out.println(tag + SP + NO + SP + "Must authenticate first");
               return true;
  -        } // end of if (state == NON_AUTHENTICATED) 
  -        
  +        } // end of if (state == NON_AUTHENTICATED)
  +
           // Commands not yet processed should be valid in either
           // Authenticated or Selected states.
           getLogger().debug("Command recieved: " + commandRaw + " from " + remoteHost
  -                     + "(" + remoteIP  + ")");
  +                          + "(" + remoteIP  + ")");
   
           // Create ImapRequest object here - is this the right stage?
           ImapRequest request = new ImapRequest(this);
  @@ -462,7 +462,7 @@
           // Commands valid in both Authenticated and Selected states
           // NAMESPACE, GETACL, SETACL, DELETEACL, LISTRIGHTS, MYRIGHTS, SELECT
           if (state == AUTHENTICATED || state == SELECTED) {
  -            
  +
               // NAMESPACE capability ------------------------------
               if (command.equalsIgnoreCase("NAMESPACE")) {
                   String namespaces = imapSystem.getNamespaces(user);
  @@ -475,9 +475,9 @@
                   out.println(tag + SP + OK + SP
                               + "NAMESPACE command completed");
                   return true;
  -                
  +
                   // ACL Capability  ---------------------------------------
  -            } else if (command.equalsIgnoreCase("GETACL")) { 
  +            } else if (command.equalsIgnoreCase("GETACL")) {
                   ACLMailbox target = null;
                   if (arguments != 3) {
                       out.println(tag + SP + BAD + SP +
  @@ -495,7 +495,7 @@
                       out.println(UNTAGGED + SP + "ACL " + target.getName() + SP
                                   + target.getAllRights(user ));
                       getLogger().debug(UNTAGGED + SP + "ACL " + target.getName() + SP
  -                                 + target.getAllRights(user ));
  +                                      + target.getAllRights(user ));
                   } catch (AccessControlException ace) {
                       out.println(tag + SP + NO + SP + "Unknown mailbox");
                       logACE(ace);
  @@ -509,11 +509,11 @@
                       checkSize();
                       checkExpunge();
                   }
  -                out.println(tag + SP + OK + SP 
  +                out.println(tag + SP + OK + SP
                               + "GetACL command completed");
  -                return true;    
  -            
  -            } else if (command.equalsIgnoreCase("SETACL")) {  
  +                return true;
  +
  +            } else if (command.equalsIgnoreCase("SETACL")) {
                   ACLMailbox target = null;
                   if (arguments != 5) {
                       out.println(tag + SP + BAD + SP +
  @@ -523,23 +523,23 @@
                   folder =  getFullName(commandLine.nextToken());
                   String identity = commandLine.nextToken();
                   String changes = commandLine.nextToken();
  -                
  +
                   if ( (state == SELECTED && currentFolder.equals(folder))) {
                       target = currentMailbox;
                   } else {
                       target = getBox(user, folder);
                       if (target == null) return true;
                   }
  -                
  +
                   try {
                       if (target.setRights(user, identity, changes)) {
  -                        out.println(tag + SP + OK + SP 
  +                        out.println(tag + SP + OK + SP
                                       + "SetACL command completed");
                           securityLogger.info("ACL rights for "  + identity + " in "
                                               + folder  + " changed by " + user + " : "
                                               +  changes);
                       } else {
  -                        out.println(tag + SP + NO + SP 
  +                        out.println(tag + SP + NO + SP
                                       + "SetACL command failed");
                           securityLogger.info("Failed attempt to change ACL rights for "
                                               + identity + " in " + folder  + " by "
  @@ -560,8 +560,8 @@
                   }
                   return true;
   
  -                
  -            } else if (command.equalsIgnoreCase("DELETEACL")) {  
  +
  +            } else if (command.equalsIgnoreCase("DELETEACL")) {
                   ACLMailbox target = null;
                   if (arguments != 4) {
                       out.println(tag + SP + BAD + SP +
  @@ -571,14 +571,14 @@
                   folder =  getFullName(commandLine.nextToken());
                   String identity = commandLine.nextToken();
                   String changes = "";
  -                
  +
                   if ( (state == SELECTED && currentFolder.equals(folder))) {
                       target = currentMailbox;
                   } else {
                       target = getBox(user, folder);
                       if (target == null) return true;
                   }
  -                
  +
                   try {
                       if (target.setRights(user, identity, changes)) {
                           out.println(tag + SP + OK + SP
  @@ -586,7 +586,7 @@
                           securityLogger.info("ACL rights for "  + identity + " in "
                                               + folder + " deleted by " + user);
                       } else {
  -                        out.println(tag + SP + NO + SP 
  +                        out.println(tag + SP + NO + SP
                                       + "SetACL command failed");
                           securityLogger.info("Failed attempt to change ACL rights for "
                                               + identity + " in " + folder  + " by "
  @@ -606,8 +606,8 @@
                       checkExpunge();
                   }
                   return true;
  -        
  -            } else if (command.equalsIgnoreCase("LISTRIGHTS")) { 
  +
  +            } else if (command.equalsIgnoreCase("LISTRIGHTS")) {
                   ACLMailbox target = null;
                   if (arguments != 4) {
                       out.println(tag + SP + BAD_LISTRIGHTS_MSG);
  @@ -626,9 +626,9 @@
                       out.println(UNTAGGED + SP + "LISTRIGHTS "
                                   + target.getName() + SP + identity + SP
                                   + target.getRequiredRights(user, identity)
  -                                + SP 
  +                                + SP
                                   + target.getOptionalRights(user, identity));
  -                    out.println(tag + SP + OK + SP 
  +                    out.println(tag + SP + OK + SP
                                   + "ListRights command completed");
                   } catch (AccessControlException ace) {
                       out.println(tag + SP + NO + SP + "Unknown mailbox");
  @@ -644,7 +644,7 @@
                       checkExpunge();
                   }
                   return true;
  -        
  +
               } else if (command.equalsIgnoreCase("MYRIGHTS")) {
                   ACLMailbox target = null;
                   if (arguments != 3) {
  @@ -678,11 +678,11 @@
                       checkSize();
                       checkExpunge();
                   }
  -                return true;   
  -            
  -                
  +                return true;
  +
  +
                   // Standard IMAP commands --------------------------
  -                
  +
               } else if (command.equalsIgnoreCase("SELECT")
                          || command.equalsIgnoreCase("EXAMINE")) {
                   // selecting a mailbox deselects current mailbox,
  @@ -694,10 +694,10 @@
                       currentMailbox = null;
                       currentIsReadOnly = false;
                   }
  -                
  +
                   if (arguments != 3) {
                       if (command.equalsIgnoreCase("SELECT") ){
  -                        out.println(tag + SP + BAD + SP 
  +                        out.println(tag + SP + BAD + SP
                                       + "Command should be <tag> <SELECT> <mailbox>");
                       } else {
                           out.println(tag + SP + BAD + SP
  @@ -705,7 +705,7 @@
                       }
                       return true;
                   }
  -                
  +
                   folder =  getFullName(commandLine.nextToken());
                   currentMailbox = getBox(user,  folder);
                   if (currentMailbox == null) {
  @@ -713,7 +713,7 @@
                   }
                   try { // long tries clause against an AccessControlException
                       if (!currentMailbox.hasReadRights(user)) {
  -                        out.println(tag + SP + NO + SP 
  +                        out.println(tag + SP + NO + SP
                                       + "Read access not granted." );
                           return true;
                       }
  @@ -724,7 +724,7 @@
                               return true;
                           }
                       }
  -                
  +
                       // Have mailbox with at least read rights. Server setup.
                       currentMailbox.addMailboxEventListener(this);
                       currentFolder = folder;
  @@ -732,11 +732,11 @@
                       exists = -1;
                       recent = -1;
                       getLogger().debug("Current folder for user "  + user + " from "
  -                                 + remoteHost  + "(" + remoteIP  + ") is "
  -                                 + currentFolder);
  +                                      + remoteHost  + "(" + remoteIP  + ") is "
  +                                      + currentFolder);
   
                       // Inform client
  -                    out.println(UNTAGGED + SP + "FLAGS (" 
  +                    out.println(UNTAGGED + SP + "FLAGS ("
                                   + currentMailbox.getSupportedFlags() + ")" );
                       if (!currentMailbox.allFlags(user)) {
                           out.println(UNTAGGED + SP + OK + " [PERMANENTFLAGS ("
  @@ -757,11 +757,11 @@
   
                       if (command.equalsIgnoreCase("EXAMINE")) {
                           currentIsReadOnly = true;
  -                        
  +
                           out.println(tag + SP + OK + SP
                                       + "[READ-ONLY] Examine completed");
                           return true;
  -                        
  +
                       } else if (currentMailbox.isReadOnly(user)) {
                           currentIsReadOnly = true;
                           out.println(tag + SP + OK + SP
  @@ -801,7 +801,7 @@
                   } catch (MailboxException mbe) {
                       if (mbe.isRemote()) {
                           out.println(tag + SP + NO + SP + "[REFERRAL "
  -                                    + mbe.getRemoteServer() +"]" 
  +                                    + mbe.getRemoteServer() +"]"
                                       + SP + "Wrong server. Try remote." );
                       } else  {
                           out.println(tag + SP + NO + SP + mbe.getStatus() );
  @@ -839,7 +839,7 @@
                           out.println(tag + SP + NO + SP
                                       + "Delete failed, unknown error");
                           getLogger().info("Attempt to delete mailbox " + folder
  -                                    + " by user " + user + " failed.");
  +                                         + " by user " + user + " failed.");
                       }
                   } catch (MailboxException mbe) {
                       if (mbe.getStatus().equals(MailboxException.NOT_LOCAL)) {
  @@ -881,8 +881,8 @@
                           out.println(tag + SP + NO + SP
                                       + "Rename failed, unknown error");
                           getLogger().info("Attempt to rename mailbox " + folder
  -                                    + " to " + newName
  -                                    + " by user " + user + " failed.");
  +                                         + " to " + newName
  +                                         + " by user " + user + " failed.");
                       }
                   } catch (MailboxException mbe) {
                       if (mbe.getStatus().equals(MailboxException.NOT_LOCAL)) {
  @@ -892,7 +892,7 @@
                       }
                       return true;
                   } catch (AuthorizationException aze) {
  -                    out.println(tag + SP + NO + SP 
  +                    out.println(tag + SP + NO + SP
                                   + "You do not have the rights to delete mailbox: " + folder);
                       return true;
                   }
  @@ -910,18 +910,18 @@
                       return true;
                   }
                   folder =  getFullName(commandLine.nextToken());
  -        
  +
                   try {
                       if( imapHost.subscribe(user, folder) ) {
  -                        out.println(tag + SP + OK + SP 
  +                        out.println(tag + SP + OK + SP
                                       + "Subscribe completed");
                       } else {
                           out.println(tag + SP + NO + SP + "Unknown error." );
                       }
                   } catch (MailboxException mbe) {
                       if (mbe.isRemote()) {
  -                        out.println(tag + SP + NO + SP + "[REFERRAL " 
  -                                    + mbe.getRemoteServer() +"]" 
  +                        out.println(tag + SP + NO + SP + "[REFERRAL "
  +                                    + mbe.getRemoteServer() +"]"
                                       + SP + "Wrong server. Try remote." );
                       } else  {
                           out.println(tag + SP + NO + SP + "No such mailbox" );
  @@ -945,18 +945,18 @@
                       return true;
                   }
                   folder =  getFullName(commandLine.nextToken());
  -        
  +
                   try {
                       if( imapHost.unsubscribe(user, folder) ) {
  -                        out.println(tag + SP + OK + SP 
  +                        out.println(tag + SP + OK + SP
                                       + "Unsubscribe completed");
                       } else {
                           out.println(tag + SP + NO + SP + "Unknown error." );
                       }
                   } catch (MailboxException mbe) {
                       if (mbe.isRemote()) {
  -                        out.println(tag + SP + NO + SP + "[REFERRAL " 
  -                                    + mbe.getRemoteServer() +"]" 
  +                        out.println(tag + SP + NO + SP + "[REFERRAL "
  +                                    + mbe.getRemoteServer() +"]"
                                       + SP + "Wrong server. Try remote." );
                       } else  {
                           out.println(tag + SP + NO + SP + "No such mailbox" );
  @@ -1002,7 +1002,7 @@
                                                     subscribeOnly);
                       if (list == null) {
                           getLogger().debug(tag + SP + NO + SP + command
  -                                     + " unable to interpret mailbox");
  +                                          + " unable to interpret mailbox");
                           out.println(tag + SP + NO + SP + command
                                       + " unable to interpret mailbox");
                       } else if (list.size() == 0) {
  @@ -1016,7 +1016,7 @@
                               out.println(UNTAGGED + SP + command.toUpperCase()
                                           + SP + listResponse);
                               getLogger().debug(UNTAGGED + SP + command.toUpperCase()
  -                                         + SP + listResponse);
  +                                              + SP + listResponse);
                           }
                           out.println(tag + SP + OK + SP + command
                                       + " completed");
  @@ -1024,7 +1024,7 @@
                   } catch (MailboxException mbe) {
                       if (mbe.isRemote()) {
                           out.println(tag + SP + NO + SP + "[REFERRAL "
  -                                    + mbe.getRemoteServer() +"]" 
  +                                    + mbe.getRemoteServer() +"]"
                                       + SP + "Wrong server. Try remote." );
                       } else  {
                           out.println(tag + SP + NO + SP
  @@ -1036,7 +1036,7 @@
                       logACE(ace);
                       return true;
                   }
  -            
  +
                   if (state == SELECTED ) {
                       checkSize();
                       checkExpunge();
  @@ -1078,7 +1078,7 @@
                   } catch (MailboxException mbe) {
                       if (mbe.isRemote()) {
                           out.println(tag + SP + NO + SP + "[REFERRAL "
  -                                    + mbe.getRemoteServer() +"]" 
  +                                    + mbe.getRemoteServer() +"]"
                                       + SP + "Wrong server. Try remote." );
                       } else  {
                           out.println(tag + SP + NO + SP
  @@ -1104,9 +1104,9 @@
                   }
   
               }
  -                
  +
           } // end of Auth & Selected
  -         
  +
           // Commands valid only in Authenticated State
           // None
           if (state == AUTHENTICATED) {
  @@ -1114,9 +1114,9 @@
                           + "Command not valid in this state");
               return true;
           }
  -        
  +
           // Commands valid only in Selected state
  -        // CHECK       
  +        // CHECK
           if (state == SELECTED) {
               if (command.equalsIgnoreCase("CHECK")) {
                   if (currentMailbox.checkpoint()) {
  @@ -1161,7 +1161,7 @@
                   }
                   try { // long tries clause against an AccessControlException
                       if (!currentMailbox.hasInsertRights(user)) {
  -                        out.println(tag + SP + NO + SP 
  +                        out.println(tag + SP + NO + SP
                                       + "Insert access not granted." );
                           return true;
                       }
  @@ -1260,15 +1260,15 @@
                   // Other commands for selected state .....
                   out.println(tag + SP + BAD + SP + "Protocol error");
                   return true;
  -                
  +
               } // end state SELECTED
           }
           // Shouldn't happen
           out.println(tag + SP + BAD + SP + "Protocol error");
           return true;
  -        
  +
       } // end of parseCommand
  -    
  +
       public void stop() {
           // todo
           getLogger().error("Stop IMAPHandler");
  @@ -1279,7 +1279,7 @@
               checkMailboxFlag = true;
           }
       }
  -    
  +
       private ACLMailbox getBox(String user, String mailboxName) {
           ACLMailbox tempMailbox = null;
           try {
  @@ -1290,16 +1290,16 @@
               } else {
                   out.println(tag + SP + NO + SP + "Unknown mailbox" );
                   getLogger().info("MailboxException in method getBox for user: "
  -                            + user + " mailboxName: " + mailboxName + " was "
  -                            + me.getMessage());
  +                                 + user + " mailboxName: " + mailboxName + " was "
  +                                 + me.getMessage());
               }
  -            
  +
           } catch (AccessControlException e) {
               out.println(tag + SP + NO + SP + "Unknown mailbox" );
  -        } 
  +        }
           return tempMailbox;
       }
  -    
  +
       private String getFullName(String name) {
           getLogger().debug("Method getFullName called for " + name);
           name = decodeAstring(name);
  
  
  
  1.14      +18 -18    jakarta-james/src/org/apache/james/mailrepository/AvalonMailRepository.java
  
  Index: AvalonMailRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/mailrepository/AvalonMailRepository.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AvalonMailRepository.java	2001/04/08 00:30:28	1.13
  +++ AvalonMailRepository.java	2001/04/19 04:06:51	1.14
  @@ -10,23 +10,23 @@
   import java.io.InputStream;
   import java.io.OutputStream;
   import java.util.Iterator;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.Component;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  +import org.apache.avalon.component.Component;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
   import org.apache.avalon.configuration.DefaultConfiguration;
  -import org.apache.james.util.Lock;
  -import org.apache.james.util.LockException;
  +import org.apache.avalon.logger.AbstractLoggable;
  +import org.apache.cornerstone.services.store.ObjectRepository;
   import org.apache.cornerstone.services.store.Store;
   import org.apache.cornerstone.services.store.StreamRepository;
  -import org.apache.cornerstone.services.store.ObjectRepository;
   import org.apache.james.core.MailImpl;
   import org.apache.james.services.MailRepository;
   import org.apache.james.services.MailStore;
  +import org.apache.james.util.Lock;
  +import org.apache.james.util.LockException;
   
   /**
    * Implementation of a MailRepository on a FileSystem.
  @@ -36,14 +36,14 @@
    *              type="MAIL"
    *              model="SYNCHRONOUS"/>
    * Requires a logger called MailRepository.
  - * 
  + *
    * @version 1.0.0, 24/04/1999
    * @author  Federico Barbieri <sc...@pop.systemy.it>
    * @author Charles Benett <ch...@benett1.demon.co.uk>
    */
  -public class AvalonMailRepository 
  +public class AvalonMailRepository
       extends AbstractLoggable
  -    implements MailRepository, Component, Configurable, Composer {
  +    implements MailRepository, Component, Configurable, Composable {
   
       protected Lock lock;
       private static final String TYPE = "MAIL";
  @@ -57,22 +57,22 @@
           destination = conf.getAttribute("destinationURL");
           String checkType = conf.getAttribute("type");
           if (! (checkType.equals("MAIL") || checkType.equals("SPOOL")) ) {
  -            getLogger().warn( "Attempt to configure AvalonMailRepository as " + 
  +            getLogger().warn( "Attempt to configure AvalonMailRepository as " +
                                 checkType);
               throw new ConfigurationException("Attempt to configure AvalonMailRepository as " + checkType);
           }
           // ignore model
       }
   
  -    public void compose( final ComponentManager componentManager ) 
  -        throws ComponentManagerException {
  +    public void compose( final ComponentManager componentManager )
  +        throws ComponentException {
           try {
               store = (Store)componentManager.
                   lookup( "org.apache.cornerstone.services.store.Store" );
   
               //prepare Configurations for object and stream repositories
               DefaultConfiguration objectConfiguration
  -                = new DefaultConfiguration( "repository", 
  +                = new DefaultConfiguration( "repository",
                                               "generated:AvalonFileRepository.compose()" );
   
               objectConfiguration.addAttribute("destinationURL", destination);
  @@ -80,20 +80,20 @@
               objectConfiguration.addAttribute("model", "SYNCHRONOUS");
   
               DefaultConfiguration streamConfiguration
  -                = new DefaultConfiguration( "repository", 
  +                = new DefaultConfiguration( "repository",
                                               "generated:AvalonFileRepository.compose()" );
   
               streamConfiguration.addAttribute( "destinationURL", destination );
               streamConfiguration.addAttribute( "type", "STREAM" );
               streamConfiguration.addAttribute( "model", "SYNCHRONOUS" );
  -            
  +
               sr = (StreamRepository) store.select(streamConfiguration);
               or = (ObjectRepository) store.select(objectConfiguration);
               lock = new Lock();
           } catch (Exception e) {
               final String message = "Failed to retrieve Store component:" + e.getMessage();
               getLogger().error( message, e );
  -            throw new ComponentManagerException( message, e );
  +            throw new ComponentException( message, e );
           }
       }
   
  
  
  
  1.12      +7 -7      jakarta-james/src/org/apache/james/mailrepository/TownSpoolRepository.java
  
  Index: TownSpoolRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/mailrepository/TownSpoolRepository.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TownSpoolRepository.java	2001/04/08 00:30:28	1.11
  +++ TownSpoolRepository.java	2001/04/19 04:06:51	1.12
  @@ -21,16 +21,16 @@
   import java.util.Set;
   import java.util.StringTokenizer;
   import javax.mail.internet.MimeMessage;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.Component;
  +import org.apache.avalon.component.Component;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.james.util.Lock;
  -import org.apache.james.util.LockException;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.james.core.JamesMimeMessage;
   import org.apache.james.core.MailImpl;
   import org.apache.james.services.SpoolRepository;
  +import org.apache.james.util.Lock;
  +import org.apache.james.util.LockException;
   import org.apache.mailet.Mail;
   import org.apache.mailet.MailAddress;
   
  @@ -49,7 +49,7 @@
    * <br>Model is currently not used and may be dropped
    * <br>conn is the location of the ...(Serge)
    * <br>table is the name of the table in the Database to be used
  - * 
  + *
    * <p>Requires a logger called MailRepository.
    *
    * @version 1.0.0, 24/04/1999
  @@ -58,7 +58,7 @@
   public class TownSpoolRepository
       extends AbstractLoggable
       implements SpoolRepository, Component, Configurable {
  -  
  +
       private Lock lock;
       private String destination;
       private String repositoryName;
  @@ -71,7 +71,7 @@
           repositoryName = destination.substring(destination.indexOf("//") + 2);
           String checkType = conf.getAttribute("type");
           if (! (checkType.equals("MAIL") || checkType.equals("SPOOL")) ) {
  -            final String message = 
  +            final String message =
                   "Attempt to configure TownSpoolRepository as " + checkType;
               getLogger().warn( message );
               throw new ConfigurationException( message );
  
  
  
  1.2       +2 -2      jakarta-james/src/org/apache/james/nntpserver/ArticleWriter.java
  
  Index: ArticleWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/ArticleWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ArticleWriter.java	2001/04/10 16:02:11	1.1
  +++ ArticleWriter.java	2001/04/19 04:06:53	1.2
  @@ -19,7 +19,7 @@
   // STAT - does not write anything
   interface ArticleWriter {
       void write(NNTPArticle article);
  -    static class Factory {
  +    class Factory {
           static ArticleWriter ARTICLE(final PrintWriter prt) {
               return new ArticleWriter() {
                       public void write(NNTPArticle article) {
  @@ -57,4 +57,4 @@
                   };
           }
       } // class Factory
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +47 -47    jakarta-james/src/org/apache/james/nntpserver/AuthState.java
  
  Index: AuthState.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/AuthState.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AuthState.java	2001/04/10 16:02:12	1.1
  +++ AuthState.java	2001/04/19 04:06:53	1.2
  @@ -1,47 +1,47 @@
  -/*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  - *
  - * This software is published under the terms of the Apache Software License
  - * version 1.1, a copy of which has been included with this distribution in
  - * the LICENSE file.
  - */
  -package org.apache.james.nntpserver;
  -
  -import java.io.PrintWriter;
  -import java.io.OutputStreamWriter;
  -import java.io.Writer;
  -import java.io.OutputStream;
  -import org.apache.james.services.UsersRepository;
  -
  -/**
  - * @version 1.0.0, 31/03/2001
  - * @author  Harmeet
  - *
  - * implements the authentication state. Should this be moved to a more common place ??
  - * Should there be an authenication service, that manufactures and hands to the different 
  - * protocol servers AuthState objects.
  - */
  -public class AuthState {
  -    private final boolean requiredAuth;
  -    private final UsersRepository repo;
  -    private String user;
  -    private String password;
  -    public AuthState(boolean requiredAuth,UsersRepository repo) {
  -        this.requiredAuth = requiredAuth;
  -        this.repo = repo;
  -    }
  -
  -    public boolean isAuthenticated() {
  -        if ( requiredAuth )
  -            return repo.test(user,password);
  -        else
  -            return true;
  -    }
  -    public void setUser(String user) {
  -        this.user = user;
  -        this.password = null;
  -    }
  -    public void setPassword(String password) {
  -        this.password = password;
  -    }
  -}
  \ No newline at end of file
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
  +package org.apache.james.nntpserver;
  +
  +import java.io.OutputStream;
  +import java.io.OutputStreamWriter;
  +import java.io.PrintWriter;
  +import java.io.Writer;
  +import org.apache.james.services.UsersRepository;
  +
  +/**
  + * @version 1.0.0, 31/03/2001
  + * @author  Harmeet
  + *
  + * implements the authentication state. Should this be moved to a more common place ??
  + * Should there be an authenication service, that manufactures and hands to the different
  + * protocol servers AuthState objects.
  + */
  +public class AuthState {
  +    private final boolean requiredAuth;
  +    private final UsersRepository repo;
  +    private String user;
  +    private String password;
  +    public AuthState(boolean requiredAuth,UsersRepository repo) {
  +        this.requiredAuth = requiredAuth;
  +        this.repo = repo;
  +    }
  +
  +    public boolean isAuthenticated() {
  +        if ( requiredAuth )
  +            return repo.test(user,password);
  +        else
  +            return true;
  +    }
  +    public void setUser(String user) {
  +        this.user = user;
  +        this.password = null;
  +    }
  +    public void setPassword(String password) {
  +        this.password = password;
  +    }
  +}
  
  
  
  1.2       +2 -2      jakarta-james/src/org/apache/james/nntpserver/LISTGroup.java
  
  Index: LISTGroup.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/LISTGroup.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LISTGroup.java	2001/04/10 16:02:12	1.1
  +++ LISTGroup.java	2001/04/19 04:06:53	1.2
  @@ -14,7 +14,7 @@
   // LIST command paramter
   interface LISTGroup {
       void show(NNTPGroup group);
  -    static class Factory {
  +    class Factory {
           static LISTGroup ACTIVE(final PrintWriter prt) {
               return new LISTGroup() {
                       public void show(NNTPGroup group) {
  @@ -32,4 +32,4 @@
                   };
           }
       } // class Factory
  -}
  \ No newline at end of file
  +}
  
  
  
  1.3       +30 -30    jakarta-james/src/org/apache/james/nntpserver/NNTPHandler.java
  
  Index: NNTPHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/NNTPHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NNTPHandler.java	2001/04/17 03:16:34	1.2
  +++ NNTPHandler.java	2001/04/19 04:06:54	1.3
  @@ -24,21 +24,21 @@
   import java.util.List;
   import java.util.StringTokenizer;
   import java.util.Vector;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Context;
  -import org.apache.avalon.Contextualizable;
   import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.excalibur.collections.ListUtils;
  +import org.apache.avalon.context.Context;
  +import org.apache.avalon.context.Contextualizable;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.cornerstone.services.connection.ConnectionHandler;
   import org.apache.cornerstone.services.scheduler.PeriodicTimeTrigger;
   import org.apache.cornerstone.services.scheduler.Target;
   import org.apache.cornerstone.services.scheduler.TimeScheduler;
  +import org.apache.excalibur.collections.ListUtils;
   import org.apache.james.Constants;
   import org.apache.james.nntpserver.repository.NNTPArticle;
   import org.apache.james.nntpserver.repository.NNTPGroup;
  @@ -59,7 +59,7 @@
    * @author Harmeet <hb...@apache.org>
    */
   public class NNTPHandler extends AbstractLoggable
  -    implements ConnectionHandler, Contextualizable, Composer, Configurable, Target {
  +    implements ConnectionHandler, Contextualizable, Composable, Configurable, Target {
   
       // timeout controllers
       private TimeScheduler scheduler;
  @@ -95,8 +95,8 @@
           authState = new AuthState(authRequired,users);
       }
   
  -    public void compose( final ComponentManager componentManager ) 
  -        throws ComponentManagerException 
  +    public void compose( final ComponentManager componentManager )
  +        throws ComponentException
       {
           //System.out.println(getClass().getName()+": compose - "+authRequired);
           UsersStore usersStore = (UsersStore)componentManager.
  @@ -169,7 +169,7 @@
           return allowed;
       }
       private boolean parseCommand(String commandRaw) {
  -        if (commandRaw == null) 
  +        if (commandRaw == null)
               return false;
           getLogger().info("Command received: " + commandRaw);
           //System.out.println("NNTPHandler> "+commandRaw);
  @@ -180,15 +180,15 @@
           final String command = tokens.nextToken();
   
           //System.out.println("allowed="+isAllowed(command)+","+authState.isAuthenticated());
  -        if ( isAllowed(command) == false ) 
  +        if ( isAllowed(command) == false )
               return true;
  -        if ( command.equalsIgnoreCase("MODE") && tokens.hasMoreTokens() && 
  +        if ( command.equalsIgnoreCase("MODE") && tokens.hasMoreTokens() &&
                tokens.nextToken().equalsIgnoreCase("READER") )
               doMODEREADER();
  -        else if ( command.equalsIgnoreCase("LIST") && tokens.hasMoreTokens() && 
  +        else if ( command.equalsIgnoreCase("LIST") && tokens.hasMoreTokens() &&
                     tokens.nextToken().equalsIgnoreCase("EXTENSIONS") )
               doLISTEXTENSIONS();
  -        else if ( command.equalsIgnoreCase("LIST") && tokens.hasMoreTokens() && 
  +        else if ( command.equalsIgnoreCase("LIST") && tokens.hasMoreTokens() &&
                     tokens.nextToken().equalsIgnoreCase("OVERVIEW.FMT") )
               doLISTOVERVIEWFMT();
           else if ( command.equalsIgnoreCase("GROUP") )
  @@ -239,7 +239,7 @@
       }
   
       // implements only the originnal AUTHINFO
  -    // for simple and generic AUTHINFO, 501 is sent back. This is as 
  +    // for simple and generic AUTHINFO, 501 is sent back. This is as
       // per article 3.1.3 of RFC 2980
       private void doAUTHINFO(StringTokenizer tok) {
           String command = tok.nextToken();
  @@ -269,8 +269,8 @@
               writer.println(((NNTPGroup)iter.next()).getName());
           writer.println(".");
       }
  -    // returns the date from @param input. 
  -    // The input tokens are assumed to be in format date time [GMT|UTC] . 
  +    // returns the date from @param input.
  +    // The input tokens are assumed to be in format date time [GMT|UTC] .
       // 'date' is in format [XX]YYMMDD. 'time' is in format 'HHMMSS'
       // NOTE: This routine would do with some format checks.
       private Date getDateFrom(StringTokenizer tok) {
  @@ -280,20 +280,20 @@
           Date d = new Date();
           DateFormat df = ( date.length() == 8 ) ? DF_DATEFROM_LONG : DF_DATEFROM_SHORT;
           try {
  -        Date dt = df.parse(date+" "+time);
  -        if ( utc )
  -            dt = new Date(dt.getTime()+UTC_OFFSET);
  -        return dt;
  +            Date dt = df.parse(date+" "+time);
  +            if ( utc )
  +                dt = new Date(dt.getTime()+UTC_OFFSET);
  +            return dt;
           } catch ( ParseException pe ) {
               throw new NNTPException("date extraction failed: "+date+","+time+","+utc);
           }
       }
  -    
  +
       private void doHELP() {
           writer.println("100 Help text follows");
           writer.println(".");
       }
  -    
  +
       // used to calculate DATE from - see 11.3
       public static final DateFormat DF_DATEFROM_LONG = new SimpleDateFormat("yyyyMMdd HHmmss");
       public static final DateFormat DF_DATEFROM_SHORT = new SimpleDateFormat("yyMMdd HHmmss");
  @@ -445,7 +445,7 @@
                              group.getFirstArticleNumber()+" "+
                              group.getLastArticleNumber()+" "+
                              group.getName()+" group selected");
  -            
  +
       }
       private void doLISTEXTENSIONS() {
           // 8.1.1
  @@ -461,7 +461,7 @@
   
       private void doMODEREADER() {
           // 7.2
  -        writer.println(repo.isReadOnly() 
  +        writer.println(repo.isReadOnly()
                          ? "201 Posting Not Permitted" : "200 Posting Permitted");
       }
   
  @@ -479,7 +479,7 @@
           }
           if ( group != null ) {
               writer.println("211 list of article numbers follow");
  -            
  +
               for (Iterator iter = group.getArticles();iter.hasNext();) {
                   NNTPArticle article = (NNTPArticle)iter.next();
                   writer.println(article.getArticleNumber());
  @@ -524,16 +524,16 @@
           }
       }
       // returns the list of articles that match the range.
  -    // @return null indicates insufficient information to 
  +    // @return null indicates insufficient information to
       // fetch the list of articles
       private NNTPArticle[] getRange(String range) {
           // check for msg id
           if ( range != null && range.startsWith("<") ) {
               NNTPArticle article = repo.getArticleFromID(range);
  -            return ( article == null ) 
  +            return ( article == null )
                   ? new NNTPArticle[0] : new NNTPArticle[] { article };
           }
  -        
  +
           if ( group == null )
               return null;
           if ( range == null )
  
  
  
  1.2       +11 -11    jakarta-james/src/org/apache/james/nntpserver/NNTPServer.java
  
  Index: NNTPServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/NNTPServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NNTPServer.java	2001/04/10 16:02:12	1.1
  +++ NNTPServer.java	2001/04/19 04:06:54	1.2
  @@ -9,11 +9,11 @@
   
   import java.net.InetAddress;
   import java.net.UnknownHostException;
  -import org.apache.avalon.Component;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.DefaultComponentManager;
   import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.Component;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.DefaultComponentManager;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
   import org.apache.cornerstone.services.connection.AbstractService;
  @@ -33,21 +33,21 @@
       }
   
       public void configure( final Configuration configuration )
  -        throws ConfigurationException 
  +        throws ConfigurationException
       {
           //System.out.println(getClass().getName()+": configure");
           m_port = configuration.getChild( "port" ).getValueAsInt( 119 );
   
  -        try { 
  +        try {
               String bindAddress = configuration.getChild( "bind" ).getValue( null );
  -            if( null != bindAddress ) 
  -                m_bindTo = InetAddress.getByName( bindAddress ); 
  +            if( null != bindAddress )
  +                m_bindTo = InetAddress.getByName( bindAddress );
           } catch( final UnknownHostException unhe ) {
               throw new ConfigurationException( "Malformed bind parameter", unhe );
           }
   
           final String useTLS = configuration.getChild("useTLS").getValue( "" );
  -        if( useTLS.equals( "TRUE" ) ) 
  +        if( useTLS.equals( "TRUE" ) )
               m_serverSocketType = "ssl";
   
           repository = (Component)NNTPUtil.createInstance
  @@ -59,7 +59,7 @@
       }
   
       public void compose( final ComponentManager componentManager )
  -        throws ComponentManagerException
  +        throws ComponentException
       {
           //System.out.println(getClass().getName()+": compose");
           DefaultComponentManager mgr = new DefaultComponentManager(componentManager);
  @@ -73,4 +73,4 @@
           if ( repository instanceof Initializable )
               ((Initializable)repository).init();
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.3       +3 -3      jakarta-james/src/org/apache/james/nntpserver/repository/NNTPRepository.java
  
  Index: NNTPRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/repository/NNTPRepository.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NNTPRepository.java	2001/04/17 03:16:35	1.2
  +++ NNTPRepository.java	2001/04/19 04:06:57	1.3
  @@ -7,13 +7,13 @@
    */
   package org.apache.james.nntpserver.repository;
   
  +import java.io.*;
  +import java.util.*;
   import org.apache.avalon.Initializable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.avalon.AbstractLoggable;
  -import java.util.*;
  -import java.io.*;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.excalibur.io.AndFileFilter;
   import org.apache.excalibur.io.DirectoryFileFilter;
   import org.apache.oro.io.GlobFilenameFilter;
  
  
  
  1.3       +9 -9      jakarta-james/src/org/apache/james/nntpserver/repository/NNTPRepositoryImpl.java
  
  Index: NNTPRepositoryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/repository/NNTPRepositoryImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NNTPRepositoryImpl.java	2001/04/17 03:16:35	1.2
  +++ NNTPRepositoryImpl.java	2001/04/19 04:06:57	1.3
  @@ -7,21 +7,21 @@
    */
   package org.apache.james.nntpserver.repository;
   
  +import java.io.*;
  +import java.util.*;
   import org.apache.avalon.Initializable;
  -import org.apache.avalon.Component;
  +import org.apache.avalon.component.Component;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.avalon.AbstractLoggable;
  -import java.util.*;
  -import java.io.*;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.excalibur.io.AndFileFilter;
   import org.apache.excalibur.io.DirectoryFileFilter;
  -import org.apache.oro.io.GlobFilenameFilter;
  -import org.apache.james.nntpserver.NNTPException;
   import org.apache.james.nntpserver.DateSinceFileFilter;
  +import org.apache.james.nntpserver.NNTPException;
  +import org.apache.oro.io.GlobFilenameFilter;
   
  -public class NNTPRepositoryImpl extends AbstractLoggable 
  +public class NNTPRepositoryImpl extends AbstractLoggable
       implements NNTPRepository, Configurable, Initializable, Component
   {
       private boolean readOnly;
  @@ -55,7 +55,7 @@
           if ( configuration != null ) {
               Configuration[] children = configuration.getChildren("newsgroup");
               if ( children != null )
  -                for ( int i = 0 ; i < children.length ; i++ ) 
  +                for ( int i = 0 ; i < children.length ; i++ )
                       addGroupsList.add(children[i].getValue());
           }
           addGroups = (String[])addGroupsList.toArray(new String[0]);
  @@ -76,7 +76,7 @@
           if ( articleIDPath.exists() == false )
               articleIDPath.mkdirs();
           if ( spool instanceof Initializable )
  -                ((Initializable)spool).init();
  +            ((Initializable)spool).init();
           getLogger().debug("repository initialization done");
       }
       public boolean isReadOnly() {
  
  
  
  1.3       +11 -11    jakarta-james/src/org/apache/james/nntpserver/repository/NNTPSpooler.java
  
  Index: NNTPSpooler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/repository/NNTPSpooler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NNTPSpooler.java	2001/04/17 03:16:35	1.2
  +++ NNTPSpooler.java	2001/04/19 04:06:57	1.3
  @@ -8,16 +8,16 @@
   package org.apache.james.nntpserver.repository;
   
   import java.io.*;
  -import org.apache.avalon.AbstractLoggable;
  +import java.util.*;
  +import javax.mail.internet.MimeMessage;
   import org.apache.avalon.Initializable;
  -import org.apache.avalon.Loggable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.james.util.Lock;
  +import org.apache.avalon.logger.AbstractLoggable;
  +import org.apache.avalon.logger.Loggable;
   import org.apache.excalibur.io.IOUtil;
  -import javax.mail.internet.MimeMessage;
  -import java.util.*;
  +import org.apache.james.util.Lock;
   
   // processes entries and sends to appropriate groups.
   // eats up inappropriate entries.
  @@ -72,8 +72,8 @@
           void setRepository(NNTPRepository repo) {
               this.repo = repo;
           }
  -        // the threads race to grab a lock. if a thread wins it processes the article, 
  -        // if it loses it tries to lock and process the next article 
  +        // the threads race to grab a lock. if a thread wins it processes the article,
  +        // if it loses it tries to lock and process the next article
           public void run() {
               getLogger().debug("in spool thread");
               while ( Thread.currentThread().isInterrupted() == false ) {
  @@ -94,7 +94,7 @@
                       }
                   getLogger().debug(" Sleeping...");
                   // this is good for other non idle threads
  -                try {  Thread.currentThread().sleep(threadIdleTime);   
  +                try {  Thread.currentThread().sleep(threadIdleTime);
                   } catch(InterruptedException ex) {  }
               }
           }
  @@ -106,7 +106,7 @@
                   FileInputStream fin = new FileInputStream(f);
                   msg = new MimeMessage(null,fin);
                   fin.close();
  -                
  +
                   // ensure no duplicates exist.
                   String[] idheader = msg.getHeader("Message-Id");
                   articleID = (idheader!=null && idheader.length>0?idheader[0]:null);
  @@ -132,11 +132,11 @@
                   if ( group == null ) {
                       getLogger().debug("group not found: "+headers[i]);
                       continue;
  -                } 
  +                }
                   int artNum = group.getLastArticleNumber();
                   File root = (File)group.getPath();
                   File articleFile = null;
  -                // this ensures that different threads do not create articles with 
  +                // this ensures that different threads do not create articles with
                   // same number
                   while( true ) {
                       articleFile = new File(root,(artNum+1)+"");
  
  
  
  1.2       +6 -6      jakarta-james/src/org/apache/james/nntpserver/repository/NNTPUtil.java
  
  Index: NNTPUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/repository/NNTPUtil.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NNTPUtil.java	2001/04/10 16:01:14	1.1
  +++ NNTPUtil.java	2001/04/19 04:06:58	1.2
  @@ -9,18 +9,18 @@
   
   import java.io.*;
   import org.apache.avalon.Initializable;
  -import org.apache.avalon.Loggable;
  -import org.apache.log.Logger;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.logger.Loggable;
   import org.apache.james.nntpserver.NNTPException;
  +import org.apache.log.Logger;
   
   // processes entries and sends to appropriate groups.
   // eats up inappropriate entries.
   public class NNTPUtil {
  -    static File getDirectory(Configuration configuration,String child) 
  -        throws ConfigurationException 
  +    static File getDirectory(Configuration configuration,String child)
  +        throws ConfigurationException
       {
           String str = configuration.getChild(child).getValue();
           File f = new File(str);
  @@ -31,14 +31,14 @@
           return f;
       }
       public static Object createInstance(Configuration configuration,Logger logger,
  -                                        String clsName) throws ConfigurationException 
  +                                        String clsName) throws ConfigurationException
       {
           try { clsName = configuration.getAttribute("class");
           } catch(ConfigurationException ce) { }
           try {
               Object obj = Class.forName(clsName).newInstance();
               if ( obj instanceof Loggable )
  -            ((Loggable)obj).setLogger( logger );
  +                ((Loggable)obj).setLogger( logger );
               if ( obj instanceof Configurable )
                   ((Configurable)obj).configure(configuration.getChild("configuration"));
               return obj;
  
  
  
  1.40      +17 -17    jakarta-james/src/org/apache/james/pop3server/POP3Handler.java
  
  Index: POP3Handler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/pop3server/POP3Handler.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- POP3Handler.java	2001/04/17 03:16:36	1.39
  +++ POP3Handler.java	2001/04/19 04:07:00	1.40
  @@ -19,21 +19,21 @@
   import java.util.StringTokenizer;
   import java.util.Vector;
   import javax.mail.MessagingException;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Context;
  -import org.apache.avalon.Contextualizable;
   import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.excalibur.collections.ListUtils;
  +import org.apache.avalon.context.Context;
  +import org.apache.avalon.context.Contextualizable;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.cornerstone.services.connection.ConnectionHandler;
   import org.apache.cornerstone.services.scheduler.PeriodicTimeTrigger;
   import org.apache.cornerstone.services.scheduler.Target;
   import org.apache.cornerstone.services.scheduler.TimeScheduler;
  +import org.apache.excalibur.collections.ListUtils;
   import org.apache.james.Constants;
   import org.apache.james.core.MailImpl;
   import org.apache.james.services.MailRepository;
  @@ -47,9 +47,9 @@
    * @author Federico Barbieri <sc...@systemy.it>
    * @version 0.9
    */
  -public class POP3Handler 
  +public class POP3Handler
       extends AbstractLoggable
  -    implements ConnectionHandler, Contextualizable, Composer, Configurable, Target {
  +    implements ConnectionHandler, Contextualizable, Composable, Configurable, Target {
   
       private String softwaretype        = "JAMES POP3 Server " + Constants.SOFTWARE_VERSION;
   
  @@ -84,13 +84,13 @@
           servername = (String)context.get( Constants.HELO_NAME );
       }
   
  -    public void configure( final Configuration configuration ) 
  +    public void configure( final Configuration configuration )
           throws ConfigurationException {
           timeout = configuration.getChild( "connectiontimeout" ).getValueAsInt( 120000 );
       }
   
  -    public void compose( final ComponentManager componentManager ) 
  -        throws ComponentManagerException {
  +    public void compose( final ComponentManager componentManager )
  +        throws ComponentException {
           mailServer = (MailServer)componentManager.
               lookup( "org.apache.james.services.MailServer" );
           UsersStore usersStore = (UsersStore)componentManager.
  @@ -108,7 +108,7 @@
        * @exception IOException if an error reading from socket occurs
        * @exception ProtocolException if an error handling connection occurs
        */
  -    public void handleConnection( Socket connection ) 
  +    public void handleConnection( Socket connection )
           throws IOException {
   
           try {
  @@ -119,7 +119,7 @@
               remoteHost = socket.getInetAddress ().getHostName ();
               remoteIP = socket.getInetAddress ().getHostAddress ();
           } catch (Exception e) {
  -            getLogger().error( "Cannot open connection from " + remoteHost + 
  +            getLogger().error( "Cannot open connection from " + remoteHost +
                                  " (" + remoteIP + "): " + e.getMessage(), e );
           }
   
  @@ -130,7 +130,7 @@
               scheduler.addTrigger( this.toString(), trigger, this );
               state = AUTHENTICATION_READY;
               user = "unknown";
  -            out.println( OK_RESPONSE + " " + this.servername + 
  +            out.println( OK_RESPONSE + " " + this.servername +
                            " POP3 server (" + this.softwaretype + ") ready " );
               while (parseCommand(in.readLine())) {
                   scheduler.resetTrigger(this.toString());
  @@ -142,7 +142,7 @@
           } catch (Exception e) {
               out.println(ERR_RESPONSE + " Error closing connection.");
               out.flush();
  -            getLogger().error( "Exception during connection from " + remoteHost + 
  +            getLogger().error( "Exception during connection from " + remoteHost +
                                  " (" + remoteIP + ") : " + e.getMessage(), e );
               try {
                   socket.close();
  @@ -394,7 +394,7 @@
                   out.println(ERR_RESPONSE + " Usage: RETR [mail number]");
                   return;
               }
  -            //?May be written as 
  +            //?May be written as
               //return parseCommand("TOP " + num + " " + Integer.MAX_VALUE);?
               try {
                   MailImpl mc = (MailImpl) userMailbox.elementAt(num);
  
  
  
  1.5       +19 -19    jakarta-james/src/org/apache/james/remotemanager/RemoteManagerHandler.java
  
  Index: RemoteManagerHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/remotemanager/RemoteManagerHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoteManagerHandler.java	2001/04/17 03:16:37	1.4
  +++ RemoteManagerHandler.java	2001/04/19 04:07:01	1.5
  @@ -7,25 +7,25 @@
    */
   package org.apache.james.remotemanager;
   
  -import org.apache.james.Constants;
   import java.io.*;
   import java.net.*;
   import java.util.*;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.Component;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  +import org.apache.avalon.component.Component;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.cornerstone.services.connection.ConnectionHandler;
  -import org.apache.cornerstone.services.scheduler.TimeScheduler;
   import org.apache.cornerstone.services.scheduler.PeriodicTimeTrigger;
   import org.apache.cornerstone.services.scheduler.Target;
  +import org.apache.cornerstone.services.scheduler.TimeScheduler;
  +import org.apache.james.Constants;
   import org.apache.james.services.MailServer;
  -import org.apache.james.services.UsersStore;
   import org.apache.james.services.UsersRepository;
  +import org.apache.james.services.UsersStore;
   
   /**
    * Provides a really rude network interface to administer James.
  @@ -38,9 +38,9 @@
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    *
    */
  -public class RemoteManagerHandler 
  +public class RemoteManagerHandler
       extends AbstractLoggable
  -    implements ConnectionHandler, Composer, Configurable, Target {
  +    implements ConnectionHandler, Composable, Configurable, Target {
   
       private UsersStore usersStore;
       private UsersRepository users;
  @@ -62,13 +62,13 @@
           final Configuration[] accounts = admin.getChildren( "account" );
           for ( int i = 0; i < accounts.length; i++ )
           {
  -            admaccount.put( accounts[ i ].getAttribute( "login" ), 
  +            admaccount.put( accounts[ i ].getAttribute( "login" ),
                               accounts[ i ].getAttribute( "password" ) );
           }
       }
   
       public void compose( final ComponentManager componentManager )
  -        throws ComponentManagerException {
  +        throws ComponentException {
   
           scheduler = (TimeScheduler)componentManager.
               lookup( "org.apache.cornerstone.services.scheduler.TimeScheduler" );
  @@ -87,15 +87,15 @@
        * @exception IOException if an error reading from socket occurs
        * @exception ProtocolException if an error handling connection occurs
        */
  -    public void handleConnection( final Socket connection ) 
  +    public void handleConnection( final Socket connection )
           throws IOException {
   
           /*
  -        if( admaccount.isEmpty() ) {
  -            getLogger().warn("No Administrative account defined");
  -            getLogger().warn("RemoteManager failed to be handled");
  -            return;
  -        } 
  +          if( admaccount.isEmpty() ) {
  +          getLogger().warn("No Administrative account defined");
  +          getLogger().warn("RemoteManager failed to be handled");
  +          return;
  +          }
           */
   
           final PeriodicTimeTrigger trigger = new PeriodicTimeTrigger( timeout, -1 );
  @@ -136,7 +136,7 @@
           } catch ( final IOException e ) {
               out.println("Error. Closing connection");
               out.flush();
  -            getLogger().error( "Exception during connection from " + remoteHost + 
  +            getLogger().error( "Exception during connection from " + remoteHost +
                                  " (" + remoteIP + ")");
           }
   
  
  
  
  1.2       +13 -19    jakarta-james/src/org/apache/james/smtpserver/MessageSizeException.java
  
  Index: MessageSizeException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/smtpserver/MessageSizeException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MessageSizeException.java	2001/02/09 14:59:50	1.1
  +++ MessageSizeException.java	2001/04/19 04:07:03	1.2
  @@ -1,16 +1,10 @@
  -
  -/*****************************************************************************
  -  * Copyright (C) The Apache Software Foundation. All rights reserved.    *
  -  * 
  -------------------------------------------------------------------------- *
  -  * This software is published under the terms of the Apache Software 
  -License *
  -  * version 1.1, a copy of which has been included  with this 
  -distribution in *
  -  * the LICENSE file. 
  -       *
  - 
  -*****************************************************************************/
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.smtpserver;
   
   import java.io.*;
  @@ -23,11 +17,11 @@
     */
   public class MessageSizeException extends IOException {
   
  -     /** Default constructor that sets the message indicating message 
  -size error.
  -      */
  -     public MessageSizeException() {
  -         super("Message size exceeds fixed maximum message size.");
  -     }
  +    /** Default constructor that sets the message indicating message
  +        size error.
  +    */
  +    public MessageSizeException() {
  +        super("Message size exceeds fixed maximum message size.");
  +    }
   }
   
  
  
  
  1.33      +19 -19    jakarta-james/src/org/apache/james/smtpserver/SMTPHandler.java
  
  Index: SMTPHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/smtpserver/SMTPHandler.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- SMTPHandler.java	2001/04/02 07:51:38	1.32
  +++ SMTPHandler.java	2001/04/19 04:07:03	1.33
  @@ -12,16 +12,16 @@
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Context;
  -import org.apache.avalon.Contextualizable;
   import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.context.Context;
  +import org.apache.avalon.context.Contextualizable;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.cornerstone.services.connection.ConnectionHandler;
   import org.apache.cornerstone.services.scheduler.PeriodicTimeTrigger;
   import org.apache.cornerstone.services.scheduler.Target;
  @@ -39,9 +39,9 @@
    * @author Federico Barbieri <sc...@systemy.it>
    * @version 0.9
    */
  -public class SMTPHandler 
  +public class SMTPHandler
       extends AbstractLoggable
  -    implements ConnectionHandler, Contextualizable, Composer, Configurable, Target  {
  +    implements ConnectionHandler, Contextualizable, Composable, Configurable, Target  {
   
       public final static String SERVER_NAME = "SERVER_NAME";
       public final static String SERVER_TYPE = "SERVER_TYPE";
  @@ -84,8 +84,8 @@
           servername = (String)context.get( Constants.HELO_NAME );
       }
   
  -    public void compose( final ComponentManager componentManager ) 
  -        throws ComponentManagerException {
  +    public void compose( final ComponentManager componentManager )
  +        throws ComponentException {
           mailServer = (MailServer)componentManager.lookup("org.apache.james.services.MailServer");
           scheduler = (TimeScheduler)componentManager.
               lookup("org.apache.cornerstone.services.scheduler.TimeScheduler");
  @@ -99,11 +99,11 @@
        * @exception IOException if an error reading from socket occurs
        * @exception ProtocolException if an error handling connection occurs
        */
  -    public void handleConnection( Socket connection ) 
  +    public void handleConnection( Socket connection )
           throws IOException {
           try {
               this.socket = connection;
  -            final InputStream bufferedInput = 
  +            final InputStream bufferedInput =
                   new BufferedInputStream( socket.getInputStream(), 1024 );
               in = new DataInputStream( bufferedInput );
               out = new InternetPrintWriter(socket.getOutputStream(), true);
  @@ -223,8 +223,8 @@
           } else {
               state.put(CURRENT_HELO_MODE, command);
               state.put(NAME_GIVEN, argument);
  -            out.println("250 " + state.get(SERVER_NAME) + " Hello " + argument + 
  -                        " (" + state.get(REMOTE_NAME) + 
  +            out.println("250 " + state.get(SERVER_NAME) + " Hello " + argument +
  +                        " (" + state.get(REMOTE_NAME) +
                           " [" + state.get(REMOTE_IP) + "])");
           }
       }
  @@ -234,7 +234,7 @@
       private void doMAIL(String command,String argument,String argument1) {
           if (state.containsKey(SENDER)) {
               out.println("503 Sender already specified");
  -        } else if (argument == null || !argument.equalsIgnoreCase("FROM") 
  +        } else if (argument == null || !argument.equalsIgnoreCase("FROM")
                      || argument1 == null) {
               out.println("501 Usage: MAIL FROM:<sender>");
           } else {
  @@ -327,7 +327,7 @@
                   if (!headers.isSet("From")) {
                       headers.setHeader("From", state.get(SENDER).toString());
                   }
  -                
  +
                   String received = "from " + state.get(REMOTE_NAME) + " ([" + state.get(REMOTE_IP)
                       + "])\r\n          by " + this.servername + " ("
                       + softwaretype + ") with SMTP ID " + state.get(SMTP_ID);
  @@ -339,11 +339,11 @@
                   }
                   received += ";\r\n          " + RFC822DateFormat.toString (new Date ());
                   headers.addHeader ("Received", received);
  -                
  +
                   // headers.setReceivedStamp("Unknown", (String) serverNames.elementAt(0));
                   ByteArrayInputStream headersIn = new ByteArrayInputStream(headers.toByteArray());
                   MailImpl mail = new MailImpl(mailServer.getId(), (MailAddress)state.get(SENDER),
  -                                             (Vector)state.get(RCPT_VECTOR), 
  +                                             (Vector)state.get(RCPT_VECTOR),
                                                new SequenceInputStream(headersIn, msgIn));
                   mail.setRemoteHost((String)state.get(REMOTE_NAME));
                   mail.setRemoteAddr((String)state.get(REMOTE_IP));
  @@ -364,7 +364,7 @@
       }
   
       private void doUnknownCmd(String command,String argument,String argument1) {
  -        out.println("500 " + state.get(SERVER_NAME) + " Syntax error, command unrecognized: " + 
  +        out.println("500 " + state.get(SERVER_NAME) + " Syntax error, command unrecognized: " +
                       command);
       }
   }
  
  
  
  1.2       +41 -51    jakarta-james/src/org/apache/james/smtpserver/SizeLimitedInputStream.java
  
  Index: SizeLimitedInputStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/smtpserver/SizeLimitedInputStream.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SizeLimitedInputStream.java	2001/02/09 14:59:51	1.1
  +++ SizeLimitedInputStream.java	2001/04/19 04:07:03	1.2
  @@ -1,63 +1,53 @@
  -
  -/*****************************************************************************
  -  * Copyright (C) The Apache Software Foundation. All rights reserved. 
  -       *
  -  * 
  -------------------------------------------------------------------------- *
  -  * This software is published under the terms of the Apache Software 
  -License *
  -  * version 1.1, a copy of which has been included  with this 
  -distribution in *
  -  * the LICENSE file. 
  -       *
  - 
  -*****************************************************************************/
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.smtpserver;
   
   import java.io.*;
   import org.apache.james.smtpserver.*;
   
   /** This class wraps an underlying input stream, limiting the allowable size
  -  * of an incoming MimeMessage. The size limit is configured in the conf 
  -file,
  +  * of an incoming MimeMessage. The size limit is configured in the conf file,
     * and when the limit is reached, a MessageSizeException is thrown.
     * @author Matthew Pangaro <ma...@lokitech.com>
     */
   public class SizeLimitedInputStream extends InputStream {
  -/** Maximum number of bytes to read.
  -  */
  -     private long maxmessagesize = 0;
  -/** Running total of bytes read from wrapped stream.
  -  */
  -     private long bytesread = 0;
  -
  -/** InputStream that will be wrapped.
  -  */
  -     private InputStream in = null;
  -
  -/** Constructor for the stream. Wraps an underlying stream.
  -  * @param in InputStream to use as basis for new Stream.
  -  * @param maxmessagesize Message size limit, in Kilobytes
  -  */
  -     public SizeLimitedInputStream(InputStream in, long maxmessagesize) {
  -         this.in = in;
  -         this.maxmessagesize = maxmessagesize;
  -     }
  -
  -/** Overrides the read method of InputStream to call the read() method 
  -of the
  -  * wrapped input stream.
  -  * @throws IOException Throws a MessageSizeException, which is a 
  -sub-type of IOException.
  -  * @return Returns the int character value of the byte read.
  -  */
  -     public int read() throws IOException {
  -         if (maxmessagesize > 0 && bytesread <= maxmessagesize) {
  -             bytesread++;
  -             return in.read();
  -         } else {
  -             throw new MessageSizeException();
  -         }
  -     }
  +    /** Maximum number of bytes to read.
  +     */
  +    private long maxmessagesize = 0;
  +    /** Running total of bytes read from wrapped stream.
  +     */
  +    private long bytesread = 0;
  +
  +    /** InputStream that will be wrapped.
  +     */
  +    private InputStream in = null;
  +
  +    /** Constructor for the stream. Wraps an underlying stream.
  +     * @param in InputStream to use as basis for new Stream.
  +     * @param maxmessagesize Message size limit, in Kilobytes
  +     */
  +    public SizeLimitedInputStream(InputStream in, long maxmessagesize) {
  +        this.in = in;
  +        this.maxmessagesize = maxmessagesize;
  +    }
  +
  +    /** Overrides the read method of InputStream to call the read() method of the
  +     * wrapped input stream.
  +     * @throws IOException Throws a MessageSizeException, which is a sub-type of IOException.
  +     * @return Returns the int character value of the byte read.
  +     */
  +    public int read() throws IOException {
  +        if (maxmessagesize > 0 && bytesread <= maxmessagesize) {
  +            bytesread++;
  +            return in.read();
  +        } else {
  +            throw new MessageSizeException();
  +        }
  +    }
   }
   
  
  
  
  1.4       +30 -30    jakarta-james/src/org/apache/james/smtpserver/SizeLimitedSMTPHandler.java
  
  Index: SizeLimitedSMTPHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/smtpserver/SizeLimitedSMTPHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SizeLimitedSMTPHandler.java	2001/03/13 06:00:42	1.3
  +++ SizeLimitedSMTPHandler.java	2001/04/19 04:07:03	1.4
  @@ -12,15 +12,15 @@
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Context;
  -import org.apache.avalon.Contextualizable;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.context.Context;
  +import org.apache.avalon.context.Contextualizable;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.cornerstone.services.connection.ConnectionHandler;
   import org.apache.cornerstone.services.scheduler.PeriodicTimeTrigger;
   import org.apache.cornerstone.services.scheduler.Target;
  @@ -39,9 +39,9 @@
     * @author Matthew Pangaro <ma...@lokitech.com>
    * @version 0.9.1
    */
  -public class SizeLimitedSMTPHandler 
  +public class SizeLimitedSMTPHandler
       extends AbstractLoggable
  -    implements ConnectionHandler, Contextualizable, Composer, Configurable, Target {
  +    implements ConnectionHandler, Contextualizable, Composable, Configurable, Target {
   
       public final static String SERVER_NAME = "SERVER_NAME";
       public final static String SERVER_TYPE = "SERVER_TYPE";
  @@ -83,8 +83,8 @@
           servername = (String)context.get( Constants.HELO_NAME );
       }
   
  -    public void compose( final ComponentManager componentManager ) 
  -        throws ComponentManagerException {
  +    public void compose( final ComponentManager componentManager )
  +        throws ComponentException {
           mailServer = (MailServer)componentManager.
               lookup("org.apache.james.services.MailServer");
           scheduler = (TimeScheduler)componentManager.
  @@ -94,9 +94,9 @@
       public void configure(Configuration conf) throws ConfigurationException {
           this.conf = conf;
           timeout = conf.getChild( "connectiontimeout" ).getValueAsInt( 120000 );
  -        // get the message size limit from the conf file and multiply 
  +        // get the message size limit from the conf file and multiply
           //by 1024, to put it in bytes
  -        maxmessagesize = 
  +        maxmessagesize =
               conf.getChild( "maxmessagesize" ).getValueAsLong( 0 ) * 1024;
       }
   
  @@ -108,12 +108,12 @@
        * @exception IOException if an error reading from socket occurs
        * @exception ProtocolException if an error handling connection occurs
        */
  -    public void handleConnection( Socket connection ) 
  +    public void handleConnection( Socket connection )
           throws IOException {
   
           try {
               this.socket = socket;
  -            final InputStream bufferedInput = 
  +            final InputStream bufferedInput =
                   new BufferedInputStream( socket.getInputStream(), 1024 );
               in = new DataInputStream( bufferedInput );
               out = new InternetPrintWriter(socket.getOutputStream(), true);
  @@ -128,8 +128,8 @@
               state.put(REMOTE_IP, remoteIP);
               state.put(SMTP_ID, smtpID);
           } catch (Exception e) {
  -            final String message = 
  -                "Cannot open connection from " + remoteHost + " (" + remoteIP + "): " + 
  +            final String message =
  +                "Cannot open connection from " + remoteHost + " (" + remoteIP + "): " +
                   e.getMessage();
               getLogger().error( message, e );
               throw new RuntimeException( message );
  @@ -241,7 +241,7 @@
                   if (!sender.startsWith("<") || !sender.endsWith(">")) {
                       out.println("501 Syntax error in parameters or arguments");
                       getLogger().error("Error parsing sender address: " + sender
  -                                 + ": did not start and end with < >");
  +                                      + ": did not start and end with < >");
                       return true;
                   }
                   MailAddress senderAddress = null;
  @@ -252,7 +252,7 @@
                   } catch (Exception pe) {
                       out.println("501 Syntax error in parameters or arguments");
                       getLogger().error("Error parsing sender address: " + sender
  -                                 + ": " + pe.getMessage());
  +                                      + ": " + pe.getMessage());
                       return true;
                   }
                   state.put(SENDER, senderAddress);
  @@ -276,8 +276,8 @@
                   if (!recipient.startsWith("<") || !recipient.endsWith(">")) {
                       out.println("Syntax error in parameters or arguments");
                       getLogger().error("Error parsing recipient address: "
  -                                 + recipient
  -                                 + ": did not start and end with < >");
  +                                      + recipient
  +                                      + ": did not start and end with < >");
                       return true;
                   }
                   MailAddress recipientAddress = null;
  @@ -288,7 +288,7 @@
                   } catch (Exception pe) {
                       out.println("501 Syntax error in parameters or arguments");
                       getLogger().error("Error parsing recipient address: "
  -                                 + recipient + ": " + pe.getMessage());
  +                                      + recipient + ": " + pe.getMessage());
                       return true;
                   }
                   rcptColl.add(recipientAddress);
  @@ -318,7 +318,7 @@
                   try {
                       // parse headers
                       InputStream msgIn = new CharTerminatedInputStream(in, SMTPTerminator);
  -                    // if the message size limit has been set, we'll 
  +                    // if the message size limit has been set, we'll
                       //wrap msgIn with a SizeLimitedInputStream
                       if (maxmessagesize > 0) {
                           msgIn =
  @@ -354,7 +354,7 @@
                       // headers.setReceivedStamp("Unknown", (String) serverNames.elementAt(0));
                       ByteArrayInputStream headersIn = new ByteArrayInputStream(headers.toByteArray());
                       MailImpl mail = new MailImpl(mailServer.getId(), (MailAddress)state.get(SENDER), (Vector)state.get(RCPT_VECTOR), new SequenceInputStream(headersIn, msgIn));
  -                    //call mail.getSize() to force the message to be 
  +                    //call mail.getSize() to force the message to be
                       //loaded. Need to do this to limit the size
                       mail.getSize();
                       mail.setRemoteHost((String)state.get(REMOTE_NAME));
  @@ -364,26 +364,26 @@
                       //Grab any exception attached to this one.
                       Exception e = me.getNextException();
   
  -                    //If there was an attached exception, and it's a 
  +                    //If there was an attached exception, and it's a
                       //MessageSizeException
                       if (e != null && e instanceof MessageSizeException) {
                           getLogger().error("552 Error processing message: "
  -                                     + e.getMessage());
  -                        //Add an item to the state to suppress 
  +                                          + e.getMessage());
  +                        //Add an item to the state to suppress
                           //logging of extra lines of data
  -                        //  that are sent after the size limit has 
  +                        //  that are sent after the size limit has
                           //been hit.
                           state.put(MESG_FAILED, Boolean.TRUE);
   
  -                        //then let the client know that the size 
  +                        //then let the client know that the size
                           //limit has been hit.
                           out.println("552 Error processing message: "
                                       + e.getMessage());
                       } else {
                           out.println("451 Error processing message: "
                                       + me.getMessage());
  -                        getLogger().error("Error processing message: " + 
  -                                     me.getMessage());
  +                        getLogger().error("Error processing message: " +
  +                                          me.getMessage());
                       }
                       return true;
                   }
  
  
  
  1.28      +11 -11    jakarta-james/src/org/apache/james/transport/JamesSpoolManager.java
  
  Index: JamesSpoolManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/JamesSpoolManager.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- JamesSpoolManager.java	2001/04/02 08:18:18	1.27
  +++ JamesSpoolManager.java	2001/04/19 04:07:05	1.28
  @@ -11,18 +11,18 @@
   import java.net.*;
   import java.util.*;
   import javax.mail.MessagingException;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Context;
  -import org.apache.avalon.Contextualizable;
  -import org.apache.avalon.DefaultComponentManager;
  -import org.apache.avalon.DefaultContext;
   import org.apache.avalon.Initializable;
   import org.apache.avalon.Stoppable;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
  +import org.apache.avalon.component.DefaultComponentManager;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.context.Context;
  +import org.apache.avalon.context.Contextualizable;
  +import org.apache.avalon.context.DefaultContext;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.james.*;
   import org.apache.james.core.*;
   import org.apache.james.services.*;
  @@ -32,9 +32,9 @@
    * @author Serge Knystautas <se...@lokitech.com>
    * @author Federico Barbieri <sc...@systemy.it>
    */
  -public class JamesSpoolManager 
  +public class JamesSpoolManager
       extends AbstractLoggable
  -    implements Composer, Configurable, Initializable, Runnable, Stoppable, Contextualizable {
  +    implements Composable, Configurable, Initializable, Runnable, Stoppable, Contextualizable {
   
       private DefaultComponentManager compMgr;
       //using implementation as we need put method.
  @@ -69,7 +69,7 @@
               compMgr.put(Resources.MAILET_LOADER, mailetLoader);
               compMgr.put(Resources.MATCH_LOADER, matchLoader);
           } catch (ConfigurationException ce) {
  -            final String message = 
  +            final String message =
                   "Unable to configure mailet/matcher Loaders: " + ce.getMessage();
               getLogger().error( message, ce );
               throw new RuntimeException( message );
  @@ -94,7 +94,7 @@
                   //  to the top
                   if (processorName.equals("root")) {
                       Matcher matcher = matchLoader.getMatcher("All", mailetcontext);
  -                    Mailet mailet = 
  +                    Mailet mailet =
                           mailetLoader.getMailet("PostmasterAlias", mailetcontext, null);
                       processor.add(matcher, mailet);
                   }
  
  
  
  1.16      +25 -27    jakarta-james/src/org/apache/james/transport/LinearProcessor.java
  
  Index: LinearProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/LinearProcessor.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- LinearProcessor.java	2001/02/03 18:21:30	1.15
  +++ LinearProcessor.java	2001/04/19 04:07:05	1.16
  @@ -1,25 +1,21 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport;
   
   import java.io.*;
   import java.util.*;
   import javax.mail.*;
  -
  -import org.apache.avalon.*;
  -import org.apache.log.Logger;
  -
  +import org.apache.avalon.logger.Loggable;
  +import org.apache.avalon.Initializable;
   import org.apache.james.*;
   import org.apache.james.core.*;
  -//import org.apache.james.mailrepository.*;
   import org.apache.james.services.SpoolRepository;
  -
  +import org.apache.log.Logger;
   import org.apache.mailet.*;
   
   /**
  @@ -38,7 +34,9 @@
    *
    * Note that the 'onerror' attribute is not yet supported.
    */
  -public class LinearProcessor implements Loggable, Initializable {
  +public class LinearProcessor 
  +    implements Loggable, Initializable {
  +
       private final static boolean DEBUG_PRINT_PIPE = false;
   
       private List mailets;
  @@ -75,7 +73,7 @@
       }
   
   
  -   public synchronized void service(MailImpl mail) throws MessagingException {
  +    public synchronized void service(MailImpl mail) throws MessagingException {
           //make sure we have the array built
           if (unprocessed == null) {
               //Need to construct that object
  @@ -110,23 +108,23 @@
                       unprocessed[i].remove(mail);
                       break;
                   }
  -	    }
  +            }
   
               //See if we didn't find any messages to process
               if (mail == null) {
                   //We're done
                   return;
               }
  -    
   
  -           //Call the matcher and find what recipients match
  +
  +            //Call the matcher and find what recipients match
               Collection recipients = null;
               Matcher matcher = (Matcher) matchers.get(i);
               try {
                   recipients = matcher.match(mail);
                   if (recipients == null) {
  -                  //In case the matcher returned null, create an empty Vector
  -                   recipients = new Vector();
  +                    //In case the matcher returned null, create an empty Vector
  +                    recipients = new Vector();
                   }
                   //Make sure all the objects are MailAddress objects
                   verifyMailAddresses(recipients);
  @@ -165,7 +163,7 @@
   
               //See if the state was changed by the mailet
               if (!mail.getState().equals(originalState)) {
  -		logger.debug("State changed by: " + mailet.getMailetInfo());
  +                logger.debug("State changed by: " + mailet.getMailetInfo());
                   //If this message was ghosted, we just want to let it die
                   if (mail.getState().equals(mail.GHOST)) {
                       //let this instance die...
  @@ -184,12 +182,12 @@
               } else {
                   //Ok, we made it through with the same state... move it to the next
                   //  spot in the array
  -		logger.debug("State not changed by: " + mailet.getMailetInfo());
  +                logger.debug("State not changed by: " + mailet.getMailetInfo());
                   unprocessed[i + 1].add(mail);
  -	    }
  -	    
  -	}
  -   }
  +            }
  +
  +        }
  +    }
   
       /**
        * Create a unique new primary key name
  
  
  
  1.12      +10 -11    jakarta-james/src/org/apache/james/transport/MailetLoader.java
  
  Index: MailetLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/MailetLoader.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MailetLoader.java	2001/03/05 15:19:21	1.11
  +++ MailetLoader.java	2001/04/19 04:07:06	1.12
  @@ -1,21 +1,20 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport;
   
   import java.util.*;
   import javax.mail.*;
  -import org.apache.avalon.Component;
  +import org.apache.avalon.component.Component;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -
  -import org.apache.mailet.*;
   import org.apache.james.core.*;
  +import org.apache.mailet.*;
   
   /**
    * @author Serge Knystautas <se...@lokitech.com>
  @@ -42,7 +41,7 @@
       }
   
       public Mailet getMailet(String mailetName, MailetContext context, Configuration configuration)
  -    throws MessagingException {
  +        throws MessagingException {
           try {
               for (int i = 0; i < mailetPackages.size(); i++) {
                   String className = (String)mailetPackages.elementAt(i) + mailetName;
  
  
  
  1.11      +11 -12    jakarta-james/src/org/apache/james/transport/MatchLoader.java
  
  Index: MatchLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/MatchLoader.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MatchLoader.java	2001/03/05 15:19:22	1.10
  +++ MatchLoader.java	2001/04/19 04:07:06	1.11
  @@ -1,21 +1,20 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport;
   
   import java.util.*;
   import javax.mail.*;
  -import org.apache.mailet.*;
  -import org.apache.james.core.*;
  -import org.apache.avalon.Component;
  +import org.apache.avalon.component.Component;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -
  +import org.apache.james.core.*;
  +import org.apache.mailet.*;
   
   /**
    * @author Serge Knystautas <se...@lokitech.com>
  @@ -42,7 +41,7 @@
       }
   
       public Matcher getMatcher(String matchName, MailetContext context)
  -	throws MessagingException {
  +        throws MessagingException {
           try {
               String condition = (String) null;
               int i = matchName.indexOf('=');
  
  
  
  1.4       +8 -9      jakarta-james/src/org/apache/james/transport/Resources.java
  
  Index: Resources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/Resources.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Resources.java	2000/09/13 00:38:26	1.3
  +++ Resources.java	2001/04/19 04:07:06	1.4
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport;
   
   /**
  @@ -31,4 +30,4 @@
       public static final String MAILET_LOADER = "MAILET_LOADER";
   
       public static final String MATCH_LOADER = "MATCH_LOADER";
  -}
  \ No newline at end of file
  +}
  
  
  
  1.4       +21 -24    jakarta-james/src/org/apache/james/transport/mailets/AvalonListserv.java
  
  Index: AvalonListserv.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/AvalonListserv.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AvalonListserv.java	2001/01/09 12:42:32	1.3
  +++ AvalonListserv.java	2001/04/19 04:07:08	1.4
  @@ -1,22 +1,21 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import org.apache.avalon.*;
  -
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
   import org.apache.james.*;
  -import org.apache.james.transport.*;
  -import org.apache.james.services.UsersStore;
   import org.apache.james.services.UsersRepository;
  +import org.apache.james.services.UsersStore;
  +import org.apache.james.transport.*;
   import org.apache.mailet.*;
   
   /**
  @@ -56,18 +55,16 @@
           subjectPrefix = getInitParameter("subjectprefix");
   
           ComponentManager compMgr = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
  -	try {
  -	     UsersStore usersStore = (UsersStore) compMgr.lookup("org.apache.james.services.UsersStore");
  -	    String repName = getInitParameter("repositoryName");
  -	   
  -	    members = (UsersRepository) usersStore.getRepository(repName);
  -	} catch (ComponentNotFoundException cnfe) {
  -	    log("Failed to retrieve Store component:" + cnfe.getMessage());
  -	} catch (ComponentNotAccessibleException cnae) {
  -	    log("Failed to retrieve Store component:" + cnae.getMessage());
  -	} catch (Exception e) {
  -	    log("Failed to retrieve Store component:" + e.getMessage());
  -	}
  +        try {
  +            UsersStore usersStore = (UsersStore)compMgr.lookup("org.apache.james.services.UsersStore");
  +            String repName = getInitParameter("repositoryName");
  +
  +            members = (UsersRepository)usersStore.getRepository( repName );
  +        } catch (ComponentException cnfe) {
  +            log("Failed to retrieve Store component:" + cnfe.getMessage());
  +        } catch (Exception e) {
  +            log("Failed to retrieve Store component:" + e.getMessage());
  +        }
       }
   
       public Collection getMembers() throws ParseException {
  
  
  
  1.5       +23 -27    jakarta-james/src/org/apache/james/transport/mailets/AvalonListservManager.java
  
  Index: AvalonListservManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/AvalonListservManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AvalonListservManager.java	2001/01/09 12:42:32	1.4
  +++ AvalonListservManager.java	2001/04/19 04:07:08	1.5
  @@ -1,24 +1,22 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import org.apache.avalon.*;
  -//import org.apache.avalon.services.Store;
  -
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
   import org.apache.james.*;
  -import org.apache.james.services.UsersStore;
   import org.apache.james.services.UsersRepository;
  -import org.apache.mailet.*;
  +import org.apache.james.services.UsersStore;
   import org.apache.james.transport.*;
  +import org.apache.mailet.*;
   
   /**
    * Adds or removes an email address to a listserv.
  @@ -37,18 +35,16 @@
   
       public void init() {
           ComponentManager compMgr = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
  -	try {
  -	    UsersStore usersStore = (UsersStore) compMgr.lookup("org.apache.james.services.UsersStore");
  -	    String repName = getInitParameter("repositoryName");
  -	   
  -	    members = (UsersRepository) usersStore.getRepository(repName);
  -     	} catch (ComponentNotFoundException cnfe) {
  -	    log("Failed to retrieve Store component:" + cnfe.getMessage());
  -	} catch (ComponentNotAccessibleException cnae) {
  -	    log("Failed to retrieve Store component:" + cnae.getMessage());
  -	} catch (Exception e) {
  -	    log("Failed to retrieve Store component:" + e.getMessage());
  -	}
  +        try {
  +            UsersStore usersStore = (UsersStore) compMgr.lookup("org.apache.james.services.UsersStore");
  +            String repName = getInitParameter("repositoryName");
  +
  +            members = (UsersRepository) usersStore.getRepository(repName);
  +        } catch (ComponentException cnfe) {
  +            log("Failed to retrieve Store component:" + cnfe.getMessage());
  +        } catch (Exception e) {
  +            log("Failed to retrieve Store component:" + e.getMessage());
  +        }
       }
   
       public boolean addAddress(MailAddress address) {
  @@ -60,11 +56,11 @@
           members.removeUser(address.toString());
           return true;
       }
  -    
  +
       public boolean existsAddress(MailAddress address) {
           return members.contains(address.toString());
       }
  - 
  +
       public String getMailetInfo() {
           return "AvalonListservManager Mailet";
       }
  
  
  
  1.5       +8 -9      jakarta-james/src/org/apache/james/transport/mailets/ExceptionThrowingMailet.java
  
  Index: ExceptionThrowingMailet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/ExceptionThrowingMailet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ExceptionThrowingMailet.java	2000/10/16 05:10:44	1.4
  +++ ExceptionThrowingMailet.java	2001/04/19 04:07:08	1.5
  @@ -1,15 +1,14 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
  -import org.apache.mailet.*;
   import javax.mail.*;
  +import org.apache.mailet.*;
   
   /**
    * Debugging purpose Mailet. Just throws an exception.
  
  
  
  1.8       +8 -9      jakarta-james/src/org/apache/james/transport/mailets/Forward.java
  
  Index: Forward.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/Forward.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Forward.java	2000/12/05 03:40:13	1.7
  +++ Forward.java	2001/04/19 04:07:09	1.8
  @@ -1,17 +1,16 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
  -import org.apache.mailet.*;
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  +import org.apache.mailet.*;
   
   /**
    * Replace incoming recipient with specified ones.
  
  
  
  1.6       +7 -8      jakarta-james/src/org/apache/james/transport/mailets/GenericListserv.java
  
  Index: GenericListserv.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/GenericListserv.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GenericListserv.java	2001/01/09 12:42:32	1.5
  +++ GenericListserv.java	2001/04/19 04:07:09	1.6
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.io.*;
  
  
  
  1.5       +10 -11    jakarta-james/src/org/apache/james/transport/mailets/GenericListservManager.java
  
  Index: GenericListservManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/GenericListservManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GenericListservManager.java	2001/01/09 12:42:32	1.4
  +++ GenericListservManager.java	2001/04/19 04:07:09	1.5
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.io.*;
  @@ -31,8 +30,8 @@
        * was successful.
        */
       public abstract boolean removeAddress(MailAddress address);
  +
   
  -    
       /**
        * Indicates whether an address already exists on the listserv. Returns
        * whether the address exists.
  @@ -54,7 +53,7 @@
                   if (removeAddress(mail.getSender())) {
                       getMailetContext().bounce(mail, "Successfully removed from listserv.");
                   } else {
  -                getMailetContext().bounce(mail, "You are not subscribed to this listserv.");
  +                    getMailetContext().bounce(mail, "You are not subscribed to this listserv.");
                   }
               } else {
                   getMailetContext().bounce(mail, "Unable to remove you from listserv for some reason");
  @@ -71,7 +70,7 @@
               }
           } else {
               getMailetContext().bounce(mail, "Could not understand the command you sent to this listserv manager.\r\n"
  -                    + "Valid commands are <listserv>-on@domain.com and <listserv>-off@domain.com");
  +                                      + "Valid commands are <listserv>-on@domain.com and <listserv>-off@domain.com");
           }
           //Kill the command message
           mail.setState(Mail.GHOST);
  
  
  
  1.4       +7 -8      jakarta-james/src/org/apache/james/transport/mailets/Identity.java
  
  Index: Identity.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/Identity.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Identity.java	2000/09/13 00:38:29	1.3
  +++ Identity.java	2001/04/19 04:07:09	1.4
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import org.apache.mailet.*;
  
  
  
  1.7       +7 -8      jakarta-james/src/org/apache/james/transport/mailets/LocalDelivery.java
  
  Index: LocalDelivery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/LocalDelivery.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LocalDelivery.java	2000/10/04 05:42:11	1.6
  +++ LocalDelivery.java	2001/04/19 04:07:10	1.7
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import org.apache.mailet.*;
  
  
  
  1.7       +8 -9      jakarta-james/src/org/apache/james/transport/mailets/NotifyPostmaster.java
  
  Index: NotifyPostmaster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/NotifyPostmaster.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NotifyPostmaster.java	2001/01/09 12:42:32	1.6
  +++ NotifyPostmaster.java	2001/04/19 04:07:10	1.7
  @@ -1,20 +1,19 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.io.*;
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import org.apache.mailet.*;
   import org.apache.james.*;
   import org.apache.james.transport.*;
  +import org.apache.mailet.*;
   
   /**
    * Sends an error message to the sender of a message (that's typically landed in
  
  
  
  1.6       +8 -9      jakarta-james/src/org/apache/james/transport/mailets/NotifySender.java
  
  Index: NotifySender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/NotifySender.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NotifySender.java	2001/01/09 12:42:32	1.5
  +++ NotifySender.java	2001/04/19 04:07:10	1.6
  @@ -1,20 +1,19 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.io.*;
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import org.apache.mailet.*;
   import org.apache.james.*;
   import org.apache.james.transport.*;
  +import org.apache.mailet.*;
   
   /**
    * Sends an error message to the sender of a message (that's typically landed in
  
  
  
  1.4       +7 -8      jakarta-james/src/org/apache/james/transport/mailets/Null.java
  
  Index: Null.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/Null.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Null.java	2000/09/13 00:38:29	1.3
  +++ Null.java	2001/04/19 04:07:10	1.4
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import org.apache.mailet.*;
  
  
  
  1.3       +9 -10     jakarta-james/src/org/apache/james/transport/mailets/PostmasterAlias.java
  
  Index: PostmasterAlias.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/PostmasterAlias.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PostmasterAlias.java	2001/03/31 02:40:41	1.2
  +++ PostmasterAlias.java	2001/04/19 04:07:10	1.3
  @@ -1,18 +1,17 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
   import org.apache.mailet.*;
  -import com.workingdogs.town.*;
  +//import com.workingdogs.town.*;
   
   /**
    * Rewrites recipient addresses to make sure email for the postmaster is
  @@ -33,7 +32,7 @@
           for (Iterator i = recipients.iterator(); i.hasNext(); ) {
               MailAddress addr = (MailAddress)i.next();
               if (addr.getUser().equalsIgnoreCase("postmaster") &&
  -                    mailetContext.isLocalServer(addr.getHost())) {
  +                mailetContext.isLocalServer(addr.getHost())) {
                   //Should remove this address... we want to replace it with
                   //  the server's postmaster address
                   if (recipientsToRemove == null) {
  
  
  
  1.19      +51 -59    jakarta-james/src/org/apache/james/transport/mailets/RemoteDelivery.java
  
  Index: RemoteDelivery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/RemoteDelivery.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- RemoteDelivery.java	2001/03/05 15:19:31	1.18
  +++ RemoteDelivery.java	2001/04/19 04:07:11	1.19
  @@ -1,23 +1,24 @@
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
   import java.io.*;
  -import java.util.*;
   import java.net.*;
  -
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentNotFoundException;
  -import org.apache.avalon.ComponentNotAccessibleException;
  +import java.util.*;
  +import javax.mail.MessagingException;
  +import javax.mail.Session;
  +import javax.mail.Transport;
  +import javax.mail.URLName;
  +import javax.mail.internet.*;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
   import org.apache.avalon.configuration.DefaultConfiguration;
  -//import org.apache.avalon.services.Store;
  -
   import org.apache.james.*;
   import org.apache.james.core.*;
   import org.apache.james.services.MailServer;
  @@ -26,13 +27,6 @@
   import org.apache.james.transport.*;
   import org.apache.mailet.*;
   
  -import javax.mail.MessagingException;
  -import javax.mail.Session;
  -import javax.mail.Transport;
  -import javax.mail.URLName;
  -import javax.mail.internet.*;
  -
  -
   /**
    * Receive  a MessageContainer from JamesSpoolManager and takes care of delivery
    * the message to remote hosts. If for some reason mail can't be delivered
  @@ -62,29 +56,27 @@
           } catch (Exception e) {
           }
           ComponentManager compMgr = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
  -	String outgoingPath = getInitParameter("outgoing");
  +        String outgoingPath = getInitParameter("outgoing");
           if (outgoingPath == null) {
               outgoingPath = "file:///../var/mail/outgoing";
           }
  +
  +        try {
  +            // Instantiate the a MailRepository for outgoing mails
  +            MailStore mailstore = (MailStore) compMgr.lookup("org.apache.james.services.MailStore");
   
  -	try {
  -	    // Instantiate the a MailRepository for outgoing mails
  -	    MailStore mailstore = (MailStore) compMgr.lookup("org.apache.james.services.MailStore");
  -	    
  -	    DefaultConfiguration spoolConf
  -		= new DefaultConfiguration("repository", "generated:RemoteDelivery.java");
  -	    spoolConf.addAttribute("destinationURL", outgoingPath);
  -	    spoolConf.addAttribute("type", "SPOOL");
  -	    spoolConf.addAttribute("model", "SYNCHRONOUS");
  -	    
  -	    outgoing = (SpoolRepository) mailstore.select(spoolConf);
  -    	} catch (ComponentNotFoundException cnfe) {
  -	    log("Failed to retrieve Store component:" + cnfe.getMessage());
  -	} catch (ComponentNotAccessibleException cnae) {
  -	    log("Failed to retrieve Store component:" + cnae.getMessage());
  -	} catch (Exception e) {
  -	    log("Failed to retrieve Store component:" + e.getMessage());
  -	}
  +            DefaultConfiguration spoolConf
  +                = new DefaultConfiguration("repository", "generated:RemoteDelivery.java");
  +            spoolConf.addAttribute("destinationURL", outgoingPath);
  +            spoolConf.addAttribute("type", "SPOOL");
  +            spoolConf.addAttribute("model", "SYNCHRONOUS");
  +
  +            outgoing = (SpoolRepository) mailstore.select(spoolConf);
  +        } catch (ComponentException cnfe) {
  +            log("Failed to retrieve Store component:" + cnfe.getMessage());
  +        } catch (Exception e) {
  +            log("Failed to retrieve Store component:" + e.getMessage());
  +        }
   
           //Start up a number of threads
           try {
  @@ -124,10 +116,10 @@
   
               if (addr.length > 0) {
                   //Lookup the possible targets
  -		Iterator i = getMailetContext().getMailServers(host).iterator();
  -		if (! i.hasNext()) {
  -		    log("No mail servers found for: " + host);
  -		}
  +                Iterator i = getMailetContext().getMailServers(host).iterator();
  +                if (! i.hasNext()) {
  +                    log("No mail servers found for: " + host);
  +                }
                   while ( i.hasNext()) {
                       try {
                           String outgoingmailserver = i.next().toString ();
  @@ -156,20 +148,20 @@
                           log("mail (" + mail.getName() + ") sent successfully to " + outgoingmailserver);
                           return;
                       } catch (MessagingException me) {
  -			log("Exception caught in RemoteDelivery.deliver() : " + me);
  +                        log("Exception caught in RemoteDelivery.deliver() : " + me);
                           e = me;
  -                    /*
  -                    } catch (java.net.SocketException se) {
  -                        //Only remember this exception if we received no other exception
  -                        if (e == null) {
  -                            e = se;
  -                        }
  -                    } catch (java.net.UnknownHostException uhe) {
  -                        //Only remember this exception if we received no other exception
  -                        if (e == null) {
  -                            e = uhe;
  -                        }
  -                    */
  +                        /*
  +                          } catch (java.net.SocketException se) {
  +                          //Only remember this exception if we received no other exception
  +                          if (e == null) {
  +                          e = se;
  +                          }
  +                          } catch (java.net.UnknownHostException uhe) {
  +                          //Only remember this exception if we received no other exception
  +                          if (e == null) {
  +                          e = uhe;
  +                          }
  +                        */
                       }
                   }// end while
                   //If we encountered an exception while looping through, send the last exception we got
  @@ -303,7 +295,7 @@
                   outgoing.remove(key);
                   mail = null;
               } catch (Exception e) {
  -		log("Exception caught in RemoteDelivery.run(): " + e);
  +                log("Exception caught in RemoteDelivery.run(): " + e);
               }
           }
       }
  
  
  
  1.9       +7 -8      jakarta-james/src/org/apache/james/transport/mailets/ServerTime.java
  
  Index: ServerTime.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/ServerTime.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ServerTime.java	2000/12/05 03:40:13	1.8
  +++ ServerTime.java	2001/04/19 04:07:11	1.9
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.util.*;
  
  
  
  1.7       +7 -8      jakarta-james/src/org/apache/james/transport/mailets/ToProcessor.java
  
  Index: ToProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/ToProcessor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ToProcessor.java	2000/12/11 05:37:40	1.6
  +++ ToProcessor.java	2001/04/19 04:07:11	1.7
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import org.apache.mailet.*;
  
  
  
  1.8       +26 -34    jakarta-james/src/org/apache/james/transport/mailets/ToRepository.java
  
  Index: ToRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/ToRepository.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ToRepository.java	2001/03/05 15:19:33	1.7
  +++ ToRepository.java	2001/04/19 04:07:11	1.8
  @@ -1,28 +1,22 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.util.*;
  -
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentNotFoundException;
  -import org.apache.avalon.ComponentNotAccessibleException;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
   import org.apache.avalon.configuration.DefaultConfiguration;
  -//import org.apache.avalon.services.Store;
  -
   import org.apache.james.*;
   import org.apache.james.core.*;
  -import org.apache.james.services.MailStore;
   import org.apache.james.services.MailRepository;
  +import org.apache.james.services.MailStore;
   import org.apache.james.transport.*;
  -
   import org.apache.mailet.*;
   
   /**
  @@ -46,23 +40,21 @@
           }
   
           ComponentManager compMgr = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
  -	try {
  -	    MailStore mailstore = (MailStore) compMgr.lookup("org.apache.james.services.MailStore");
  -	    DefaultConfiguration mailConf
  -		= new DefaultConfiguration("repository", "generated:ToRepository");
  -	    mailConf.addAttribute("destinationURL", repositoryPath);
  -	    mailConf.addAttribute("type", "MAIL");
  -	    mailConf.addAttribute("model", "SYNCHRONOUS");
  -	    
  -	    repository = (MailRepository) mailstore.select(mailConf);
  -	} catch (ComponentNotFoundException cnfe) {
  -	    log("Failed to retrieve Store component:" + cnfe.getMessage());
  -	} catch (ComponentNotAccessibleException cnae) {
  -	    log("Failed to retrieve Store component:" + cnae.getMessage());
  -	} catch (Exception e) {
  -	    log("Failed to retrieve Store component:" + e.getMessage());
  -	}
  -      
  +        try {
  +            MailStore mailstore = (MailStore) compMgr.lookup("org.apache.james.services.MailStore");
  +            DefaultConfiguration mailConf
  +                = new DefaultConfiguration("repository", "generated:ToRepository");
  +            mailConf.addAttribute("destinationURL", repositoryPath);
  +            mailConf.addAttribute("type", "MAIL");
  +            mailConf.addAttribute("model", "SYNCHRONOUS");
  +
  +            repository = (MailRepository) mailstore.select(mailConf);
  +        } catch (ComponentException cnfe) {
  +            log("Failed to retrieve Store component:" + cnfe.getMessage());
  +        } catch (Exception e) {
  +            log("Failed to retrieve Store component:" + e.getMessage());
  +        }
  +
       }
   
       public void service(Mail genericmail) {
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/james/transport/mailets/TownAlias.java
  
  Index: TownAlias.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/TownAlias.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TownAlias.java	2000/10/16 05:10:46	1.2
  +++ TownAlias.java	2001/04/19 04:07:12	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.util.*;
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/james/transport/mailets/TownListserv.java
  
  Index: TownListserv.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/TownListserv.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TownListserv.java	2000/10/16 05:10:46	1.2
  +++ TownListserv.java	2001/04/19 04:07:12	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import java.util.*;
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/james/transport/mailets/UseHeaderRecipients.java
  
  Index: UseHeaderRecipients.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/mailets/UseHeaderRecipients.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- UseHeaderRecipients.java	2000/12/11 05:37:58	1.2
  +++ UseHeaderRecipients.java	2001/04/19 04:07:12	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.mailets;
   
   import org.apache.mailet.*;
  
  
  
  1.4       +7 -8      jakarta-james/src/org/apache/james/transport/matchers/All.java
  
  Index: All.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/All.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- All.java	2000/09/13 00:38:34	1.3
  +++ All.java	2001/04/19 04:07:18	1.4
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
   import java.util.*;
  
  
  
  1.3       +9 -10     jakarta-james/src/org/apache/james/transport/matchers/CommandForListserv.java
  
  Index: CommandForListserv.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/CommandForListserv.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CommandForListserv.java	2000/10/16 05:09:25	1.2
  +++ CommandForListserv.java	2001/04/19 04:07:18	1.3
  @@ -1,17 +1,16 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
  +import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
   import org.apache.mailet.*;
  -import java.util.*;
   
   /**
    * Returns positive if the recipient is a command for a listserv.  For example,
  @@ -31,7 +30,7 @@
       public boolean matchRecipient(MailAddress recipient) {
           if (recipient.getHost().equals(listservAddress.getHost())) {
               if (recipient.getUser().equals(listservAddress.getUser() + "-on")
  -                    || recipient.getUser().equals(listservAddress.getUser() + "-off")) {
  +                || recipient.getUser().equals(listservAddress.getUser() + "-off")) {
                   return true;
               }
           }
  
  
  
  1.7       +7 -8      jakarta-james/src/org/apache/james/transport/matchers/HostIs.java
  
  Index: HostIs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/HostIs.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HostIs.java	2000/10/17 12:53:44	1.6
  +++ HostIs.java	2001/04/19 04:07:19	1.7
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
   import org.apache.mailet.*;
  
  
  
  1.7       +9 -10     jakarta-james/src/org/apache/james/transport/matchers/HostIsLocal.java
  
  Index: HostIsLocal.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/HostIsLocal.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HostIsLocal.java	2001/03/31 02:40:44	1.6
  +++ HostIsLocal.java	2001/04/19 04:07:19	1.7
  @@ -1,15 +1,14 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.*;
   import java.util.*;
  +import org.apache.mailet.*;
   
   /**
    * @version 1.0.0, 24/04/1999
  @@ -21,4 +20,4 @@
       public boolean matchRecipient(MailAddress recipient) {
           return getMailetContext().isLocalServer(recipient.getHost().toLowerCase());
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.3       +8 -9      jakarta-james/src/org/apache/james/transport/matchers/InSpammerBlacklist.java
  
  Index: InSpammerBlacklist.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/InSpammerBlacklist.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InSpammerBlacklist.java	2000/12/11 05:38:16	1.2
  +++ InSpammerBlacklist.java	2001/04/19 04:07:19	1.3
  @@ -1,17 +1,16 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.*;
   import java.net.*;
   import java.util.*;
   import javax.mail.*;
  +import org.apache.mailet.*;
   
   /**
    * Checks the network IP address of the sending server against a
  
  
  
  1.3       +8 -9      jakarta-james/src/org/apache/james/transport/matchers/IsSingleRecipient.java
  
  Index: IsSingleRecipient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/IsSingleRecipient.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IsSingleRecipient.java	2000/12/11 05:38:16	1.2
  +++ IsSingleRecipient.java	2001/04/19 04:07:20	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
   import org.apache.mailet.*;
  @@ -24,4 +23,4 @@
               return null;
           }
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.7       +8 -9      jakarta-james/src/org/apache/james/transport/matchers/RecipientIs.java
  
  Index: RecipientIs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/RecipientIs.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RecipientIs.java	2000/12/05 03:40:15	1.6
  +++ RecipientIs.java	2001/04/19 04:07:20	1.7
  @@ -1,16 +1,15 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.*;
   import java.util.*;
   import javax.mail.*;
  +import org.apache.mailet.*;
   
   /**
    * @version 1.0.0, 24/04/1999
  
  
  
  1.8       +8 -9      jakarta-james/src/org/apache/james/transport/matchers/RecipientIsLocal.java
  
  Index: RecipientIsLocal.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/RecipientIsLocal.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RecipientIsLocal.java	2001/03/31 02:40:44	1.7
  +++ RecipientIsLocal.java	2001/04/19 04:07:20	1.8
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
   import org.apache.mailet.*;
  @@ -24,4 +23,4 @@
           return mailetContext.isLocalServer(recipient.getHost().toLowerCase())
               && mailetContext.isLocalUser(recipient.getUser());
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.4       +8 -9      jakarta-james/src/org/apache/james/transport/matchers/RelayLimit.java
  
  Index: RelayLimit.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/RelayLimit.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RelayLimit.java	2000/10/16 05:09:25	1.3
  +++ RelayLimit.java	2001/04/19 04:07:20	1.4
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
   import org.apache.mailet.*;
  @@ -41,4 +40,4 @@
               return null;
           }
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/james/transport/matchers/RemoteAddrInNetwork.java
  
  Index: RemoteAddrInNetwork.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/RemoteAddrInNetwork.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RemoteAddrInNetwork.java	2001/01/09 12:42:34	1.2
  +++ RemoteAddrInNetwork.java	2001/04/19 04:07:21	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
   import org.apache.mailet.*;
  
  
  
  1.3       +8 -9      jakarta-james/src/org/apache/james/transport/matchers/RemoteAddrNotInNetwork.java
  
  Index: RemoteAddrNotInNetwork.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/RemoteAddrNotInNetwork.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RemoteAddrNotInNetwork.java	2001/01/09 12:42:34	1.2
  +++ RemoteAddrNotInNetwork.java	2001/04/19 04:07:21	1.3
  @@ -1,17 +1,16 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.*;
   import java.net.*;
   import java.util.*;
   import javax.mail.*;
  +import org.apache.mailet.*;
   
   /**
    * Checks the IP address of the sending server against a comma-
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/james/transport/matchers/SenderInFakeDomain.java
  
  Index: SenderInFakeDomain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/SenderInFakeDomain.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SenderInFakeDomain.java	2001/01/09 12:42:34	1.2
  +++ SenderInFakeDomain.java	2001/04/19 04:07:21	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
   import org.apache.mailet.*;
  
  
  
  1.7       +8 -9      jakarta-james/src/org/apache/james/transport/matchers/SenderIs.java
  
  Index: SenderIs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/SenderIs.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SenderIs.java	2000/10/16 05:09:26	1.6
  +++ SenderIs.java	2001/04/19 04:07:22	1.7
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
   import org.apache.mailet.*;
  @@ -34,4 +33,4 @@
               return null;
           }
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.5       +10 -11    jakarta-james/src/org/apache/james/transport/matchers/SubjectIs.java
  
  Index: SubjectIs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/SubjectIs.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SubjectIs.java	2000/10/16 05:09:26	1.4
  +++ SubjectIs.java	2001/04/19 04:07:22	1.5
  @@ -1,17 +1,16 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.*;
  +import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import java.util.*;
  +import org.apache.mailet.*;
   
   /**
    *
  @@ -28,4 +27,4 @@
           }
           return null;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.4       +10 -11    jakarta-james/src/org/apache/james/transport/matchers/SubjectStartsWith.java
  
  Index: SubjectStartsWith.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/SubjectStartsWith.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SubjectStartsWith.java	2000/09/13 00:38:36	1.3
  +++ SubjectStartsWith.java	2001/04/19 04:07:22	1.4
  @@ -1,17 +1,16 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.*;
  +import java.util.*;
   import javax.mail.*;
   import javax.mail.internet.*;
  -import java.util.*;
  +import org.apache.mailet.*;
   
   /**
    *
  @@ -29,4 +28,4 @@
           }
           return null;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.5       +8 -9      jakarta-james/src/org/apache/james/transport/matchers/UserIs.java
  
  Index: UserIs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/matchers/UserIs.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- UserIs.java	2000/09/13 00:38:36	1.4
  +++ UserIs.java	2001/04/19 04:07:22	1.5
  @@ -1,15 +1,14 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.*;
   import java.util.*;
  +import org.apache.mailet.*;
   
   /**
    * @version 1.0.0, 24/04/1999
  
  
  
  1.10      +17 -17    jakarta-james/src/org/apache/james/userrepository/UsersFileRepository.java
  
  Index: UsersFileRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/userrepository/UsersFileRepository.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- UsersFileRepository.java	2001/03/17 18:06:29	1.9
  +++ UsersFileRepository.java	2001/04/19 04:07:29	1.10
  @@ -9,19 +9,19 @@
   
   import java.io.File;
   import java.util.Iterator;
  -import org.apache.avalon.AbstractLoggable;
  -import org.apache.avalon.Component;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.ComponentManagerException;
  -import org.apache.avalon.Composer;
   import org.apache.avalon.Initializable;
  +import org.apache.avalon.component.Component;
  +import org.apache.avalon.component.ComponentException;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
   import org.apache.avalon.configuration.DefaultConfiguration;
  -import org.apache.avalon.util.Lock;
  -import org.apache.cornerstone.services.store.Store;
  +import org.apache.avalon.logger.AbstractLoggable;
   import org.apache.cornerstone.services.store.ObjectRepository;
  +import org.apache.cornerstone.services.store.Store;
  +import org.apache.excalibur.concurrent.Lock;
   import org.apache.james.services.UsersRepository;
   
   /**
  @@ -32,14 +32,14 @@
    *              type="USERS"
    *              model="SYNCHRONOUS"/>
    * Requires a logger called UsersRepository.
  - * 
  + *
    * @version 1.0.0, 24/04/1999
    * @author  Federico Barbieri <sc...@pop.systemy.it>
    * @author Charles Benett <ch...@benett1.demon.co.uk>
    */
  -public class UsersFileRepository 
  +public class UsersFileRepository
       extends AbstractLoggable
  -    implements UsersRepository, Component, Configurable, Composer, 
  +    implements UsersRepository, Component, Configurable, Composable,
                  Initializable {
   
       private static final String TYPE = "USERS";
  @@ -49,7 +49,7 @@
       private String destination;
       private Lock lock  = new Lock();
   
  -    public void configure( final Configuration configuration ) 
  +    public void configure( final Configuration configuration )
           throws ConfigurationException {
   
           destination = configuration.getChild( "destination" ).getAttribute( "URL" );
  @@ -59,26 +59,26 @@
           }
       }
   
  -    public void compose( final ComponentManager componentManager ) 
  -        throws ComponentManagerException {
  +    public void compose( final ComponentManager componentManager )
  +        throws ComponentException {
   
           store = (Store)componentManager.
               lookup( "org.apache.cornerstone.services.store.Store" );
       }
  -    
  +
       public void init()
           throws Exception {
   
           try {
               //prepare Configurations for object and stream repositories
               final DefaultConfiguration objectConfiguration
  -                = new DefaultConfiguration( "repository", 
  +                = new DefaultConfiguration( "repository",
                                               "generated:UsersFileRepository.compose()" );
   
               objectConfiguration.addAttribute( "destinationURL", destination );
               objectConfiguration.addAttribute( "type", "OBJECT" );
               objectConfiguration.addAttribute( "model", "SYNCHRONOUS" );
  -        
  +
               or = (ObjectRepository)store.select( objectConfiguration );
   
           } catch (Exception e) {
  @@ -90,7 +90,7 @@
       public Iterator list() {
           return or.list();
       }
  - 
  +
       public synchronized void addUser(String name, Object attributes) {
           try {
               or.put(name, attributes);
  
  
  
  1.7       +31 -31    jakarta-james/src/org/apache/james/userrepository/UsersLDAPRepository.java
  
  Index: UsersLDAPRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/userrepository/UsersLDAPRepository.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- UsersLDAPRepository.java	2001/03/13 06:00:46	1.6
  +++ UsersLDAPRepository.java	2001/04/19 04:07:29	1.7
  @@ -11,15 +11,15 @@
   import java.util.*;
   import javax.naming.*;
   import javax.naming.directory.*;
  -import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.Composer;
  -import org.apache.avalon.Context;
  -import org.apache.avalon.Contextualizable;
   import org.apache.avalon.Initializable;
  -import org.apache.avalon.Loggable;
  +import org.apache.avalon.component.ComponentManager;
  +import org.apache.avalon.component.Composable;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  +import org.apache.avalon.context.Context;
  +import org.apache.avalon.context.Contextualizable;
  +import org.apache.avalon.logger.Loggable;
   import org.apache.james.Constants;
   import org.apache.james.services.UsersRepository;
   import org.apache.log.Logger;
  @@ -88,15 +88,15 @@
   
       public void compose(ComponentManager compMgr) {
           this.comp = comp;
  -   }
  +    }
   
  -    public void contextualize(org.apache.avalon.Context context) {
  +    public void contextualize(Context context) {
           Collection serverNames
  -            = (Collection) context.get(Constants.SERVER_NAMES);
  -        usersDomain = (String) serverNames.iterator().next();
  +            = (Collection)context.get(Constants.SERVER_NAMES);
  +        usersDomain = (String)serverNames.iterator().next();
       }
   
  -   public void setServerRoot() {
  +    public void setServerRoot() {
           this.setBase(serverRDN +", " + rootNodeDN);
       }
   
  @@ -123,8 +123,8 @@
               e.getMessage();
               e.printStackTrace();
           }
  +
   
  -     
           logger.info("Initial context initialised from " + baseURL);
       }
   
  @@ -174,11 +174,11 @@
           return destination;
       }
   
  -   public Iterator list() {
  +    public Iterator list() {
   
  -       List result = new ArrayList();
  -       String filter = mailAddressAttr + "=*";
  -       String[] attrIDs = {membersAttr};
  +        List result = new ArrayList();
  +        String filter = mailAddressAttr + "=*";
  +        String[] attrIDs = {membersAttr};
   
           try {
               Attribute members
  @@ -191,13 +191,13 @@
               }
           } catch (NamingException e) {
               logger.error("Problem listing mailboxes. " + e );
  - 
  +
           }
  -       return result.iterator();
  +        return result.iterator();
       }
   
  +
   
  - 
   
       // Methods from interface UsersRepository --------------------------
   
  @@ -235,10 +235,10 @@
                   //System.out.println(userName + " added to mailGroup " + baseNodeDN);
               }
           } catch (NamingException e) {
  -             logger.error("Problem adding user " + userName + " to: " + baseNodeDN + e);
  -             //System.out.println("Problem adding user " + userName + " to: " + baseNodeDN);
  -             //System.out.println(e.getMessage());
  -             //e.printStackTrace();
  +            logger.error("Problem adding user " + userName + " to: " + baseNodeDN + e);
  +            //System.out.println("Problem adding user " + userName + " to: " + baseNodeDN);
  +            //System.out.println(e.getMessage());
  +            //e.printStackTrace();
           }
   
           // Add attributes to user objects, if necessary
  @@ -419,8 +419,8 @@
                   }
   
               } else {
  -            logger.info("User " + userName + " not in Directory.");
  -            //System.out.println("User " + userName + " not in Directory.");
  +                logger.info("User " + userName + " not in Directory.");
  +                //System.out.println("User " + userName + " not in Directory.");
   
               }
               rootCtx.close();
  @@ -509,10 +509,10 @@
                   //System.out.println(ae.getMessage());
                   //ae.printStackTrace();
               } catch (Exception e) {
  -              logger.error("Problem checking password for " + name + " : " + e );
  -              //System.out.println("Problem checking password for " + name + " : " + e);
  -              //System.out.println(e.getMessage());
  -              //e.printStackTrace();
  +                logger.error("Problem checking password for " + name + " : " + e );
  +                //System.out.println("Problem checking password for " + name + " : " + e);
  +                //System.out.println(e.getMessage());
  +                //e.printStackTrace();
               }
           }
           return result;
  @@ -521,8 +521,8 @@
   
       public int countUsers() {
   
  -       String[] attrIDs = {membersAttr};
  -       int result = -1;
  +        String[] attrIDs = {membersAttr};
  +        int result = -1;
   
           try {
               Attribute members = ctx.getAttributes("", attrIDs).get(membersAttr);
  @@ -535,7 +535,7 @@
               logger.error("Problem counting users: "  + e);
               //System.out.println("Problem counting users. ");
           }
  -       return result;
  +        return result;
       }
   
       public String getDomains() {
  
  
  
  1.9       +25 -28    jakarta-james/src/org/apache/james/userrepository/UsersTownRepository.java
  
  Index: UsersTownRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/userrepository/UsersTownRepository.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- UsersTownRepository.java	2001/03/05 15:20:46	1.8
  +++ UsersTownRepository.java	2001/04/19 04:07:30	1.9
  @@ -1,24 +1,24 @@
  -/*****************************************************************************
  -  UsersTownRepository
  -*****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.james.userrepository;
   
  +import com.workingdogs.town.*;
   import java.io.*;
   import java.util.*;
  -
  -import org.apache.avalon.Loggable;
  +import org.apache.avalon.component.Component;
   import org.apache.avalon.configuration.Configurable;
   import org.apache.avalon.configuration.Configuration;
   import org.apache.avalon.configuration.ConfigurationException;
  -import org.apache.avalon.Component;
  +import org.apache.avalon.logger.Loggable;
  +import org.apache.james.services.UsersRepository;
   import org.apache.log.LogKit;
   import org.apache.log.Logger;
   
  -import org.apache.james.services.UsersRepository;
  -
  -import com.workingdogs.town.*;
  -
   /**
    * Implementation of a Repository to store users in database.
    * @version 1.0.0, 10/01/2000
  @@ -41,19 +41,17 @@
       }
   
       public void setLogger(final Logger a_Logger) {
  -	logger = a_Logger;
  +        logger = a_Logger;
       }
   
       public void configure(Configuration conf) throws ConfigurationException {
  -	//  destination = conf.getChild("destination").getAttribute("URL");
  -	//  repositoryName = destination.substring(destination.indexOf("//") + 2);
  -	conndefinition= conf.getChild("conn").getValue();
  -	tableName = conf.getChild("table").getValue("Users");
  +        //  destination = conf.getChild("destination").getAttribute("URL");
  +        //  repositoryName = destination.substring(destination.indexOf("//") + 2);
  +        conndefinition= conf.getChild("conn").getValue();
  +        tableName = conf.getChild("table").getValue("Users");
   
       }
   
  - 
  -	
       // Methods from interface Repository
   
       public synchronized void addUser(String strUserName, Object attributes) {
  @@ -69,7 +67,7 @@
                   user.save();
               } else {
                   // file://User already exists: reject add
  -                logger.warn("User "+strUserName+" already exists."); 
  +                logger.warn("User "+strUserName+" already exists.");
               }
           } catch (Exception e) {
               e.printStackTrace();
  @@ -144,14 +142,14 @@
       }
   
       public int countUsers() {
  -    try {
  -        TableDataSet MRUser = new TableDataSet(ConnDefinition.getInstance(conndefinition), tableName);
  -        int nSize = MRUser.size();
  -        return (int) nSize;
  -    } catch (Exception e) {
  -        e.printStackTrace();
  -        throw new RuntimeException("Exception caught while testing UserName: " + e.getMessage());
  -    }
  +        try {
  +            TableDataSet MRUser = new TableDataSet(ConnDefinition.getInstance(conndefinition), tableName);
  +            int nSize = MRUser.size();
  +            return (int) nSize;
  +        } catch (Exception e) {
  +            e.printStackTrace();
  +            throw new RuntimeException("Exception caught while testing UserName: " + e.getMessage());
  +        }
       }
   
       public Iterator list() {
  @@ -169,5 +167,4 @@
           }
           return list.iterator();
       }
  -
   }
  
  
  
  1.3       +1 -1      jakarta-james/src/org/apache/james/util/CharTerminatedInputStream.java
  
  Index: CharTerminatedInputStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/util/CharTerminatedInputStream.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CharTerminatedInputStream.java	2001/03/13 22:09:19	1.2
  +++ CharTerminatedInputStream.java	2001/04/19 04:07:32	1.3
  @@ -14,7 +14,7 @@
    * @version 1.0.0, 24/04/1999
    * @author  Federico Barbieri <sc...@pop.systemy.it>
    */
  -public class CharTerminatedInputStream 
  +public class CharTerminatedInputStream
       extends InputStream {
   
       private InputStream in;
  
  
  
  1.5       +1 -1      jakarta-james/src/org/apache/james/util/InternetPrintWriter.java
  
  Index: InternetPrintWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/util/InternetPrintWriter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InternetPrintWriter.java	2001/03/13 22:09:20	1.4
  +++ InternetPrintWriter.java	2001/04/19 04:07:33	1.5
  @@ -11,7 +11,7 @@
   import java.io.PrintWriter;
   import java.io.Writer;
   
  -public class InternetPrintWriter 
  +public class InternetPrintWriter
       extends PrintWriter {
   
       private static String lineSeparator = "\r\n";
  
  
  
  1.2       +7 -7      jakarta-james/src/org/apache/james/util/Lock.java
  
  Index: Lock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/util/Lock.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Lock.java	2001/04/08 00:41:53	1.1
  +++ Lock.java	2001/04/19 04:07:33	1.2
  @@ -36,7 +36,7 @@
       public boolean lock( final Object key )
       {
           Object theLock;
  -        
  +
           synchronized( this )
           {
               theLock = locks.get( key );
  @@ -45,11 +45,11 @@
               {
                   locks.put( key, getCallerId() );
                   return true;
  -            } 
  +            }
               else if( getCallerId() == theLock )
               {
                   return true;
  -            } 
  +            }
               else
               {
                   return false;
  @@ -57,7 +57,7 @@
           }
       }
   
  -    public boolean unlock( final Object key ) 
  +    public boolean unlock( final Object key )
       {
           Object theLock;
           synchronized( this )
  @@ -67,12 +67,12 @@
               if( null == theLock )
               {
                   return true;
  -            } 
  +            }
               else if( getCallerId() == theLock )
               {
                   locks.remove( key );
                   return true;
  -            } 
  +            }
               else
               {
                   return false;
  @@ -80,7 +80,7 @@
           }
       }
   
  -    private Object getCallerId() 
  +    private Object getCallerId()
       {
           return Thread.currentThread();
       }
  
  
  
  1.2       +1 -1      jakarta-james/src/org/apache/james/util/LockException.java
  
  Index: LockException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/util/LockException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LockException.java	2001/04/08 00:41:14	1.1
  +++ LockException.java	2001/04/19 04:07:34	1.2
  @@ -7,7 +7,7 @@
    */
   package org.apache.james.util;
   
  -public class LockException extends RuntimeException 
  +public class LockException extends RuntimeException
   {
       public LockException(String msg) {
           super(msg);
  
  
  
  1.7       +1 -1      jakarta-james/src/org/apache/james/util/RFC822DateFormat.java
  
  Index: RFC822DateFormat.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/util/RFC822DateFormat.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RFC822DateFormat.java	2001/04/10 16:23:32	1.6
  +++ RFC822DateFormat.java	2001/04/19 04:07:34	1.7
  @@ -27,7 +27,7 @@
       private static DecimalFormat tz;
   
       /**
  -     * SimpleDateFormat will handle most of this for us, but the 
  +     * SimpleDateFormat will handle most of this for us, but the
        * timezone won't match, so we do that manually
        *
        * @return java.lang.String
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/mailet/GenericMailet.java
  
  Index: GenericMailet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/GenericMailet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GenericMailet.java	2000/10/16 05:01:54	1.2
  +++ GenericMailet.java	2001/04/19 04:07:37	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   import java.util.*;
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/mailet/GenericMatcher.java
  
  Index: GenericMatcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/GenericMatcher.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GenericMatcher.java	2000/10/16 05:01:54	1.2
  +++ GenericMatcher.java	2001/04/19 04:07:37	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   import java.util.*;
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/mailet/GenericRecipientMatcher.java
  
  Index: GenericRecipientMatcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/GenericRecipientMatcher.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GenericRecipientMatcher.java	2000/10/16 05:01:54	1.2
  +++ GenericRecipientMatcher.java	2001/04/19 04:07:38	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   import java.util.*;
  
  
  
  1.5       +7 -8      jakarta-james/src/org/apache/mailet/Mail.java
  
  Index: Mail.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/Mail.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Mail.java	2001/03/05 15:00:53	1.4
  +++ Mail.java	2001/04/19 04:07:38	1.5
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   import java.io.*;
  
  
  
  1.10      +10 -12    jakarta-james/src/org/apache/mailet/MailAddress.java
  
  Index: MailAddress.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/MailAddress.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MailAddress.java	2001/01/09 13:00:49	1.9
  +++ MailAddress.java	2001/04/19 04:07:38	1.10
  @@ -1,17 +1,15 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   import javax.mail.internet.InternetAddress;
   import javax.mail.internet.ParseException;
   
  -
   /**
    * A representation of an email address.
    * <p>This class encapsulates functionalities to access to different
  @@ -56,7 +54,7 @@
       public static final long serialVersionUID = 2779163542539434916L;
   
       private final static char[] SPECIAL =
  -            {'<', '>', '(', ')', '[', ']', '\\', '.', ',', ';', ':', '@', '\"'};
  +    {'<', '>', '(', ')', '[', ']', '\\', '.', ',', ';', ':', '@', '\"'};
   
       private String user = null;
       private String host = null;
  @@ -79,7 +77,7 @@
   
           try {
               //parse local-part
  -                //<local-part> ::= <dot-string> | <quoted-string>
  +            //<local-part> ::= <dot-string> | <quoted-string>
               if (address.charAt(pos) == '\"') {
                   userSB.append(parseQuotedLocalPart(address));
               } else {
  @@ -401,7 +399,7 @@
               }
               char ch = address.charAt(pos);
               if (ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z'
  -                    || ch == '-') {
  +                || ch == '-') {
                   resultSB.append(ch + "");
                   pos++;
                   continue;
  
  
  
  1.4       +7 -8      jakarta-james/src/org/apache/mailet/Mailet.java
  
  Index: Mailet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/Mailet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Mailet.java	2001/03/05 15:00:55	1.3
  +++ Mailet.java	2001/04/19 04:07:39	1.4
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   /**
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/mailet/MailetConfig.java
  
  Index: MailetConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/MailetConfig.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MailetConfig.java	2001/03/05 15:00:57	1.2
  +++ MailetConfig.java	2001/04/19 04:07:39	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   import java.util.*;
  
  
  
  1.6       +11 -12    jakarta-james/src/org/apache/mailet/MailetContext.java
  
  Index: MailetContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/MailetContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MailetContext.java	2001/03/31 02:34:35	1.5
  +++ MailetContext.java	2001/04/19 04:07:39	1.6
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   import java.util.*;
  @@ -177,7 +176,7 @@
        * @param msg - the MimeMessage of the headers and body content of the outgoing message
        * @throws MessagingException - if the message fails to parse
        */
  -    void sendMail(MimeMessage msg) 
  +    void sendMail(MimeMessage msg)
           throws MessagingException;
   
       /**
  @@ -189,7 +188,7 @@
        * @param msg - the MimeMessage of the headers and body content of the outgoing message
        * @throws MessagingException - if the message fails to parse
        */
  -    void sendMail(MailAddress sender, Collection recipients, MimeMessage msg) 
  +    void sendMail(MailAddress sender, Collection recipients, MimeMessage msg)
           throws MessagingException;
   
       /**
  @@ -202,7 +201,7 @@
        * @param state - the state of the message, indicates which processor to use
        * @throws MessagingException - if the message fails to parse
        */
  -    void sendMail(MailAddress sender, Collection recipients, MimeMessage msg, String state) 
  +    void sendMail(MailAddress sender, Collection recipients, MimeMessage msg, String state)
           throws MessagingException;
   
       /**
  @@ -226,6 +225,6 @@
        * @param msg - the MimeMessage to store in a local mailbox
        * @throws MessagingException - if the message fails to parse
        */
  -    void storeMail(MailAddress sender, MailAddress recipient, MimeMessage msg) 
  +    void storeMail(MailAddress sender, MailAddress recipient, MimeMessage msg)
           throws MessagingException;
   }
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/mailet/MailetException.java
  
  Index: MailetException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/MailetException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MailetException.java	2000/10/16 05:01:54	1.2
  +++ MailetException.java	2001/04/19 04:07:40	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   import javax.mail.*;
  
  
  
  1.5       +7 -8      jakarta-james/src/org/apache/mailet/Matcher.java
  
  Index: Matcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/Matcher.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Matcher.java	2001/03/05 15:01:01	1.4
  +++ Matcher.java	2001/04/19 04:07:40	1.5
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   import java.util.*;
  
  
  
  1.3       +7 -8      jakarta-james/src/org/apache/mailet/MatcherConfig.java
  
  Index: MatcherConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/mailet/MatcherConfig.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MatcherConfig.java	2001/03/05 15:01:03	1.2
  +++ MatcherConfig.java	2001/04/19 04:07:40	1.3
  @@ -1,11 +1,10 @@
  -/*****************************************************************************
  - * Copyright (C) The Apache Software Foundation. All rights reserved.        *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  -
  +/*
  + * Copyright (C) The Apache Software Foundation. All rights reserved.
  + *
  + * This software is published under the terms of the Apache Software License
  + * version 1.1, a copy of which has been included with this distribution in
  + * the LICENSE file.
  + */
   package org.apache.mailet;
   
   /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org