Jenkins"不向未注册用户发送邮件"

Mat*_*s M 14 jenkins

Jenkins拒绝向某些用户发送错误邮件.在日志中我发现了以下消息:

....
Build step 'Maven Goals aufrufen' marked build as failure
Not sending mail to unregistered user user1@example.org
Sending e-mails to: user2@example.org
Finished: FAILURE
Run Code Online (Sandbox Code Playgroud)

用户(user1)列在管理员列表中.他还有一封注册邮箱(user1@example.org).

Jenkins Peoaple管理界面

那么为什么这个用户被称为未注册用户呢?

在搜索此警告时,我发现了几个开放的JIRA问题,例如https://issues.jenkins-ci.org/browse/JENKINS-43178 但这些对我没有帮助.

这是一个配置错误还是jenkins错误?

Ile*_*dir 7

问题是(对我来说):

 SECURITY-372 (advisory) Emails were sent to addresses not associated with
 actual users of Jenkins.
Run Code Online (Sandbox Code Playgroud)

我正在使用Jenkins和Gerrit触发器来创建新创建的Patchsets或已发布的草稿.通过这种安全性"修复",Jenkins将尝试从电子邮件地址前的名称"猜测"用户名.例如,在"Name Surname"中,"Name Surname"部分将是jenkins尝试在Jenkins UserDB中查找的用户名,但该组合与我们的LDAP中使用的标识符不同,因此jenkins不会发送电子邮件. ...除非:

https://wiki.jenkins.io/display/JENKINS/Email-ext+plugin#Email-extplugin-2.57.2(April10,2017)

If the security fix is undesirable in a particular instance, it can be disabled with either or both of the following two system properties:

    -Dhudson.tasks.MailSender.SEND_TO_UNKNOWN_USERS=true: send mail to build culprits even if they do not seem to be associated with a valid Jenkins login.
    -Dhudson.tasks.MailSender.SEND_TO_USERS_WITHOUT_READ=true: send mail to build culprits associated with a valid Jenkins login even if they would not otherwise have read access to the job.
Run Code Online (Sandbox Code Playgroud)

这些JAVA_ARGS可以添加到/ etc/default/jenkins或/ etc/sysconfig/jenkins中,具体取决于您的发行版.


juz*_*lin 6

至少在Jenkins 2.150.1中Allow sending to unregistered usersConfigure System菜单下有设置。