Bug 30294

Summary: SMTPAppender will not run within sandbox
Product: Log4j - Now in Jira Reporter: s.podkowinski
Component: AppenderAssignee: log4j-dev <log4j-dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 1.2   
Target Milestone: ---   
Hardware: All   
OS: All   

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).