Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1588

SMTPAppender code does not comply with documentation and c.s.m.s.SMTPTransport default config

    XMLWordPrintable

Details

    Description

      The documentation here says:
      stmpHost is mandatory and smtpPort is by default 25. Looking at the code of SMTPAppenderBase the mandatory value is not enforced, it does:

              if (smtpHost != null) {
                  props.put("mail.smtp.host", smtpHost);
              }
      

      Looking at c.s.m.s.SMTPTransport both are optional and have default values:

       718      * If port is not specified, set it to value of mail.smtp.port
       719          * property if it exists, otherwise default to 25.
       720      */
       721         if (port == -1)
       722         port = PropUtil.getIntProperty(props,
       723                     "mail." + name + ".port", -1);
       724         if (port == -1)
       725         port = defaultPort;
       726
       727     if (host == null || host.length() == 0)
       728         host = "localhost";
      

      Both Logback code and documentation should be updated according to it. No need to supply/require any at all.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            michael-o Michael Osipov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: