Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-2307

mail.smtp.ssl=true should not also set mail.smtp.starttls.enable=true

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 2.4.0.patch, 2.4.1
    • API
    • None

    Description

      If option mail.smtp.ssl is set, GrouperEmail also sets mail.smtp.starttls.enable.

      edu.internet2.middleware.grouper.util.GrouperEmail

      169   public void send() {
      ...
      216       boolean useSsl = GrouperConfig.retrieveConfig().propertyValueBoolean("mail.smtp.ssl", false);
      217       if (useSsl) {
      218         
      219         properties.put("mail." + propertyProtocol + ".starttls.enable","true");
      220         properties.put("mail." + propertyProtocol + ".socketFactory.class", "javax.net.ssl.SSLSocketFactory");
      221         properties.put("mail." + propertyProtocol + ".socketFactory.fallback", "false");
      222         
      223       }
      ...
      246       {
      247         Boolean mailSmtpStartTlsEnable = GrouperConfig.retrieveConfig().propertyValueBoolean("mail.smtp.starttls.enable");
      248         if (mailSmtpStartTlsEnable != null) {
      249           properties.put("mail." + propertyProtocol + ".starttls.enable", mailSmtpStartTlsEnable ? "true" : "false");
      250         }
      251       }
      

      If mail.smtp.ssl=true and mail.smtp.starttls.enable=false, then the second option undoes the incorrect default, and there are no issues. If mail.smtp.ssl=true and mail.smtp.starttls.enable=null, it leaves both to true, and there is a conflict. It's non-fatal and only shows up in debug mode:

      DEBUG SMTP: STARTTLS requested but already using SSL

      Also, it may be of benefit to warn the user when the config has both mail.smtp.ssl=true and mail.smtp.starttls.enable=true, since this is probably not what they want.

      Attachments

        Issue Links

          Activity

            People

              chad.redman@at.internet2.edu Chad Redman (unc.edu)
              chad.redman@at.internet2.edu Chad Redman (unc.edu)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: