SMTP via SSL with username and password

347 views
Skip to first unread message

Scott Koranda

unread,
Sep 2, 2016, 1:01:40 PM9/2/16
to pwm-general
Hello,

I am running pwm-1.8.0-SNAPSHOT (built from source checked out on September 1, 2016).

I have set

<setting key="email.smtp.address" syntax="STRING" syntaxVersion="0" modifyTi
me="2016-09-01T17:47:33Z">
      <label>SMTP Email Server Address</label>
      <value><![CDATA[email-smtp.us-east-1.amazonaws.com]]></value>
    </setting>
    <setting key="email.smtp.port" syntax="NUMERIC" syntaxVersion="0" modifyTime="2016-09-01T17:47:48Z">
      <label>SMTP Email Server Port</label>
      <value>465</value>
    </setting>
<setting key="email.smtp.username" syntax="STRING" syntaxVersion="0" modifyTime="2016-09-01T17:48:24Z">
      <label>SMTP Email Server User Name</label>
      <value><![CDATA[SOME_USER_NAME]></value>
    </setting>
    <setting key="email.smtp.userpassword" syntax="PASSWORD" syntaxVersion="0" modifyTime="2016-09-02T16:27:01Z" modifyUser="default|uid=SOME_DN">
      <label>SMTP Email Server Password</label>
      <!--Note: This value is encrypted and can not be edited directly.-->
      <!--Please use the Configuration Manager GUI to modify this value.-->
      <value>SOME_ENCRYPTED_VALUE</value>
    </setting>
<setting key="email.smtp.advancedSettings" syntax="STRING_ARRAY" syntaxVersion="0" modifyTime="2016-09-02T16:45:47Z" modifyUser="default|uid=SOME_DN">
      <label>SMTP Email Advanced Settings</label>
      <value><![CDATA[email.smtp.ssl.enable=true]]></value>
    </setting>

I see, however, this error in the log file:

2016-09-02T12:47:46Z, ERROR, queue.EmailQueueManager, 5085 ERROR_EMAIL_SEND_FAILURE (error sending email: Could not connect to SMTP host: email-smtp.us-east-1.amazonaws.com, port: 465, response: -1) fields: [{"to":"skor...@gmail.com","from":"New User Registration <SOME_RETURN>","subject":"New User Verification"}, javax.mail.MessagingException: Could not connect to SMTP host: email-smtp.us-east-1.amazonaws.com, port: 465, response: -1]

I have used openssl s_client to verify that I can authenticate to the SMTP server from the server on which PWM is running using the configured username and userpassword.

I would appreciate any insights into what I have missed? 

In particular, is the configuration

email.smtp.ssl.enable=true

the correct value to use to enable SSL for SMTP?

Thanks,

Scott


Scott Koranda

unread,
Sep 2, 2016, 1:14:36 PM9/2/16
to pwm-general
My apologies for answering my own post.

After reviewing the code in EmailQueueManager.java I discerned that I needed

<setting key="email.smtp.advancedSettings" syntax="STRING_ARRAY" syntaxVersi
on="0" modifyTime="2016-09-02T17:11:28Z" modifyUser="default|uid=SOME_DN">
      <label>SMTP Email Advanced Settings</label>
      <value><![CDATA[mail.smtp.ssl.enable=true]]></value>
      <value><![CDATA[mail.smtp.auth=true]]></value>
    </setting>

Sorry for the noise,

Scott
Reply all
Reply to author
Forward
0 new messages