Validating Email Parameter

The Jenkins project announced an unresolved security vulnerability affecting the current version of this plugin (why?):

master: Build Status

- performs e-mail validation
- prevents sending e-mails except the specified domain.
- prevents typo
- --> user1 user2 user3 can be written and performs specific validation. E-mail address will be generated automatically in the build process.

Parameter Definition

  • Default Value : Specifies the default value of the field, which allows the user to save typing the actual value.

  • Domain : Permitted domain name for sending mail.


External Email : If checked, Sending mail is allowed outside the set domain name.

External Email : false


  • Invalid Email

  • Valid Email

You can copy that code directly into the pipeline block in your Jenkinsfile

pipeline {
   agent any

    parameters {
        email defaultValue: 'sezai.can', description: 'Email address', domain: '', externalEmail: true, name: 'EMAIL'

   stages {
      stage('Email') {
         steps {
            echo "${params.EMAIL}"