Reply by email SSL self signed certificate error

Ok I think I’ve found the solution @downey @riking @codinghorror :slight_smile:

Just need to add a site setting pop3 polling ssl verify none

Then update this code:

from:

    def poll_pop3
      connection = Net::POP3.new(SiteSetting.pop3_polling_host, SiteSetting.pop3_polling_port)
      connection.enable_ssl if SiteSetting.pop3_polling_ssl

      connection.start(SiteSetting.pop3_polling_username, SiteSetting.pop3_polling_password) do |pop|
        unless pop.mails.empty?
          pop.each do |mail|
            handle_mail(mail)
          end
        end
        pop.finish
      end
    rescue Net::POPAuthenticationError => e
      Discourse.handle_job_exception(e, error_context(@args, "Signing in to poll incoming email"))
    end

to:

    def poll_pop3
      connection = Net::POP3.new(SiteSetting.pop3_polling_host, SiteSetting.pop3_polling_port)
      if SiteSetting.pop3_polling_ssl
        if SiteSetting.pop3_polling_ssl_verify_none
          connection.enable_ssl(OpenSSL::SSL::VERIFY_NONE)
        else
          connection.enable_ssl
        end 
      end
        
      connection.start(SiteSetting.pop3_polling_username, SiteSetting.pop3_polling_password) do |pop|
        unless pop.mails.empty?
          pop.each do |mail|
            handle_mail(mail)
          end
        end
        pop.finish
      end
    rescue Net::POPAuthenticationError => e
      Discourse.handle_job_exception(e, error_context(@args, "Signing in to poll incoming email"))
    end

If this is ok, and if someone can point me in the right direction of how to add the site setting I can send a PR (but quite happy for one of you guys to do it instead as that’d be quicker.)