Bug 30294 - SMTPAppender will not run within sandbox
SMTPAppender will not run within sandbox
Status: RESOLVED FIXED
Product: Log4j
Classification: Unclassified
Component: Appender
1.2
All All
: P3 normal
: ---
Assigned To: log4j-dev
:
Depends on:
Blocks:
  Show dependency tree
 
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).