[JIRA] (JENKINS-58976) Mail "Test configuration" not working with SMTP auth

13 views
Skip to first unread message

nharrer@gmx.at (JIRA)

unread,
Aug 17, 2019, 4:14:02 PM8/17/19
to jenkinsc...@googlegroups.com
Norbert Harrer created an issue
 
Jenkins / Task JENKINS-58976
Mail "Test configuration" not working with SMTP auth
Issue Type: Task Task
Assignee: Adrien Lecharpentier
Attachments: Exception.txt, jenkins_mail_config.png
Components: mailer-plugin
Created: 2019-08-17 20:13
Environment: OS: Windows 10 1809
Java: Oracle JRE 1.8.0_20-b26
Jenkins: 2.189
Mailer Plugin: 1.24
Jenkins is run as a windows service
Browser: Firefox 68.0.2
Labels: mailer smtp SSL
Priority: Minor Minor
Reporter: Norbert Harrer

The settings under "E-Mail Notification" are configured to use SMTP Authentication with SSL.

Using "Test configuration" leads to an exception: "java.net.SocketException: Connection closed by remote host". The full stack trace is attached.

This only happens with the "Test configuration" button. Regular build-failed mails actually work fine.

Mail is configured like this (see also jenkins_mail_config.png):

SMTP Server: smtp-relay.gmail.com
Use SMTP Authentication: checked
User Name and Password: entered
Use SSL: checked
SMTP Port: 465
Charset: UTF-8
Test e-mail recipient: e-mail address entered

Logging the traffic with sslsplit shows that AUTH LOGIN was not performed:

220 smtp-relay.gmail.com ESMTP h25sm4317wmb.21 - gsmtp
EHLO FIREBIRD
250-smtp-relay.gmail.com at your service, [_IP redacted_]
250-SIZE 157286400
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
MAIL FROM:<redacted>
550-5.7.1 Invalid credentials for relay [_IP redacted_]. The IP address you've
550-5.7.1 registered in your G Suite SMTP Relay service doesn't match domain of
550-5.7.1 the account this email is being sent from. If you are trying to relay
550-5.7.1 mail from a domain that isn't registered under your G Suite account
550-5.7.1 or has empty envelope-from, you must configure your mail server
550-5.7.1 either to use SMTP AUTH to identify the sending domain or to present
550-5.7.1 one of your domain names in the HELO or EHLO command. For more
550-5.7.1 information, please visit
550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred h25sm4317wmb.21 - gsmtp

Build-failed mails work as expected with AUTH LOGIN:

20 smtp-relay.gmail.com ESMTP cf12sm48397ejb.11 - gsmtp
EHLO FIREBIRD
250-smtp-relay.gmail.com at your service, [_IP redacted_]
250-SIZE 157286400
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
AUTH LOGIN
334 VXNlcm5hbWU6
redacted
334 UGFzc3dvcmQ6
redacted
235 2.7.0 Accepted
MAIL FROM:<redacted>
250 2.1.0 OK cf12sm48397ejb.11 - gsmtp
RCPT TO:<redacted>
250 2.1.5 OK cf12sm48397ejb.11 - gsmtp
DATA
354 Go ahead cf12sm48397ejb.11 - gsmtp
Date: Sat, 17 Aug 2019 21:10:44 +0200 (CEST)
From: Jenkins <redacted>
To: redacted
Message-ID: <14698696.4.1566069044700.JavaMail.FIREBIRD$@FIREBIRD>
In-Reply-To: <21875298.1.1566064846550.JavaMail.FIREBIRD$@FIREBIRD>
References: <21875298.1.1566064846550.JavaMail.FIREBIRD$@FIREBIRD>
Subject: Build failed in Jenkins: Plakat.NET #1515
MIME-Version: 1.0
...

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

nharrer@gmx.at (JIRA)

unread,
Aug 17, 2019, 4:15:02 PM8/17/19
to jenkinsc...@googlegroups.com
Norbert Harrer updated an issue
Change By: Norbert Harrer
The settings under "E-Mail Notification" are configured to use SMTP Authentication with SSL.

Using "Test configuration" leads to an exception: "java.net.SocketException: Connection closed by remote host". The full stack trace is attached.

This only happens with the "Test configuration" button. Regular build-failed mails actually work fine.

Mail is configured like this (see also jenkins_mail_config.png):

SMTP Server: smtp-relay.gmail.com
Use SMTP Authentication: checked
User Name and Password: entered
Use SSL: checked
SMTP Port: 465
Charset: UTF-8
Test e-mail recipient: e-mail address entered

Logging the traffic with sslsplit shows that AUTH LOGIN was not performed:

{{ 220 smtp-relay.gmail.com ESMTP h25sm4317wmb.21 - gsmtp }}
{{ EHLO FIREBIRD }}
{{ 250-smtp-relay.gmail.com at your service, [_IP redacted_] }}
{{ 250-SIZE 157286400 }}
{{ 250-8BITMIME }}
{{ 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH }}
{{ 250-ENHANCEDSTATUSCODES }}
{{ 250-PIPELINING }}
{{ 250-CHUNKING }}
{{ 250 SMTPUTF8 }}
{{ MAIL FROM:<_redacted_> }}
{{ 550-5.7.1 Invalid credentials for relay [_IP redacted_]. The IP address you've }}
{{ 550-5.7.1 registered in your G Suite SMTP Relay service doesn't match domain of }}
{{ 550-5.7.1 the account this email is being sent from. If you are trying to relay }}
{{ 550-5.7.1 mail from a domain that isn't registered under your G Suite account }}
{{ 550-5.7.1 or has empty envelope-from, you must configure your mail server }}
{{ 550-5.7.1 either to use SMTP AUTH to identify the sending domain or to present }}
{{ 550-5.7.1 one of your domain names in the HELO or EHLO command. For more }}
{{ 550-5.7.1 information, please visit }}
{{ 550 5.7.1 [ https://support.google.com/a/answer/6140680#invalidcred ] h25sm4317wmb.21 - gsmtp }}



Build-failed mails work as expected with AUTH LOGIN:

{{ 20 smtp-relay.gmail.com ESMTP cf12sm48397ejb.11 - gsmtp }}
{{ EHLO FIREBIRD }}
{{ 250-smtp-relay.gmail.com at your service, [_IP redacted_] }}
{{ 250-SIZE 157286400 }}
{{ 250-8BITMIME }}
{{ 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH }}
{{ 250-ENHANCEDSTATUSCODES }}
{{ 250-PIPELINING }}
{{ 250-CHUNKING }}
{{ 250 SMTPUTF8 }}
{{ AUTH LOGIN }}
{{ 334 VXNlcm5hbWU6 }}
{{ _redacted_ }}
{{ 334 UGFzc3dvcmQ6 }}
{{ _redacted_ }}
{{ 235 2.7.0 Accepted }}
{{ MAIL FROM:<_redacted_> }}
{{ 250 2.1.0 OK cf12sm48397ejb.11 - gsmtp }}
{{ RCPT TO:<_redacted_> }}
{{ 250 2.1.5 OK cf12sm48397ejb.11 - gsmtp }}
{{ DATA }}
{{ 354 Go ahead cf12sm48397ejb.11 - gsmtp }}
{{ Date: Sat, 17 Aug 2019 21:10:44 +0200 (CEST) }}
{{ From: Jenkins <_redacted_> }}
{{ To: _redacted_ }}
{{ Message-ID: <14698696.4.1566069044700.JavaMail.FIREBIRD$@FIREBIRD> }}
{{ In-Reply-To: <21875298.1.1566064846550.JavaMail.FIREBIRD$@FIREBIRD> }}
{{ References: <21875298.1.1566064846550.JavaMail.FIREBIRD$@FIREBIRD> }}
{{ Subject: Build failed in Jenkins: Plakat.NET #1515 }}
{{ MIME-Version: 1.0 }}
{{ ... }}

 

 

nharrer@gmx.at (JIRA)

unread,
Aug 17, 2019, 4:18:03 PM8/17/19
to jenkinsc...@googlegroups.com
{{ _redacted_}} redacted
{{ 334 UGFzc3dvcmQ6 }}
{{ _redacted_}} redacted
{{ 235 2.7.0 Accepted }}
{{ MAIL FROM:<_redacted_> }}
{{ 250 2.1.0 OK cf12sm48397ejb.11 - gsmtp }}
{{ RCPT TO:<_redacted_> }}
{{ 250 2.1.5 OK cf12sm48397ejb.11 - gsmtp }}
{{ DATA }}
{{ 354 Go ahead cf12sm48397ejb.11 - gsmtp }}
{{ Date: Sat, 17 Aug 2019 21:10:44 +0200 (CEST) }}
{{ From: Jenkins <_redacted_> }}
{{ To: _redacted_ }}
{{ Message-ID: <14698696.4.1566069044700.JavaMail.FIREBIRD$@FIREBIRD> }}
{{ In-Reply-To: <21875298.1.1566064846550.JavaMail.FIREBIRD$@FIREBIRD> }}
{{ References: <21875298.1.1566064846550.JavaMail.FIREBIRD$@FIREBIRD> }}
{{ Subject: Build failed in Jenkins: Plakat.NET #1515 }}
{{ MIME-Version: 1.0 }}
{{ ... }}

 

 

nharrer@gmx.at (JIRA)

unread,
Aug 17, 2019, 4:21:02 PM8/17/19
to jenkinsc...@googlegroups.com
Norbert Harrer updated an issue
The settings under "E-Mail Notification" are configured to use SMTP Authentication with SSL.

Using "Test configuration" leads to an exception: "java.net.SocketException: Connection closed by remote host". The full stack trace is attached.

This only happens with the "Test configuration" button. Regular build-failed mails actually work fine.

Mail is configured like this (see also jenkins_mail_config.png):

SMTP Server: smtp-relay.gmail.com
Use SMTP Authentication: checked
User Name and Password: entered
Use SSL: checked
SMTP Port: 465
Charset: UTF-8
Test e-mail recipient: e-mail address entered

Logging the traffic with sslsplit shows that AUTH LOGIN was not performed:

{color:#4c9aff} 220 smtp-relay.gmail.com ESMTP h25sm4317wmb.21 - gsmtp {color}
{color:#4c9aff} EHLO FIREBIRD {color}
{color:#4c9aff} 250-smtp-relay.gmail.com at your service, [_IP redacted_] {color}
{color:#4c9aff} 250-SIZE 157286400 {color}
{color:#4c9aff} 250-8BITMIME {color}
{color:#4c9aff} 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH {color}
{color:#4c9aff} 250-ENHANCEDSTATUSCODES {color}
{color:#4c9aff} 250-PIPELINING {color}
{color:#4c9aff} 250-CHUNKING {color}
{color:#4c9aff} 250 SMTPUTF8 {color}
{color:#4c9aff} MAIL FROM:<_redacted_> {color}
{color:#4c9aff} 550-5.7.1 Invalid credentials for relay [_IP redacted_]. The IP address you've {color}
{color:#4c9aff} 550-5.7.1 registered in your G Suite SMTP Relay service doesn't match domain of {color}
{color:#4c9aff} 550-5.7.1 the account this email is being sent from. If you are trying to relay {color}
{color:#4c9aff} 550-5.7.1 mail from a domain that isn't registered under your G Suite account {color}
{color:#4c9aff} 550-5.7.1 or has empty envelope-from, you must configure your mail server {color}
{color:#4c9aff} 550-5.7.1 either to use SMTP AUTH to identify the sending domain or to present {color}
{color:#4c9aff} 550-5.7.1 one of your domain names in the HELO or EHLO command. For more {color}
{color:#4c9aff} 550-5.7.1 information, please visit {color}
{color:#4c9aff} 550 5.7.1 [ https://support.google.com/a/answer/6140680#invalidcred ] h25sm4317wmb.21 - gsmtp {color}

Build-failed mails work as expected with AUTH LOGIN:

{color:#4c9aff} 20 smtp-relay.gmail.com ESMTP cf12sm48397ejb.11 - gsmtp {color}
{color:#4c9aff} EHLO FIREBIRD {color}
{color:#4c9aff} 250-smtp-relay.gmail.com at your service, [_IP redacted_] {color}
{color:#4c9aff} 250-SIZE 157286400 {color}
{color:#4c9aff} 250-8BITMIME {color}
{color:#4c9aff} 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH {color}
{color:#4c9aff} 250-ENHANCEDSTATUSCODES {color}
{color:#4c9aff} 250-PIPELINING {color}
{color:#4c9aff} 250-CHUNKING {color}
{color:#4c9aff} 250 SMTPUTF8 {color}
{color:#4c9aff} AUTH LOGIN {color}
{color:#4c9aff} 334 VXNlcm5hbWU6 {color}
{color:#4c9aff} redacted {color}
{color:#4c9aff} 334 UGFzc3dvcmQ6 {color}
{color:#4c9aff} redacted {color}
{color:#4c9aff} 235 2.7.0 Accepted {color}
{color:#4c9aff} MAIL FROM:<_redacted_> {color}
{color:#4c9aff} 250 2.1.0 OK cf12sm48397ejb.11 - gsmtp {color}
{color:#4c9aff} RCPT TO:<_redacted_> {color}
{color:#4c9aff} 250 2.1.5 OK cf12sm48397ejb.11 - gsmtp {color}
{color:#4c9aff} DATA {color}
{color:#4c9aff} 354 Go ahead cf12sm48397ejb.11 - gsmtp {color}
{color:#4c9aff} Date: Sat, 17 Aug 2019 21:10:44 +0200 (CEST) {color}
{color:#4c9aff} From: Jenkins <_redacted_> {color}
{color:#4c9aff} To: _redacted_ {color}
{color:#4c9aff} Message-ID: <14698696.4.1566069044700.JavaMail.FIREBIRD$@FIREBIRD> {color}
{color:#4c9aff} In-Reply-To: <21875298.1.1566064846550.JavaMail.FIREBIRD$@FIREBIRD> {color}
{color:#4c9aff} References: <21875298.1.1566064846550.JavaMail.FIREBIRD$@FIREBIRD> {color}
{color:#4c9aff} Subject: Build failed in Jenkins: Plakat.NET #1515 {color}
{color:#4c9aff} MIME-Version: 1.0 {color}
{color:#172b4d} ... {color}

nharrer@gmx.at (JIRA)

unread,
Aug 18, 2019, 2:30:01 PM8/18/19
to jenkinsc...@googlegroups.com
Norbert Harrer updated an issue
Change By: Norbert Harrer
Attachment: ssl-log-windows-vm.png

nharrer@gmx.at (JIRA)

unread,
Aug 18, 2019, 2:32:03 PM8/18/19
to jenkinsc...@googlegroups.com
Norbert Harrer commented on Task JENKINS-58976
 
Re: Mail "Test configuration" not working with SMTP auth

Just to be sure, I did a fresh install of Jenkins from the msi (jenkins-2.189.zip) in a VM running Windows 10 1903 which never had Jenkins installed before.

During install I selected "install suggested plugins".

It show the same behavior.

nharrer@gmx.at (JIRA)

unread,
Aug 18, 2019, 2:33:01 PM8/18/19
to jenkinsc...@googlegroups.com
Norbert Harrer edited a comment on Task JENKINS-58976
Just to be sure, I did a fresh install of Jenkins from the msi (jenkins-2.189.zip) in a VM running Windows 10 1903 which never had Jenkins installed before.

During install I selected "install suggested plugins".

It show shows the same behavior.

!ssl-log-windows-vm.png!
Reply all
Reply to author
Forward
0 new messages