Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2.2, 4.1, 4.1.1, 5.0
    • Fix Version/s: None
    • Component/s: mail
    • Labels:
      None

      Description

      javamail debug log is not logged if I use javamail resource created by asadmin command.

      ex)

      asadmin create-javamail-resource --target server --mailuser=test@sample.com --fromaddress=test@sample.com --mailhost=127.0.0.1 --storeprotocol=imap --storeprotocolclass=com.sun.mail.imap.IMAPStore --transprotocol=smtp --transprotocolclass=com.sun.mail.smtp.SMTPTransport --description=description1 --property mail-password=password:mail-debug=true mail/MySession
      

      Following logs are NOT logged to server.log

      DEBUG: trying to connect to host "127.0.0.1", port 143, isSSL false
      * OK IMAPrev1
      A0 CAPABILITY
       CAPABILITY IMAP4 IMAP4rev1 CHILDREN IDLE QUOTA SORT
      A0 OK CAPABILITY completed
      |#]
      

      This is the patch for this problem.
      Two line are removed.

      org.glassfish.resources.javamail.naming.MailNamingObjectFactory.java
              Properties props = config.getMailProperties();
              javax.mail.Session s = javax.mail.Session.getInstance(props, new MailSessionAuthenticator(props));
              if("smtps".equals(props.getProperty("mail.transport.protocol"))) {
                  s.setProtocolForAddress("rfc822", "smtps");
              }
      -       s.setDebugOut(new PrintStream(new MailLogOutputStream()));
      -       s.setDebug(true);
      
              return s;
      

        Activity

        Hide
        mskdeepak added a comment -

        The logs you mentioned are logged under the "javax.mail" logger. Please set the log level of this logger to "FINE" or "FINER" depending on the amount of output you want to view the messages in server.log.

        Show
        mskdeepak added a comment - The logs you mentioned are logged under the "javax.mail" logger. Please set the log level of this logger to "FINE" or "FINER" depending on the amount of output you want to view the messages in server.log.
        Hide
        mskdeepak added a comment -

        Fixed in r64532. Added JavaMail logger(javax.mail) into the list-loggers and list-log-levels command output.

        Modified Paths:
        ---------------
        trunk/main/appserver/logging/logging.properties
        trunk/main/appserver/resources/javamail/javamail-connector/pom.xml
        trunk/main/appserver/resources/javamail/javamail-connector/src/main/java/org/glassfish/resources/javamail/MailLogOutputStream.java

        Show
        mskdeepak added a comment - Fixed in r64532. Added JavaMail logger(javax.mail) into the list-loggers and list-log-levels command output. Modified Paths: --------------- trunk/main/appserver/logging/logging.properties trunk/main/appserver/resources/javamail/javamail-connector/pom.xml trunk/main/appserver/resources/javamail/javamail-connector/src/main/java/org/glassfish/resources/javamail/MailLogOutputStream.java
        Hide
        mskdeepak added a comment -

        Fixed in r64532

        Show
        mskdeepak added a comment - Fixed in r64532

          People

          • Assignee:
            mskdeepak
            Reporter:
            yama0428
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: