我已在Sonar
下为Configuration--> general Seetings --> Email
个实例配置了电子邮件设置。
配置详情如下。
SMTP host: mysmtpserver.com<br>
SMTP Port: 25<br>
Use secure connection: No<br>
SMTP username: Blank<br>
SMTP password:Blank<br>
From address:noreply@mycompany.sonar.com<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: myname@mycompany.com
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服务器设置适用于Gerrit
和Jenkins
,无需任何身份验证。
任何帮助都将不胜感激。
答案 0 :(得分:2)
当您提供“来自地址”时,您的SMTP服务器似乎不允许匿名发送邮件(即没有用户和密码)。
您应该查看Jenkins或Gerrit实例的配置,它们可能没有指定任何“来自地址”。在这种情况下,请删除“noreply@mycompany.sonar.com”条目并尝试。