2012-06-12 54 views
0

我已經Configuration--> general Seetings --> Email下配置我Sonar例如電子郵件設置。電子郵件設置的配置不工作

配置細節如下。

SMTP host: mysmtpserver.com<br> 
SMTP Port: 25<br> 
Use secure connection: No<br> 
SMTP username: Blank<br> 
SMTP password:Blank<br> 
From address:[email protected]<br> 
Email prefix: [SONAR] 

我已保存這些設置,當我嘗試測試它,我得到下面的錯誤在聲納屏幕

org.apache.commons.mail.EmailException: Sending the email to the following server failed : mysmtpserver.com:25 

下面是異常的stracktrace

2012.06.12 12:10:11 ERROR o.s.p.e.EmailNotificationChannel Fail to send test email to: [email protected] 
org.apache.commons.mail.EmailException: Sending the email to the following server failed : mysmtpserver.com:25 
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242) ~[na:na] 
at org.apache.commons.mail.Email.send(Email.java:1267) ~[na:na] 
at org.sonar.plugins.emailnotifications.EmailNotificationChannel.send(EmailNotificationChannel.java:192) ~[na:na] 
at org.sonar.plugins.emailnotifications.EmailNotificationChannel.sendTestEmail(EmailNotificationChannel.java:210) ~[na:na] 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_26] 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_26] 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_26] 
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_26] 
at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:559) [jruby-complete-1.6.1.jar:na] 
at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:404) [jruby-complete-1.6.1.jar:na] 
at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:79) [jruby-complete-1.6.1.jar:na] 
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:205) [jruby-complete-1.6.1.jar:na] 
at org.jruby.ast.CallThreeArgNode.interpret(CallThreeArgNode.java:61) [jruby-complete-1.6.1.jar:na] 
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:103) [jruby-complete-1.6.1.jar:na] 
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) [jruby-complete-1.6.1.jar:na] 
at org.jruby.ast.RescueNode.executeBody(RescueNode.java:216) [jruby-complete-1.6.1.jar:na] 
at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120) [jruby-complete-1.6.1.jar:na] 
at org.jruby.ast.RescueNode.interpret(RescueNode.java:110) [jruby-complete-1.6.1.jar:na] 
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83) [jruby-complete-1.6.1.jar:na] 

引起由:com.sun.mail.smtp.SMTPSendFailedException:550 5.7.1匿名客戶沒有權限發送的該發件人(由TPA)

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1515) ~[na:na] 
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1321) ~[na:na] 
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:637) ~[na:na] 
at javax.mail.Transport.send0(Transport.java:189) ~[na:na] 
at javax.mail.Transport.send(Transport.java:118) ~[na:na] 
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1232) ~[na:na] 
... 248 common frames omitted 

注意:相同的SMTP服務器設置對於GerritJenkins工作正常,無需任何驗證。

任何幫助,將不勝感激。

回答

2

看來你的SMTP服務器不允許匿名發送郵件(即沒有用戶&密碼),當你提供一個「從地址」。

你應該看看你的詹金斯或格里特實例的配置,他們可能不指定任何「從地址」。在這種情況下,請刪除「[email protected]」條目並嘗試。

+0

詹金斯確實允許配置「發件人的電子郵件地址」,我們已經配置和電子郵件從詹金斯發送做工精細用相同的SMTP服務器,並且不需要任何身份驗證。唯一的區別是它不要求輸入SMTP服務器的端口號。但是,我嘗試刪除發件人地址,現在它給了我一個不同的例外,即org.apache.commons.mail.EmailException:非法地址。我可以確認提供給測試配置的電子郵件地址是否有效且正確 – ezcode

相關問題