0
0
Jenkinsdevops~20 mins

Email notification plugin in Jenkins - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Email Notification Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Jenkins Email Notification Plugin - Default Behavior
What is the output in Jenkins console log when the Email Notification plugin is configured but the SMTP server is unreachable during a build?
ABuild fails with error: Could not connect to SMTP host
BBuild succeeds but email is silently dropped
CBuild succeeds and email is queued for retry
DBuild fails with error: Email plugin not installed
Attempts:
2 left
💡 Hint
Think about what happens when Jenkins tries to send email but cannot reach the SMTP server.
Configuration
intermediate
2:00remaining
Configuring SMTP Server in Jenkins Email Notification Plugin
Which configuration snippet correctly sets the SMTP server to smtp.example.com with port 587 and enables STARTTLS in Jenkins Email Notification plugin's global configuration?
A
smtpServer=smtp.example.com
smtpPort=25
useSsl=true
useStartTls=false
B
smtpServer=smtp.example.com
smtpPort=587
useSsl=true
useStartTls=false
C
smtpServer=smtp.example.com
smtpPort=465
useSsl=false
useStartTls=true
D
smtpServer=smtp.example.com
smtpPort=587
useSsl=false
useStartTls=true
Attempts:
2 left
💡 Hint
STARTTLS usually runs on port 587 and requires useStartTls=true with useSsl=false.
🔀 Workflow
advanced
2:00remaining
Email Notification Plugin - Conditional Email Sending
In a Jenkins pipeline, which scripted step correctly sends an email only if the build status is FAILURE using the Email Notification plugin?
Aif (currentBuild.result == 'FAILURE') { emailext subject: 'Build Failed', body: 'Check logs', to: 'team@example.com' }
Bif (buildStatus == 'FAILURE') { emailext subject: 'Build Failed', body: 'Check logs', to: 'team@example.com' }
Cif (currentBuild.currentResult == 'FAILURE') { emailext subject: 'Build Failed', body: 'Check logs', to: 'team@example.com' }
Dif (currentBuild.status == 'FAILURE') { emailext subject: 'Build Failed', body: 'Check logs', to: 'team@example.com' }
Attempts:
2 left
💡 Hint
The correct property to check current build status is currentBuild.currentResult.
Troubleshoot
advanced
2:00remaining
Diagnosing Email Notification Plugin Failure
A Jenkins job configured with Email Notification plugin does not send emails, but the build succeeds. Which log message indicates the root cause?
AError: SMTP authentication failed
BWarning: No recipients specified for email notification
CInfo: Email sent successfully
DError: Plugin not found
Attempts:
2 left
💡 Hint
If no email addresses are set, the plugin skips sending emails without failing the build.
Best Practice
expert
2:00remaining
Best Practice for Securing SMTP Credentials in Jenkins Email Notification Plugin
What is the recommended way to securely manage SMTP credentials for the Jenkins Email Notification plugin to avoid exposing passwords in job configurations?
AStore SMTP username and password in Jenkins Credentials plugin and reference them in the Email Notification configuration
BHardcode SMTP username and password directly in the Jenkins job configuration
CUse environment variables in the Jenkins job to store SMTP credentials in plain text
DSave SMTP credentials in a text file on the Jenkins master and read them in the job
Attempts:
2 left
💡 Hint
Jenkins Credentials plugin is designed to securely store secrets.