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/03/07 04:55:26 UTC

cvs commit: jakarta-james/src/org/apache/james/imapserver BaseCommand.java CommandFetch.java CommandStore.java SingleThreadedConnectionHandler.java

donaldp     01/03/06 19:55:26

  Modified:    src/org/apache/james/imapserver BaseCommand.java
                        CommandFetch.java CommandStore.java
                        SingleThreadedConnectionHandler.java
  Log:
  Updated BaseCommand to extend AbstractLoggable
  
  Revision  Changes    Path
  1.3       +12 -18    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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BaseCommand.java	2001/03/06 07:39:04	1.2
  +++ BaseCommand.java	2001/03/07 03:55:25	1.3
  @@ -13,12 +13,12 @@
   import java.util.*;
   import javax.mail.MessagingException;
   import javax.mail.internet.InternetHeaders;
  -import org.apache.avalon.Loggable;
  +import org.apache.avalon.AbstractLoggable;
   import org.apache.james.AccessControlException;
   import org.apache.james.AuthorizationException;
   import org.apache.james.core.EnhancedMimeMessage;
  -import org.apache.log.Logger;
   
  +
   /**
    * Provides methods useful for IMAP command objects.
    *
  @@ -28,17 +28,11 @@
    */
   
   public abstract class BaseCommand 
  -    implements Loggable {
  +    extends AbstractLoggable {
   
       //mainly to switch on stack traces and catch responses;  
       private static final boolean DEEP_DEBUG = true;
   
  -    protected Logger logger;
  -  
  -    public void setLogger( final Logger aLogger ) {
  -        logger = aLogger;
  -    }
  -
       /**
        * Turns a protocol-compliant string representing a message sequence
        * number set into a List of integers. Use of the wildcard * (star) relies
  @@ -50,13 +44,13 @@
        */
       protected List decodeSet( String rawSet, int exists ) throws IllegalArgumentException {
           if (rawSet == null) {
  -            logger.debug("Null argument in decodeSet");
  +            getLogger().debug("Null argument in decodeSet");
               throw new IllegalArgumentException("Null argument");
           } else if (rawSet.equals("")) {
  -            logger.debug("Empty argument in decodeSet");
  +            getLogger().debug("Empty argument in decodeSet");
               throw new IllegalArgumentException("Empty string argument"); 
           }
  -        logger.debug(" decodeSet called for: " + rawSet);
  +        getLogger().debug(" decodeSet called for: " + rawSet);
           List response = new ArrayList();
           int checkComma = rawSet.indexOf(",");
           if (checkComma == -1) {
  @@ -102,7 +96,7 @@
                   response.addAll(decodeSet(firstRawSet, exists));
                   response.addAll(decodeSet(secondRawSet, exists));
               } catch (IllegalArgumentException e) {
  -                logger.debug("Wonky arguments in: " + rawSet + " " + e);
  +                getLogger().debug("Wonky arguments in: " + rawSet + " " + e);
                   throw e;
               }
           }
  @@ -122,16 +116,16 @@
       protected List decodeUIDSet( String rawSet, List uidsList )
           throws IllegalArgumentException {
           if (rawSet == null) {
  -            logger.debug("Null argument in decodeSet");
  +            getLogger().debug("Null argument in decodeSet");
               throw new IllegalArgumentException("Null argument");
           } else if (rawSet.equals("")) {
  -            logger.debug("Empty argument in decodeSet");
  +            getLogger().debug("Empty argument in decodeSet");
               throw new IllegalArgumentException("Empty string argument"); 
           }
  -        logger.debug(" decodeUIDSet called for: " + rawSet);
  +        getLogger().debug(" decodeUIDSet called for: " + rawSet);
           Iterator it = uidsList.iterator();
           while (it.hasNext()) {
  -            logger.info ("uids present : " + (Integer)it.next() );
  +            getLogger().info ("uids present : " + (Integer)it.next() );
           }
           List response = new ArrayList();
           int checkComma = rawSet.indexOf(",");
  @@ -189,7 +183,7 @@
                   response.addAll(decodeUIDSet(firstRawSet, uidsList));
                   response.addAll(decodeUIDSet(secondRawSet, uidsList));
               } catch (IllegalArgumentException e) {
  -                logger.debug("Wonky arguments in: " + rawSet + " " + e);
  +                getLogger().debug("Wonky arguments in: " + rawSet + " " + e);
                   throw e;
               }
           }
  
  
  
  1.4       +38 -38    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CommandFetch.java	2001/03/06 07:39:04	1.3
  +++ CommandFetch.java	2001/03/07 03:55:25	1.4
  @@ -83,7 +83,7 @@
               set = decodeSet(setArg, currentMailbox.getExists());
           }
           if (DEEP_DEBUG) {
  -            logger.debug("Fetching message set of size: " + set.size());
  +            getLogger().debug("Fetching message set of size: " + set.size());
           }
           String firstFetchArg = commandLine.nextToken();
           int pos =  commandRaw.indexOf(firstFetchArg);
  @@ -96,7 +96,7 @@
           }
   
           if (DEEP_DEBUG) {
  -            logger.debug("Found fetchAttrsRaw: " + fetchAttrsRaw);
  +            getLogger().debug("Found fetchAttrsRaw: " + fetchAttrsRaw);
           }
           // decode the fetch attributes
           List fetchAttrs = new ArrayList();
  @@ -141,7 +141,7 @@
                   fetchAttrs.add("ENVELOPE");
                   fetchAttrs.add("BODY");
               }
  -            logger.debug("Found fetchAttrs: " + arg);
  +            getLogger().debug("Found fetchAttrs: " + arg);
           }
   
           try {
  @@ -175,7 +175,7 @@
                           }
                           if (flags == null) { // bad
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message flags.");
  -                            logger.error("Retrieved null flags for msn:" + msn);
  +                            getLogger().error("Retrieved null flags for msn:" + msn);
                               return;
                           } 
                           if (responseAdded) {
  @@ -196,7 +196,7 @@
                           }
                           if (attrs == null) { // bad
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
  -                            logger.error("Retrieved null attributes for msn:" + msn);
  +                            getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
                           } 
                           if (responseAdded) {
  @@ -217,7 +217,7 @@
                           }
                           if (attrs == null) { // bad
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
  -                            logger.error("Retrieved null attributes for msn:" + msn);
  +                            getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
                           } 
                           if (responseAdded) {
  @@ -236,7 +236,7 @@
                           }
                           if (attrs == null) { // bad
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
  -                            logger.error("Retrieved null attributes for msn:" + msn);
  +                            getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
                           } 
                           if (responseAdded) {
  @@ -255,7 +255,7 @@
                           }
                           if (attrs == null) { // bad
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
  -                            logger.error("Retrieved null attributes for msn:" + msn);
  +                            getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
                           } 
                           if (responseAdded) {
  @@ -274,7 +274,7 @@
                           }
                           if (attrs == null) { // bad
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
  -                            logger.error("Retrieved null attributes for msn:" + msn);
  +                            getLogger().error("Retrieved null attributes for msn:" + msn);
                               return;
                           } 
                           if (responseAdded) {
  @@ -291,7 +291,7 @@
                               }
                               if (attrs == null) { // bad
                                   out.println(tag + SP + msn + SP + NO + "Error retrieving message attributes.");
  -                                logger.error("Retrieved null attributes for msn:" + msn);
  +                                getLogger().error("Retrieved null attributes for msn:" + msn);
                                   return;
                               } 
                           
  @@ -313,7 +313,7 @@
                                   response += ")";
                               }
                               out.println(response);
  -                            logger.debug("Sending: " + response);
  +                            getLogger().debug("Sending: " + response);
                           }
                           InternetHeaders headers = null;
                           if (useUIDs) {
  @@ -323,7 +323,7 @@
                           }
                           if (headers == null) { // bad
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message.");
  -                            logger.error("Retrieved null headers for msn:" + msn);
  +                            getLogger().error("Retrieved null headers for msn:" + msn);
                               return;
                           } 
                           if (flags == null) {
  @@ -349,21 +349,21 @@
                           }
                           response += "{" + (count + 2) + "}";
                           out.println(response);
  -                        logger.debug("Sending: " + response);
  +                        getLogger().debug("Sending: " + response);
                           Iterator lit = lines.iterator();
                           while (lit.hasNext()) {
                               String line = (String)lit.next();
                               out.println(line);
  -                            logger.debug("Sending: " + line);
  +                            getLogger().debug("Sending: " + line);
                           }
                           out.println();
  -                        logger.debug("Sending blank line");
  +                        getLogger().debug("Sending blank line");
                           if (useUIDs) {
                               out.println(  " UID " + uid + ")");
  -                            logger.debug("Sending: UID " + uid + ")");
  +                            getLogger().debug("Sending: UID " + uid + ")");
                           } else {
                               out.println( ")" );
  -                            logger.debug("Sending: )");
  +                            getLogger().debug("Sending: )");
                           }
                           if (! arg.equalsIgnoreCase("BODY.PEEK[HEADER]")) {
                               try { // around setFlags()
  @@ -382,11 +382,11 @@
                                       }
                                   }
                               } catch (AccessControlException ace) {
  -                                logger.error("Exception storing flags for message: " + ace);
  +                                getLogger().error("Exception storing flags for message: " + ace);
                               } catch (AuthorizationException aze) {
  -                                logger.error("Exception storing flags for message: " + aze);
  +                                getLogger().error("Exception storing flags for message: " + aze);
                               } catch (Exception e) {
  -                                logger.error("Unanticipated exception storing flags for message: " + e);
  +                                getLogger().error("Unanticipated exception storing flags for message: " + e);
                               }
                           }        
                           response = UNTAGGED + SP + msn + SP + "FETCH (";
  @@ -400,7 +400,7 @@
                                   response += ")";
                               }
                               out.println(response);
  -                            logger.debug("Sending: " + response);
  +                            getLogger().debug("Sending: " + response);
                           }
                           InternetHeaders headers = null;
                           if (useUIDs) {
  @@ -410,7 +410,7 @@
                           }
                           if (headers == null) { // bad
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message.");
  -                            logger.error("Retrieved null headers for msn:" + msn);
  +                            getLogger().error("Retrieved null headers for msn:" + msn);
                               return;
                           } 
                           if (flags == null) {
  @@ -446,7 +446,7 @@
                           }
                           Iterator it2 = fields.iterator();
                           while (it2.hasNext()) {
  -                            logger.debug("request for field: " + (String)it2.next());
  +                            getLogger().debug("request for field: " + (String)it2.next());
                           }
                           String[] names = (String[])fields.toArray(new String[fields.size()]);
                           Enumeration enum = null;
  @@ -464,12 +464,12 @@
                           }
                           response += "{" + (count + 2) + "}";
                           out.println(response);
  -                        logger.debug("Sending: " + response);
  +                        getLogger().debug("Sending: " + response);
                           Iterator lit = lines.iterator();
                           while (lit.hasNext()) {
                               String line = (String)lit.next();
                               out.println(line);
  -                            logger.debug("Sending: " + line);
  +                            getLogger().debug("Sending: " + line);
                           }
                           out.println();
                           if (useUIDs) {
  @@ -493,11 +493,11 @@
                                                       + newflags + ")");
                                       }
                                   } catch (AccessControlException ace) {
  -                                    logger.error("Exception storing flags for message: " + ace);
  +                                    getLogger().error("Exception storing flags for message: " + ace);
                                   } catch (AuthorizationException aze) {
  -                                    logger.error("Exception storing flags for message: " + aze);
  +                                    getLogger().error("Exception storing flags for message: " + aze);
                                   } catch (Exception e) {
  -                                    logger.error("Unanticipated exception storing flags for message: " + e);
  +                                    getLogger().error("Unanticipated exception storing flags for message: " + e);
                                   }
                               }
                           }
  @@ -532,7 +532,7 @@
                           }
                           if (msg == null) { // bad
                               out.println(tag + SP + msn + SP + BAD + "Error retrieving message.");
  -                            logger.error("Retrieved null message");
  +                            getLogger().error("Retrieved null message");
                               return;
                           } 
                           try {
  @@ -566,13 +566,13 @@
                               }
                           } catch (MessagingException me) {
                               out.println(UNTAGGED + SP + NO + SP + "Error retrieving message");
  -                            logger.error("Exception retrieving message: " + me);
  +                            getLogger().error("Exception retrieving message: " + me);
                           } catch (IOException ioe) {
                               out.println(UNTAGGED + SP + NO + SP + "Error retrieving message");
  -                            logger.error("Exception sending message: " + ioe);
  +                            getLogger().error("Exception sending message: " + ioe);
                           } catch (Exception e) {
                               out.println(UNTAGGED + SP + NO + SP + "Error retrieving message");
  -                            logger.error("Unanticipated exception retrieving message: " + e);
  +                            getLogger().error("Unanticipated exception retrieving message: " + e);
                           }
                           response = UNTAGGED + SP + msn + SP + "FETCH (";
                           responseAdded = false;
  @@ -603,7 +603,7 @@
                           }
                           if (msg == null) { // bad
                               out.println(tag + SP + msn + SP + NO + "Error retrieving message.");
  -                            logger.error("Retrieved null message");
  +                            getLogger().error("Retrieved null message");
                               return;
                           } 
                           try {
  @@ -637,13 +637,13 @@
                               }
                           } catch (MessagingException me) {
                               out.println(UNTAGGED + SP + NO + SP + "Error retrieving message");
  -                            logger.error("Exception retrieving message: " + me);
  +                            getLogger().error("Exception retrieving message: " + me);
                           } catch (IOException ioe) {
                               out.println(UNTAGGED + SP + NO + SP + "Error retrieving message");
  -                            logger.error("Exception sending message: " + ioe);
  +                            getLogger().error("Exception sending message: " + ioe);
                           } catch (Exception e) {
                               out.println(UNTAGGED + SP + NO + SP + "Error retrieving message");
  -                            logger.error("Unanticipated exception retrieving message: " + e);
  +                            getLogger().error("Unanticipated exception retrieving message: " + e);
                           }
                           response = UNTAGGED + SP + msn + SP + "FETCH (";
                           responseAdded = false;
  @@ -658,7 +658,7 @@
                           }
                           out.println(tag + SP + NO + SP
                                       + "FETCH attribute not recognized");
  -                        logger.error("Received: " + arg + " as argument to fetch");
  +                        getLogger().error("Received: " + arg + " as argument to fetch");
                           return;
                       }
                   } // end while loop
  @@ -687,7 +687,7 @@
           } catch (Exception e) {
               out.println(tag + SP + NO + SP
                           + "Unknown server error.");
  -            logger.error("Exception expunging mailbox " + currentFolder + " by user " + user + " was : " + e);
  +            getLogger().error("Exception expunging mailbox " + currentFolder + " by user " + user + " was : " + e);
               if (DEEP_DEBUG) {e.printStackTrace();}
               return;
           }
  
  
  
  1.3       +1 -2      jakarta-james/src/org/apache/james/imapserver/CommandStore.java
  
  Index: CommandStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/imapserver/CommandStore.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CommandStore.java	2001/03/06 07:39:04	1.2
  +++ CommandStore.java	2001/03/07 03:55:25	1.3
  @@ -7,7 +7,6 @@
    */
   package org.apache.james.imapserver;
   
  -
   import java.io.IOException;
   import java.io.OutputStream;
   import java.io.PrintWriter;
  @@ -139,7 +138,7 @@
           } catch (IllegalArgumentException iae) {
               out.println(tag + SP + BAD + SP
                           + "Arguments to store not recognised.");
  -            logger.error("Unrecognised arguments for STORE by user "  + user
  +            getLogger().error("Unrecognised arguments for STORE by user "  + user
                            + " with " + commandRaw);
               return;
           }
  
  
  
  1.10      +44 -44    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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SingleThreadedConnectionHandler.java	2001/03/07 03:37:14	1.9
  +++ SingleThreadedConnectionHandler.java	2001/03/07 03:55:25	1.10
  @@ -156,9 +156,9 @@
       }
   
       public void init() throws Exception {
  -        logger.info("SingleThreadedConnectionHandler starting ...");
  +        getLogger().info("SingleThreadedConnectionHandler starting ...");
           namespaceToken = imapSystem.getNamespaceToken();
  -        logger.info("SingleThreadedConnectionHandler initialized");
  +        getLogger().info("SingleThreadedConnectionHandler initialized");
       }
   
       /**
  @@ -181,10 +181,10 @@
               remoteHost = socket.getInetAddress ().getHostName ();
               remoteIP = socket.getInetAddress ().getHostAddress ();
           } catch (Exception e) {
  -            logger.error("Cannot open connection from " + remoteHost + " ("
  +            getLogger().error("Cannot open connection from " + remoteHost + " ("
                            + remoteIP + "): " + e.getMessage());
           }
  -        logger.info("Connection from " + remoteHost + " (" + remoteIP + ")");
  +        getLogger().info("Connection from " + remoteHost + " (" + remoteIP + ")");
   
           try {
               final PeriodicTimeTrigger trigger = new PeriodicTimeTrigger( timeout, -1 );
  @@ -203,7 +203,7 @@
                                   + "logged in as" + SP + user);
                       state = AUTHENTICATED;
                       user = "preauth user";
  -                    securityLogger.info("Pre-authenticated connection from  "
  +                    securityGetLogger().info("Pre-authenticated connection from  "
                                           + remoteHost + "(" + remoteIP
                                           + ") received by SingleThreadedConnectionHandler");
                   } else {
  @@ -211,7 +211,7 @@
                                   + "server " + this.servername + SP + "ready.");
                       state = NON_AUTHENTICATED;
                       user = "unknown";
  -                    securityLogger.info("Non-authenticated connection from  "
  +                    securityGetLogger().info("Non-authenticated connection from  "
                                           + remoteHost + "(" + remoteIP
                                           + ") received by SingleThreadedConnectionHandler");
                   }
  @@ -228,7 +228,7 @@
              
           } catch (Exception e) {
               // This should never happen once code is debugged
  -            logger.error("Exception during connection from " + remoteHost
  +            getLogger().error("Exception during connection from " + remoteHost
                            + " (" + remoteIP + ") : " + e.getMessage());
               e.printStackTrace();
               connectionClosed = closeConnection(UNTAGGED_BYE,
  @@ -239,7 +239,7 @@
       }
   
       public void targetTriggered( final String triggerName ) {
  -        logger.info("Connection timeout on socket");
  +        getLogger().info("Connection timeout on socket");
           connectionClosed = closeConnection(UNTAGGED_BYE,
                                              "Autologout. Idle too long.", "");
       }
  @@ -276,10 +276,10 @@
               }
               out.flush();
               socket.close();
  -            logger.info("Connection closed" + SP + exitStatus + SP + message1
  +            getLogger().info("Connection closed" + SP + exitStatus + SP + message1
                           +  SP + message2);
           } catch (IOException ioe) {
  -            logger.error("Exception while closing connection from " + remoteHost
  +            getLogger().error("Exception while closing connection from " + remoteHost
                            + " (" + remoteIP + ") : " + ioe.getMessage());
               try {
                   socket.close();
  @@ -296,7 +296,7 @@
           boolean subscribeOnly = false;
   
           if (commandRaw == null) return false;
  -        //        logger.debug("Command recieved: " + commandRaw + " from " + remoteHost
  +        //        getLogger().debug("Command recieved: " + commandRaw + " from " + remoteHost
           //           + "(" + remoteIP  + ")");
           //String command = commandRaw.trim();
           StringTokenizer commandLine = new StringTokenizer(commandRaw.trim(), " ");
  @@ -341,7 +341,7 @@
                   checkExpunge();
               }
               out.println(tag + SP + OK + SP + "CAPABILITY completed");
  -            logger.debug("Capability command completed for " + remoteHost
  +            getLogger().debug("Capability command completed for " + remoteHost
                            + "(" + remoteIP  + ")");
               return true;
               
  @@ -352,7 +352,7 @@
               }
               // we could send optional untagged status responses as well
               out.println(tag + SP + OK + SP + "NOOP completed");
  -            logger.debug("Noop command completed for " + remoteHost
  +            getLogger().debug("Noop command completed for " + remoteHost
                            + "(" + remoteIP  + ")");
               return true;
               
  @@ -368,23 +368,23 @@
           if (state == NON_AUTHENTICATED) {
               if (command.equalsIgnoreCase("AUTHENTICATE")) {
                   out.println(tag + SP + NO + SP + "Auth type not supported.");
  -                logger.info("Attempt to use Authenticate command by "
  +                getLogger().info("Attempt to use Authenticate command by "
                               + remoteHost  + "(" + remoteIP  + ")");
  -                securityLogger.info("Attempt to use Authenticate command by "
  +                securityGetLogger().info("Attempt to use Authenticate command by "
                                       + remoteHost  + "(" + remoteIP  + ")");
                   return true;
               } else if (command.equalsIgnoreCase("LOGIN")) {
                   if (arguments != 4) {
                       out.println(tag + SP + BAD + SP
                                   + "Command should be <tag> <LOGIN> <username> <password>");
  -                    logger.info("Wrong number of arguments for LOGIN command from "
  +                    getLogger().info("Wrong number of arguments for LOGIN command from "
                                   + remoteHost  + "(" + remoteIP  + ")");
                       return true;
                   }
                   user = decodeAstring(commandLine.nextToken());
                   String password = decodeAstring(commandLine.nextToken());
                   if (users.test(user, password)) {
  -                    securityLogger.info("Login successful for " + user + " from  "
  +                    securityGetLogger().info("Login successful for " + user + " from  "
                                           + remoteHost + "(" + remoteIP  + ")");
                       // four possibilites handled:
                       // private mail: isLocal, is Remote
  @@ -426,7 +426,7 @@
                       // position at root of default Namespace,
                       // which is not actually a folder
                       currentFolder = currentNamespace + currentSeperator + "";
  -                    logger.debug("Current folder for user "  + user + " from "
  +                    getLogger().debug("Current folder for user "  + user + " from "
                                    + remoteHost  + "(" + remoteIP  + ") is "
                                    + currentFolder);
                       return true;
  @@ -435,7 +435,7 @@
                   } // failed password test
                   // We should add ability to monitor attempts to login
                   out.println(tag + SP + NO + SP + "LOGIN failed");
  -                securityLogger.error("Failed attempt to use Login command for account "
  +                securityGetLogger().error("Failed attempt to use Login command for account "
                                        + user + " from "  + remoteHost  + "(" + remoteIP
                                        + ")");
                   return true;
  @@ -447,7 +447,7 @@
           
           // Commands not yet processed should be valid in either
           // Authenticated or Selected states.
  -        logger.debug("Command recieved: " + commandRaw + " from " + remoteHost
  +        getLogger().debug("Command recieved: " + commandRaw + " from " + remoteHost
                        + "(" + remoteIP  + ")");
   
           // Create ImapRequest object here - is this the right stage?
  @@ -467,7 +467,7 @@
               if (command.equalsIgnoreCase("NAMESPACE")) {
                   String namespaces = imapSystem.getNamespaces(user);
                   out.println(UNTAGGED + SP + "NAMESPACE " + namespaces);
  -                logger.info("Provided NAMESPACE: " + namespaces );
  +                getLogger().info("Provided NAMESPACE: " + namespaces );
                   if (state == SELECTED ) {
                       checkSize();
                       checkExpunge();
  @@ -494,7 +494,7 @@
                   try {
                       out.println(UNTAGGED + SP + "ACL " + target.getName() + SP
                                   + target.getAllRights(user ));
  -                    logger.debug(UNTAGGED + SP + "ACL " + target.getName() + SP
  +                    getLogger().debug(UNTAGGED + SP + "ACL " + target.getName() + SP
                                    + target.getAllRights(user ));
                   } catch (AccessControlException ace) {
                       out.println(tag + SP + NO + SP + "Unknown mailbox");
  @@ -535,13 +535,13 @@
                       if (target.setRights(user, identity, changes)) {
                           out.println(tag + SP + OK + SP 
                                       + "SetACL command completed");
  -                        securityLogger.info("ACL rights for "  + identity + " in "
  +                        securityGetLogger().info("ACL rights for "  + identity + " in "
                                               + folder  + " changed by " + user + " : "
                                               +  changes);
                       } else {
                           out.println(tag + SP + NO + SP 
                                       + "SetACL command failed");
  -                        securityLogger.info("Failed attempt to change ACL rights for "
  +                        securityGetLogger().info("Failed attempt to change ACL rights for "
                                               + identity + " in " + folder  + " by "
                                               + user);
                       }
  @@ -583,12 +583,12 @@
                       if (target.setRights(user, identity, changes)) {
                           out.println(tag + SP + OK + SP
                                       + "DeleteACL command completed");
  -                        securityLogger.info("ACL rights for "  + identity + " in "
  +                        securityGetLogger().info("ACL rights for "  + identity + " in "
                                               + folder + " deleted by " + user);
                       } else {
                           out.println(tag + SP + NO + SP 
                                       + "SetACL command failed");
  -                        securityLogger.info("Failed attempt to change ACL rights for "
  +                        securityGetLogger().info("Failed attempt to change ACL rights for "
                                               + identity + " in " + folder  + " by "
                                               + user);
                       }
  @@ -731,7 +731,7 @@
                       state = SELECTED;
                       exists = -1;
                       recent = -1;
  -                    logger.debug("Current folder for user "  + user + " from "
  +                    getLogger().debug("Current folder for user "  + user + " from "
                                    + remoteHost  + "(" + remoteIP  + ") is "
                                    + currentFolder);
   
  @@ -838,7 +838,7 @@
                       } else {
                           out.println(tag + SP + NO + SP
                                       + "Delete failed, unknown error");
  -                        logger.info("Attempt to delete mailbox " + folder
  +                        getLogger().info("Attempt to delete mailbox " + folder
                                       + " by user " + user + " failed.");
                       }
                   } catch (MailboxException mbe) {
  @@ -880,7 +880,7 @@
                       } else {
                           out.println(tag + SP + NO + SP
                                       + "Rename failed, unknown error");
  -                        logger.info("Attempt to rename mailbox " + folder
  +                        getLogger().info("Attempt to rename mailbox " + folder
                                       + " to " + newName
                                       + " by user " + user + " failed.");
                       }
  @@ -1001,12 +1001,12 @@
                       list = imapHost.listMailboxes(user, reference, folder,
                                                     subscribeOnly);
                       if (list == null) {
  -                        logger.debug(tag + SP + NO + SP + command
  +                        getLogger().debug(tag + SP + NO + SP + command
                                        + " unable to interpret mailbox");
                           out.println(tag + SP + NO + SP + command
                                       + " unable to interpret mailbox");
                       } else if (list.size() == 0) {
  -                        logger.debug("List request matches zero mailboxes: " + commandRaw);
  +                        getLogger().debug("List request matches zero mailboxes: " + commandRaw);
                           out.println(tag + SP + OK + SP + command
                                       + " completed");
                       } else {
  @@ -1015,7 +1015,7 @@
                               String listResponse = (String)it.next();
                               out.println(UNTAGGED + SP + command.toUpperCase()
                                           + SP + listResponse);
  -                            logger.debug(UNTAGGED + SP + command.toUpperCase()
  +                            getLogger().debug(UNTAGGED + SP + command.toUpperCase()
                                            + SP + listResponse);
                           }
                           out.println(tag + SP + OK + SP + command
  @@ -1134,7 +1134,7 @@
                   try {
                       currentMailbox.expunge(user);
                   } catch (Exception e) {
  -                    logger.error("Exception while expunging mailbox on CLOSE : " + e);
  +                    getLogger().error("Exception while expunging mailbox on CLOSE : " + e);
                   }
                   currentMailbox.removeMailboxEventListener(this);
                   imapHost.releaseMailbox(user, currentMailbox);
  @@ -1152,7 +1152,7 @@
                   }
                   List set = decodeSet(commandLine.nextToken(),
                                        currentMailbox.getExists());
  -                logger.debug("Fetching message set of size: " + set.size());
  +                getLogger().debug("Fetching message set of size: " + set.size());
                   String  targetFolder = getFullName(commandLine.nextToken());
   
                   ACLMailbox targetMailbox = getBox(user,  targetFolder);
  @@ -1207,7 +1207,7 @@
                   } catch (Exception e) {
                       out.println(tag + SP + NO + SP
                                   + "Unknown server error.");
  -                    logger.error("Exception expunging mailbox " + folder + " by user " + user + " was : " + e);
  +                    getLogger().error("Exception expunging mailbox " + folder + " by user " + user + " was : " + e);
                       if (DEEP_DEBUG) {e.printStackTrace();}
                       return true;
                   }
  @@ -1271,7 +1271,7 @@
       
       public void stop() {
           // todo
  -        logger.error("Stop IMAPHandler");
  +        getLogger().error("Stop IMAPHandler");
       }
   
       public void receiveEvent(MailboxEvent me) {
  @@ -1289,7 +1289,7 @@
                   out.println(tag + SP + NO + SP + "[REFERRAL " + me.getRemoteServer() +"]" + SP + "Remote mailbox" );
               } else {
                   out.println(tag + SP + NO + SP + "Unknown mailbox" );
  -                logger.info("MailboxException in method getBox for user: "
  +                getLogger().info("MailboxException in method getBox for user: "
                               + user + " mailboxName: " + mailboxName + " was "
                               + me.getMessage());
               }
  @@ -1301,10 +1301,10 @@
       }
       
       private String getFullName(String name) {
  -        logger.debug("Method getFullName called for " + name);
  +        getLogger().debug("Method getFullName called for " + name);
           name = decodeAstring(name);
           if (name == null) {
  -            logger.error("Received null name");
  +            getLogger().error("Received null name");
               return null;
           }
           int inbox = name.toUpperCase().indexOf("INBOX");
  @@ -1327,14 +1327,14 @@
       }
   
       public void logACE(AccessControlException ace) {
  -        securityLogger.error("AccessControlException by user "  + user
  +        securityGetLogger().error("AccessControlException by user "  + user
                                + " from "  + remoteHost  + "(" + remoteIP
                                + ") with " + commandRaw + " was "
                                + ace.getMessage());
       }
   
       public void logAZE(AuthorizationException aze) {
  -        securityLogger.error("AuthorizationException by user "  + user
  +        securityGetLogger().error("AuthorizationException by user "  + user
                                + " from "  + remoteHost  + "(" + remoteIP
                                + ") with " + commandRaw + " was "
                                + aze.getMessage());
  @@ -1367,7 +1367,7 @@
                       return rawAstring.substring(1, rawAstring.length() - 1);
                   }
               } else {
  -                logger.error("Quoted string with no closing quote.");
  +                getLogger().error("Quoted string with no closing quote.");
                   return null;
               }
           } else {
  @@ -1393,11 +1393,11 @@
       private void checkExpunge() {
           List newList = currentMailbox.listUIDs(user);
           for (int k = 0; k < newList.size(); k++) {
  -            logger.debug("New List msn " + (k+1) + " is uid "  + newList.get(k));
  +            getLogger().debug("New List msn " + (k+1) + " is uid "  + newList.get(k));
           }
           for (int i = sequence.size() -1; i > -1 ; i--) {
               Integer j = (Integer)sequence.get(i);
  -            logger.debug("Looking for old msn " + (i+1) + " was uid " + j);
  +            getLogger().debug("Looking for old msn " + (i+1) + " was uid " + j);
               if (! newList.contains((Integer)sequence.get(i))) {
                   out.println(UNTAGGED + SP + (i+1) + " EXPUNGE");
               }