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

Restrict which domains mail is sent to

    Details

    • Type: Improvement
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: mailer-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      When using Jenkins internally, it is sometimes needed to restrict sending e-mail notification external.

      There should be possible to add allowed domains in which to send e-mails to.

      When using Git as VCS the e-mail address of the committers is stored with the commit, and the mailer will the try to send to all users that might have broken the build.

      If you have cloned an open source project and regularly pulls updates from upstream the mailer might start sending mails to those upstream committers.

      That is not what you want from an internal Jenkins instance.

        Attachments

          Issue Links

            Activity

            pablaasmo Per Arnold Blaasmo created issue -
            pablaasmo Per Arnold Blaasmo made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-20330 [ JENKINS-20330 ]
            Hide
            danielbeck Daniel Beck added a comment -

            This just duplicates the linked issue.

            Show
            danielbeck Daniel Beck added a comment - This just duplicates the linked issue.
            danielbeck Daniel Beck made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            Hide
            albers Harald Albers added a comment -

            It's about the same feature, but there are two distinct plugins involved, so we really need to issues here.

            Show
            albers Harald Albers added a comment - It's about the same feature, but there are two distinct plugins involved, so we really need to issues here.
            albers Harald Albers made changes -
            Resolution Duplicate [ 3 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Hide
            danielbeck Daniel Beck added a comment -

            Sorry about that, the other issue's title is misleading.

            Show
            danielbeck Daniel Beck added a comment - Sorry about that, the other issue's title is misleading.
            Hide
            madsnielsen Mads Nielsen added a comment - - edited

            I'm very keen on implementing this.

            What would my best approach be? When looking through the code there is an @ExtenisonPoint called MailAddressFilter. The documentation suggest to implement that if you need to filter out emails sent by jenkins in a seperate plugin, but seeing as there has lately been a movement to limit the number of new plugins contributed, what would you think about me just adding a DomainFilter class to the existing mailer plugin, and provide a global configuration option where the user specifies which regex all outgoing mails must match?

            Is that the preferred solution? Or do i really need to create a seperate plugin for such a simple feature?

            Show
            madsnielsen Mads Nielsen added a comment - - edited I'm very keen on implementing this. What would my best approach be? When looking through the code there is an @ExtenisonPoint called MailAddressFilter. The documentation suggest to implement that if you need to filter out emails sent by jenkins in a seperate plugin, but seeing as there has lately been a movement to limit the number of new plugins contributed, what would you think about me just adding a DomainFilter class to the existing mailer plugin, and provide a global configuration option where the user specifies which regex all outgoing mails must match? Is that the preferred solution? Or do i really need to create a seperate plugin for such a simple feature?
            Hide
            danielbeck Daniel Beck added a comment -

            there has lately been a movement to limit the number of new plugins

            I'm not so sure about that. While there are often clarifying questions asked when hosting for a new plugin is requested, those are mostly about duplication of features.

            Show
            danielbeck Daniel Beck added a comment - there has lately been a movement to limit the number of new plugins I'm not so sure about that. While there are often clarifying questions asked when hosting for a new plugin is requested, those are mostly about duplication of features.
            Hide
            pablaasmo Per Arnold Blaasmo added a comment - - edited

            Actually there is an implementation in the email-ext plugin (https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin) that gives the possible functionality. It is called 'pre-send script'. I did some test with that and it works. Making a global pre-send script prevents all build jobs using the plugin send mail to given addresses.

            The problem was that I could not control whether or not the users enabled the email-ext-plugin in their build job.
            So I had to set up a filter on the smtp server that the build master uses.

            I found somewhere that it was plans to merge the mailer-plugin and the email-ext-plugin, but it does not seems to be a priority?

            Show
            pablaasmo Per Arnold Blaasmo added a comment - - edited Actually there is an implementation in the email-ext plugin ( https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin ) that gives the possible functionality. It is called 'pre-send script'. I did some test with that and it works. Making a global pre-send script prevents all build jobs using the plugin send mail to given addresses. The problem was that I could not control whether or not the users enabled the email-ext-plugin in their build job. So I had to set up a filter on the smtp server that the build master uses. I found somewhere that it was plans to merge the mailer-plugin and the email-ext-plugin, but it does not seems to be a priority?
            Hide
            slide_o_mix Alex Earl added a comment -

            There is no real plan to merge mailer and email-ext at this point.

            Show
            slide_o_mix Alex Earl added a comment - There is no real plan to merge mailer and email-ext at this point.
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 157237 ] JNJira + In-Review [ 186221 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                pablaasmo Per Arnold Blaasmo
              • Votes:
                10 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated: