james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/smtpserver SMTPHandler.java
Date Mon, 04 Feb 2002 15:34:11 GMT
danny       02/02/04 07:34:11

  Modified:    src/java/org/apache/james James.java
               src/java/org/apache/james/mailrepository
                        JDBCSpoolRepository.java
               src/java/org/apache/james/core MimeMessageWrapper.java
               src/java/org/apache/james/smtpserver SMTPHandler.java
  Log:
  merge of changes made in branch v2-0a2candidate1
  
  Revision  Changes    Path
  1.18      +7 -5      jakarta-james/src/java/org/apache/james/James.java
  
  Index: James.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/James.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- James.java	18 Jan 2002 02:48:35 -0000	1.17
  +++ James.java	4 Feb 2002 15:34:11 -0000	1.18
  @@ -54,8 +54,10 @@
    * @author Serge
    * @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    *
  - * This is $Revision: 1.17 $
  - * Committed on $Date: 2002/01/18 02:48:35 $ by: $Author: darrell $
  +
  + * This is $Revision: 1.18 $
  + * Committed on $Date: 2002/02/04 15:34:11 $ by: $Author: danny $
  +
    */
   public class James
       extends AbstractLogEnabled
  @@ -143,7 +145,7 @@
           serverNames = new Vector();
           Configuration serverConf = conf.getChild("servernames");
           if (serverConf.getAttribute("autodetect").equals("TRUE") && (!hostName.equals("localhost")))
{
  -            serverNames.add(hostName);
  +            serverNames.add(hostName.toLowerCase());
           }
   
           final Configuration[] serverNameConfs =
  @@ -446,11 +448,11 @@
       }
   
       public boolean isLocalServer( final String serverName ) {
  -        return serverNames.contains( serverName );
  +        return serverNames.contains(serverName.toLowerCase());
       }
   
       public String getServerInfo() {
  -        return "JAMES/1.3-dev";
  +        return "Apache Jakarta JAMES";
       }
   
       private Logger getMailetLogger() {
  
  
  
  1.12      +1 -1      jakarta-james/src/java/org/apache/james/mailrepository/JDBCSpoolRepository.java
  
  Index: JDBCSpoolRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/JDBCSpoolRepository.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JDBCSpoolRepository.java	18 Jan 2002 02:48:36 -0000	1.11
  +++ JDBCSpoolRepository.java	4 Feb 2002 15:34:11 -0000	1.12
  @@ -43,7 +43,7 @@
       /**
        * How long a thread should sleep when there are no messages to process.
        */
  -    private static int WAIT_LIMIT = 60000;
  +    private static int WAIT_LIMIT = 1000;
       /**
        * How long we have to wait before reloading the list of pending messages
        */
  
  
  
  1.8       +7 -2      jakarta-james/src/java/org/apache/james/core/MimeMessageWrapper.java
  
  Index: MimeMessageWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/MimeMessageWrapper.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MimeMessageWrapper.java	18 Jan 2002 02:48:35 -0000	1.7
  +++ MimeMessageWrapper.java	4 Feb 2002 15:34:11 -0000	1.8
  @@ -384,14 +384,19 @@
        * to avoid memory hogging.
        */
       public int getLineCount() throws MessagingException {
  -        InputStream in = getContentStream();
  +            InputStream in=null;
  +        try{
  +            in = getContentStream();
  +        }catch(Exception e){
  +            return -1;
  +        }
           if (in == null) {
               return -1;
           }
           //Wrap input stream in LineNumberReader
           //Not sure what encoding to use really...
           try {
  -            LineNumberReader counter = new LineNumberReader(new InputStreamReader(in, "ISO-8859-1"));
  +            LineNumberReader counter = new LineNumberReader(new InputStreamReader(in, getEncoding()));
               //Read through all the data
               char[] block = new char[1024];
               while (counter.read(block) > -1) {
  
  
  
  1.16      +15 -5     jakarta-james/src/java/org/apache/james/smtpserver/SMTPHandler.java
  
  Index: SMTPHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/smtpserver/SMTPHandler.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SMTPHandler.java	18 Jan 2002 02:48:37 -0000	1.15
  +++ SMTPHandler.java	4 Feb 2002 15:34:11 -0000	1.16
  @@ -42,8 +42,10 @@
    * @author Matthew Pangaro <mattp@lokitech.com>
    * @author Danny Angus <danny@thought.co.uk>
    *
  - * This is $Revision: 1.15 $
  - * Committed on $Date: 2002/01/18 02:48:37 $ by: $Author: darrell $
  +
  + * This is $Revision: 1.16 $
  + * Committed on $Date: 2002/02/04 15:34:11 $ by: $Author: danny $
  +
    */
   public class SMTPHandler
       extends BaseConnectionHandler
  @@ -193,14 +195,22 @@
           }
       }
   
  -    private void resetState() {
  + private void resetState() {
  +        String user = (String) state.get(AUTH);
  +
           state.clear();
  -        state.put(SERVER_NAME, this.helloName );
  -        state.put(SERVER_TYPE, this.softwaretype );
  +        state.put(SERVER_NAME, this.helloName);
  +        state.put(SERVER_TYPE, this.softwaretype);
           state.put(REMOTE_NAME, remoteHost);
           state.put(REMOTE_IP, remoteIP);
           state.put(SMTP_ID, smtpID);
  +        // seems that after authenticating an smtp client sends
  +        // a RSET, so we need to remember that they are authenticated
  +        if(user != null){
  +            state.put(AUTH, user);
  +        }
       }
  +
   
       private boolean parseCommand(String command)
           throws Exception {
  
  
  

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


Mime
View raw message