aspose file tools*
The moose likes Other Open Source Projects and the fly likes Log4J authentication error with  SMTPAppender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4J authentication error with  SMTPAppender" Watch "Log4J authentication error with  SMTPAppender" New topic
Author

Log4J authentication error with SMTPAppender

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
howdy

I'm trying to send fatal messages to my email and I keep getting the error below:

I take it the system requires authentication. What line should I add to the log4j.properties in order to solve it?

my log4j.properties looks like this:

log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender
log4j.appender.MAIL.Threshold=FATAL
log4j.appender.MAIL.BufferSize=10
log4j.appender.MAIL.From=info@syntac.com
log4j.appender.MAIL.SMTPHost=outgoing.verizon.net
log4j.appender.MAIL.Subject=Log4J Message
log4j.appender.MAIL.To=info@syntac.com

log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout
log4j.appender.MAIL.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n



the ERROR:



log4j:ERROR Error occured while sending e-mail notification.
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 530 authentication required - for help go to http://help.yahoo.com/help/us/bizmail/pop/pop-11.html

at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source)
at org.apache.log4j.net.SMTPAppender.append(Unknown Source)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
at org.apache.log4j.Category.callAppenders(Category.java:203)
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.fatal(Category.java:362)
at MyTest.main(MyTest.java:16)
log4j:ERROR Error occured while sending e-mail notification.
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 530 authentication required - for help go to http://help.yahoo.com/help/us/bizmail/pop/pop-11.html

at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source)
at org.apache.log4j.net.SMTPAppender.append(Unknown Source)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
at org.apache.log4j.Category.callAppenders(Category.java:203)
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.fatal(Category.java:362)
at MyTest.main(MyTest.java:17)
log4j:ERROR Error occured while sending e-mail notification.
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 530 authentication required - for help go to http://help.yahoo.com/help/us/bizmail/pop/pop-11.html

at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source)
at org.apache.log4j.net.SMTPAppender.append(Unknown Source)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
at org.apache.log4j.Category.callAppenders(Category.java:203)
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.fatal(Category.java:362)
at MyTest.main(MyTest.java:18)
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

The SMTPAppender doesn't support authentication. You can tell that by looking at its API documentation and noticing that there aren't any "setXXX" methods related to authentication.

You could write your own subclass that does support authentication. Or you could do what it looks like the authors intended and use a local server. I find it hard to imagine an application that must e-mail error notifications but isn't running in an environment that doesn't have its own SMTP server.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log4J authentication error with SMTPAppender