Bug 30294 - SMTPAppender will not run within sandbox
Summary: SMTPAppender will not run within sandbox
Status: RESOLVED FIXED
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.2
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-23 13:23 UTC by s.podkowinski
Modified: 2006-08-31 12:46 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description s.podkowinski 2004-07-23 13:23:31 UTC
Please consider the following patch to make the Appender work in a restricted
sandbox environment.

84,87c84,92
<     Properties props = new Properties (System.getProperties());
<     if (smtpHost != null)
<       props.put("mail.smtp.host", smtpHost);
< 
---
>     Properties props = null;
>     try {
>       props = new Properties (System.getProperties());
>       if (smtpHost != null)
>         props.put("mail.smtp.host", smtpHost);
>     } catch(SecurityException se) {
>         props = new Properties();
>         props.put("mail.smtp.host", smtpHost);
>     }
Comment 1 Curt Arnold 2006-08-31 19:46:09 UTC
Modified fix committed in rev 439032 (trunk) and 439033 (1.2 branch).