Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-28300

Emails not sent when default recipients do not include default suffix

      I am trying to use the "Default user E-mail suffix" setting to avoid duplication in the "Default Recipients" list, but it doesn't seem to be working. For example:

      With this configuration, I expect Email-Ext to append the default suffix to each entry in the default recipients list. This does seem to happen, as the log reports

      Checking if email needs to be generated
      Email was triggered for: Always
      Sending email for trigger: Always
      messageContentType = text/html; charset=UTF-8
      Request made to attach build log
      Request made to compress build log
      Adding recipients from project recipient list
      Adding recipients from trigger recipient list
      Setting In-Reply-To since last build was not successful
      Successfully created MimeMessage
      Sending email to: john.doe@foo.com jane.doe@foo.com
      

      But the email does not appear to be sent. At least, I'm not receiving anything.

      However, with the suffixes manually appended to each entry in the default recipients list:

      The emails are sent without issue. What's going on here?

          [JENKINS-28300] Emails not sent when default recipients do not include default suffix

          Josh Hagins added a comment -

          Alright, I set mail.debug to true in the system properties and restarted. Now what?

          Josh Hagins added a comment - Alright, I set mail.debug to true in the system properties and restarted. Now what?

          Alex Earl added a comment -

          Run the build and post the build log. It should contain debug output from JavaMail.

          Alex Earl added a comment - Run the build and post the build log. It should contain debug output from JavaMail.

          Josh Hagins added a comment -

          Strange, now that I go to test it again, it's working fine. I'll report back here if I have any more problems.

          Josh Hagins added a comment - Strange, now that I go to test it again, it's working fine. I'll report back here if I have any more problems.

          Alex Earl added a comment -

          I'll close it out for now, just reopen if you see the issue again.

          Alex Earl added a comment - I'll close it out for now, just reopen if you see the issue again.

          Josh Hagins added a comment - - edited

          Ah, I was wrong. It still isn't working, but not for the reason I thought. Compressing and attaching the build log seems to be the issue.

          When "Attach Build Log" is set to "Compress and Attach Build Log", the email is not sent. However, when it is set to either "Attach Build Log" or "Do Not Attach Build Log", the email is sent with no problems.

          Here's the log with "Compress and Attach Build Log", which claims to have sent the email:

          Checking if email needs to be generated
          Email was triggered for: Always
          Sending email for trigger: Always
          messageContentType = text/html; charset=UTF-8
          Request made to attach build log
          Request made to compress build log
          Adding recipients from project recipient list
          Adding recipients from trigger recipient list
          Successfully created MimeMessage
          Sending email to: master.commander@foo.com john.doe@foo.com jane.doe@foo.com joe.blow@foo.com row.boat@foo.com low.goat@foo.com
          DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
          DEBUG SMTP: useEhlo true, useAuth false
          DEBUG SMTP: trying to connect to host "<SMTP proxy host>", port 25, isSSL false
          220 mail-ut-01.foo.local Microsoft ESMTP MAIL Service, Version: 7.5.7601.17514 ready at  Mon, 11 May 2015 13:33:39 -0400 
          DEBUG SMTP: connected to host "<SMTP proxy host>", port: 25
          
          EHLO jenkins-ut-01.foo.local
          250-mail-ut-01.foo.local Hello [<Jenkins host>]
          250-TURN
          250-SIZE 2097152
          250-ETRN
          250-PIPELINING
          250-DSN
          250-ENHANCEDSTATUSCODES
          250-8bitmime
          250-BINARYMIME
          250-CHUNKING
          250-VRFY
          250 OK
          DEBUG SMTP: Found extension "TURN", arg ""
          DEBUG SMTP: Found extension "SIZE", arg "2097152"
          DEBUG SMTP: Found extension "ETRN", arg ""
          DEBUG SMTP: Found extension "PIPELINING", arg ""
          DEBUG SMTP: Found extension "DSN", arg ""
          DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
          DEBUG SMTP: Found extension "8bitmime", arg ""
          DEBUG SMTP: Found extension "BINARYMIME", arg ""
          DEBUG SMTP: Found extension "CHUNKING", arg ""
          DEBUG SMTP: Found extension "VRFY", arg ""
          DEBUG SMTP: Found extension "OK", arg ""
          DEBUG SMTP: use8bit false
          MAIL FROM:<jenkins@foo.com>
          250 2.1.0 jenkins@foo.com....Sender OK
          DEBUG SMTP: sendPartial set
          RCPT TO:<master.commander@foo.com>
          250 2.1.5 master.commander@foo.com 
          RCPT TO:<john.doe@foo.com>
          250 2.1.5 john.doe@foo.com 
          RCPT TO:<jane.doe@foo.com>
          250 2.1.5 jane.doe@foo.com 
          RCPT TO:<joe.blow@foo.com>
          250 2.1.5 joe.blow@foo.com 
          RCPT TO:<row.boat@foo.com>
          250 2.1.5 row.boat@foo.com 
          RCPT TO:<low.goat@foo.com>
          250 2.1.5 low.goat@foo.com 
          DEBUG SMTP: Verified Addresses
          DEBUG SMTP:  master.commander@foo.com 
          DEBUG SMTP:   john.doe@foo.com
          DEBUG SMTP:  jane.doe@foo.com 
          DEBUG SMTP:   joe.blow@foo.com
          DEBUG SMTP:  row.boat@foo.com 
          DEBUG SMTP:   low.goat@foo.com
          DATA
          354 Start mail input; end with <CRLF>.<CRLF>
          Date: Mon, 11 May 2015 13:33:38 -0400 (EDT)
          From:jenkins@foo.com 
          Reply-To:master.commander@foo.com 
          To: master.commander@foo.com, john.doe@foo.com, 
            jane.doe@foo.com, joe.blow@foo.com, 
            row.boat@foo.com, low.goat@foo.com
          Message-ID: <1125147562.1.1431365619490.JavaMail.jenkins@jenkins-ut-01.foo.local>
          Subject: =?UTF-8?Q?Dashboard_=C2=BB_Dev_=C2=BB_Dashboard-Dev-Deplo?=
           =?UTF-8?Q?y-Frontend_-_Build_#_61_-_Successful!?=
          MIME-Version: 1.0
          Content-Type: multipart/mixed; 
            boundary="----=_Part_0_965143550.1431365618993"
          X-Jenkins-Job: Dashboard-Dev-Deploy-Frontend
          X-Jenkins-Result: SUCCESS
          
          ------=_Part_0_965143550.1431365618993
          Content-Type: text/html; charset=UTF-8
          Content-Transfer-Encoding: quoted-printable
          
          
          ... (HTML body here) ...
          
          ------=_Part_0_965143550.1431365618993
          Content-Type: application/octet-stream; name=build.zip
          Content-Transfer-Encoding: base64
          Content-Disposition: attachment; filename=build.zip
          
          ... (attachment binary stuff here) ...
          
          ------=_Part_0_965143550.1431365618993--
          .
          250 2.6.0  <1125147562.1.1431365619490.JavaMail.jenkins@jenkins-ut-01.foo.local> Queued mail for delivery
          QUIT
          221 2.0.0 mail-ut-01.foo.local Service closing transmission channel
          Finished: SUCCESS
          

          I originally thought it had been fixed because the build I tested just happened to be configured to not attach a build log.

          Josh Hagins added a comment - - edited Ah, I was wrong. It still isn't working, but not for the reason I thought. Compressing and attaching the build log seems to be the issue. When "Attach Build Log" is set to "Compress and Attach Build Log", the email is not sent. However, when it is set to either "Attach Build Log" or "Do Not Attach Build Log", the email is sent with no problems. Here's the log with "Compress and Attach Build Log", which claims to have sent the email: Checking if email needs to be generated Email was triggered for : Always Sending email for trigger: Always messageContentType = text/html; charset=UTF-8 Request made to attach build log Request made to compress build log Adding recipients from project recipient list Adding recipients from trigger recipient list Successfully created MimeMessage Sending email to: master.commander@foo.com john.doe@foo.com jane.doe@foo.com joe.blow@foo.com row.boat@foo.com low.goat@foo.com DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc] DEBUG SMTP: useEhlo true , useAuth false DEBUG SMTP: trying to connect to host "<SMTP proxy host>" , port 25, isSSL false 220 mail-ut-01.foo.local Microsoft ESMTP MAIL Service, Version: 7.5.7601.17514 ready at Mon, 11 May 2015 13:33:39 -0400 DEBUG SMTP: connected to host "<SMTP proxy host>" , port: 25 EHLO jenkins-ut-01.foo.local 250-mail-ut-01.foo.local Hello [<Jenkins host>] 250-TURN 250-SIZE 2097152 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime 250-BINARYMIME 250-CHUNKING 250-VRFY 250 OK DEBUG SMTP: Found extension "TURN" , arg "" DEBUG SMTP: Found extension "SIZE" , arg "2097152" DEBUG SMTP: Found extension "ETRN" , arg "" DEBUG SMTP: Found extension "PIPELINING" , arg "" DEBUG SMTP: Found extension "DSN" , arg "" DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES" , arg "" DEBUG SMTP: Found extension "8bitmime" , arg "" DEBUG SMTP: Found extension "BINARYMIME" , arg "" DEBUG SMTP: Found extension "CHUNKING" , arg "" DEBUG SMTP: Found extension "VRFY" , arg "" DEBUG SMTP: Found extension "OK" , arg "" DEBUG SMTP: use8bit false MAIL FROM:<jenkins@foo.com> 250 2.1.0 jenkins@foo.com....Sender OK DEBUG SMTP: sendPartial set RCPT TO:<master.commander@foo.com> 250 2.1.5 master.commander@foo.com RCPT TO:<john.doe@foo.com> 250 2.1.5 john.doe@foo.com RCPT TO:<jane.doe@foo.com> 250 2.1.5 jane.doe@foo.com RCPT TO:<joe.blow@foo.com> 250 2.1.5 joe.blow@foo.com RCPT TO:<row.boat@foo.com> 250 2.1.5 row.boat@foo.com RCPT TO:<low.goat@foo.com> 250 2.1.5 low.goat@foo.com DEBUG SMTP: Verified Addresses DEBUG SMTP: master.commander@foo.com DEBUG SMTP: john.doe@foo.com DEBUG SMTP: jane.doe@foo.com DEBUG SMTP: joe.blow@foo.com DEBUG SMTP: row.boat@foo.com DEBUG SMTP: low.goat@foo.com DATA 354 Start mail input; end with <CRLF>.<CRLF> Date: Mon, 11 May 2015 13:33:38 -0400 (EDT) From:jenkins@foo.com Reply-To:master.commander@foo.com To: master.commander@foo.com, john.doe@foo.com, jane.doe@foo.com, joe.blow@foo.com, row.boat@foo.com, low.goat@foo.com Message-ID: <1125147562.1.1431365619490.JavaMail.jenkins@jenkins-ut-01.foo.local> Subject: =?UTF-8?Q?Dashboard_=C2=BB_Dev_=C2=BB_Dashboard-Dev-Deplo?= =?UTF-8?Q?y-Frontend_-_Build_#_61_-_Successful!?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary= "----=_Part_0_965143550.1431365618993" X-Jenkins-Job: Dashboard-Dev-Deploy-Frontend X-Jenkins-Result: SUCCESS ------=_Part_0_965143550.1431365618993 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable ... (HTML body here) ... ------=_Part_0_965143550.1431365618993 Content-Type: application/octet-stream; name=build.zip Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=build.zip ... (attachment binary stuff here) ... ------=_Part_0_965143550.1431365618993-- . 250 2.6.0 <1125147562.1.1431365619490.JavaMail.jenkins@jenkins-ut-01.foo.local> Queued mail for delivery QUIT 221 2.0.0 mail-ut-01.foo.local Service closing transmission channel Finished: SUCCESS I originally thought it had been fixed because the build I tested just happened to be configured to not attach a build log.

          Alex Earl added a comment -

          Hmmm, the javamail log looks like things are working, but I'll take a look

          Alex Earl added a comment - Hmmm, the javamail log looks like things are working, but I'll take a look

          Alex Earl added a comment -

          Do you have the capability to check the logs on the server to see if there are any errors?

          Alex Earl added a comment - Do you have the capability to check the logs on the server to see if there are any errors?

          Josh Hagins added a comment -

          Argh, I messed up again. Talked to IT, and apparently our SMTP server rejects emails with .exe and .zip attachments for security reasons. So there's no problem with the plugin, I'm just a dolt. Sorry to waste your time!

          Josh Hagins added a comment - Argh, I messed up again. Talked to IT, and apparently our SMTP server rejects emails with .exe and .zip attachments for security reasons. So there's no problem with the plugin, I'm just a dolt. Sorry to waste your time!

          Ajit Jadhav added a comment -

           my case I'm able to send email using default setting[even able to send text email] but not able to send email from Editable Email plugin.

          Please help.

          Ajit Jadhav added a comment -  my case I'm able to send email using default setting [even able to send text email] but not able to send email from Editable Email plugin. Please help.

          Alex Earl added a comment -

          ajitjadhav896 Your issue is not the same, please don't hijack issues.

          Alex Earl added a comment - ajitjadhav896 Your issue is not the same, please don't hijack issues.

            slide_o_mix Alex Earl
            jawshooah Josh Hagins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: