Bug 47713 - SMTPAppender system properties propagation issue
Summary: SMTPAppender system properties propagation issue
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
Depends on:
Reported: 2009-08-20 03:11 UTC by Jesper
Modified: 2009-08-23 18:57 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Jesper 2009-08-20 03:11:19 UTC
The properties passed in from command line (via -D) is not available to the underlying java mail implementation.

The issue is that com.sun.mail.util.SocketFetcher uses com.sun.mail.util.PropUtil to get properties, but this class uses properties.get (vs. getProperty), where the properties added from SMTPAppender is added via new Properties(defaultProps). 

The effect is that PropUtil->properties.get does not check the defaultProps for values and hence won't find any added from SMTPAppender.

Of course you could argue the issue is with com.sun.mail.util.PropUtil..
Comment 1 Curt Arnold 2009-08-23 18:57:54 UTC
Thanks for the comments, but not quite following the train of thought.

I can guess, but can you describe the problem that you are encountering.  Something like, I can specify the SMTPPassword in a log4j.xml file, but when I try to specify it through -D....=password it is not recognized.

Do you have a proposed remedy or patch?

Does this occur with the current SVN HEAD or a earlier version?  If not SVN HEAD, could you check with the SVN HEAD?