File tree 2 files changed +16
-16
lines changed
2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -46,15 +46,17 @@ desc.setGlobalConfigEmail(properties.global.git.email)
46
46
47
47
if (properties. global. smtp. enabled) {
48
48
println " --> Set E-mail Notification"
49
- File pwdFile = new File (properties. credentials. smtp. path)
50
- if (! pwdFile. exists()) {
51
- println " Smpt password file missing!"
52
- } else {
53
- def emailDesc = inst. getDescriptor(hudson.tasks.Mailer )
54
- emailDesc. setSmtpHost(properties. global. smtp. host)
55
- emailDesc. setSmtpPort(properties. global. smtp. port)
56
- emailDesc. setSmtpAuth(properties. credentials. smtp. userId, new File (properties. credentials. smtp. path). text. trim())
57
- emailDesc. setReplyToAddress(properties. global. smtp. reply_to_address)
49
+ if (properties. global. smtp. authentication. enabled) {
50
+ File pwdFile = new File (properties. global. smtp. authentication. passwordFile)
51
+ if (! pwdFile. exists()) {
52
+ println " Smpt password file missing!"
53
+ } else {
54
+ def emailDesc = inst. getDescriptor(hudson.tasks.Mailer )
55
+ emailDesc. setSmtpHost(properties. global. smtp. host)
56
+ emailDesc. setSmtpPort(properties. global. smtp. port)
57
+ emailDesc. setSmtpAuth(properties. global. smtp. authentication. login, pwdFile. text. trim())
58
+ emailDesc. setReplyToAddress(properties. global. smtp. reply_to_address)
59
+ }
58
60
}
59
61
}
60
62
Original file line number Diff line number Diff line change @@ -14,13 +14,6 @@ credentials {
14
14
description = " "
15
15
path = " /var/jenkins_home/.ssh/.password"
16
16
}
17
- smtp {
18
- type = " password"
19
- userId = " jenkins"
20
- credentialsId = " smtp"
21
- description = " Used by jenkins to send mail notifications"
22
- path = " /var/jenkins_home/.ssh/.smtp_password"
23
- }
24
17
}
25
18
26
19
registry {
@@ -82,6 +75,11 @@ global {
82
75
port = " 25"
83
76
host = " 1.1.1.1"
84
77
reply_to_address =
" [email protected] "
78
+ authentication {
79
+ enabled = true
80
+ login = " jenkins"
81
+ passwordFile = " /var/jenkins_home/.ssh/.smtp_password"
82
+ }
85
83
}
86
84
}
87
85
You can’t perform that action at this time.
0 commit comments