https://issues.apache.org/bugzilla/show_bug.cgi?id=45109

           Summary: SMTPAppender uses wrong property for mail server
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Appender
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


SMTPAppender always sends to localhost as it seems to set the wrong property in
the session. 

In the createSession method SMTPAppender sets the property "mail.smtp.host"
if (smtpHost != null) {
      props.put("mail.smtp.host", smtpHost);
}

Then it calls Transport.send which tries to read the protocol from the url
in the class Service
if (url != null) {
                host = url.getHost();
                // it is possible that this could return null (rare).  If it
does, try to get a
                // value from a protocol specific session variable.
                if (host == null) {
                    host = session.getProperty("mail." + protocol + ".host");
                }
            }

But as url is null the mail.smtp.host is not read correctly. So host stays null
and the appender connects to localhost.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to