logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sumit Kumar" <skum...@novell.com>
Subject Re: SMTPAppender suggestion
Date Fri, 06 Aug 2004 14:39:21 GMT
hi all,
I think the SMTP appender can be cahnge to connect to authenticated
server by this way: -

1. Add four more functions in the SMTPAppender class say getpassword,
setpassword, getUsername, setUserName. user will give these thing from
properties file.

2. Extends the class Authenticator of java library and implement the
function getPasswordAuthentication(). take the username and pasword
which user has provided through the properties file and return the
PasswordAuthentication object with the username and password.

Authenticator class will take care of it.

3. Finally change the activateOption method in SMTPAppender and add one
line as :-

Authenticator auth = new MyAuthenticator();
Session session = Session.getInstance(props, auth);

I think that settles it. So if you really want to support the
authenticated server .. HERE IT IS AND A GREAT STEP.

There may be some hidden stuffs but i tknow you can overcome easily.
Hope you may want to do it.

--thanks 
sumit


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message