Log4cxx
  1. Log4cxx
  2. LOGCXX-1

Implementation of the SMTPAppender on Windows platforms

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.7
    • Fix Version/s: None
    • Component/s: Appender
    • Labels:
      None
    • Environment:
      Windows

      Description

      SMTPAppender is implemented with the libsmtp library. This library supports only POSIX platforms.
      SMTPAppender should compile with libsmtp on Windows/cygwin but not on Windows/Visual Studio 6 and 7.1
      SMTPAppender could be have a specific implementation on Windows/Visual Studio by using the Microsoft CDO library.

      1. log4cxx-1.2.patch
        19 kB
        Michael Waeber
      2. log4cxx-1.3.patch
        2 kB
        Michael Waeber

        Activity

        Michaël CATANZARITI created issue -
        Hide
        Curt Arnold added a comment -

        SMTPAppender appears to be non-functional and has not been updated for the unicode changes that occurred a couple of years ago.

        My current thought would be to branch log4j's SMTPAppender to use Commons Net's SMTPClient (http://commons.apache.org/net/). Then port the branched appender and the necessary parts of SMTPClient implemented on top of APR plus the SMTP test cases.

        Show
        Curt Arnold added a comment - SMTPAppender appears to be non-functional and has not been updated for the unicode changes that occurred a couple of years ago. My current thought would be to branch log4j's SMTPAppender to use Commons Net's SMTPClient ( http://commons.apache.org/net/ ). Then port the branched appender and the necessary parts of SMTPClient implemented on top of APR plus the SMTP test cases.
        Hide
        Curt Arnold added a comment -

        Rev 601193 eliminated the use of the Windows style _T and T2A macros and brought the appender in-line with big Unicode change from several years ago and now compiles (with manual hacks to the configuration to enable SMTP) but has linking issues that have not been addressed.

        libsmtp appears to be dormant, is not available packaged (at least for Ubuntu) and has problems building with the latest gcc's. libesmtp appears to be functionally similar and is packaged for Ubuntu. Both are LGPL. My next effort will be to migrate from libsmtp to libesmtp.

        CDO appears to be a seriously different beast and appears to be deprecated. I expect getting libesmtp working on Windows would be simpler than working with CDO.

        Commons-NET was not feature complete enough to replace the use of the JavaMail API in log4j's implementation, so the idea of porting it to have a minimal cross-platform lib isn't viable.

        The configure.in doesn't update the LOG4CXX_HAVE_SMTP which is hardcoded to 0 regardless of any --with-SMTP value. When this is all played out, some changes will need to be made there.

        Show
        Curt Arnold added a comment - Rev 601193 eliminated the use of the Windows style _T and T2A macros and brought the appender in-line with big Unicode change from several years ago and now compiles (with manual hacks to the configuration to enable SMTP) but has linking issues that have not been addressed. libsmtp appears to be dormant, is not available packaged (at least for Ubuntu) and has problems building with the latest gcc's. libesmtp appears to be functionally similar and is packaged for Ubuntu. Both are LGPL. My next effort will be to migrate from libsmtp to libesmtp. CDO appears to be a seriously different beast and appears to be deprecated. I expect getting libesmtp working on Windows would be simpler than working with CDO. Commons-NET was not feature complete enough to replace the use of the JavaMail API in log4j's implementation, so the idea of porting it to have a minimal cross-platform lib isn't viable. The configure.in doesn't update the LOG4CXX_HAVE_SMTP which is hardcoded to 0 regardless of any --with-SMTP value. When this is all played out, some changes will need to be made there.
        Hide
        Curt Arnold added a comment -

        Rev 603118 is an initial implementation of SMTPAppender based on libesmtp. Use of libesmtp must be enabled using:

        ./configure --with-SMTP=libesmtp

        Supporting non US-ASCII characters would require integrating a MIME library (best candidate looks like libgmime-2 also LGPL'd), however it is likely better to accept loss of non US-ASCII characters for a hopefully simpler time getting SMTPAppender working on Windows.

        SMTPAppender has been synchronized with log4j's and supports to, cc, bcc, smtpUsername and smtpPassword options.

        Simple tests have been done posting both with and without password authentication.

        enabling libesmtp in the Ant build will likely be done when attempting to build on Windows.

        Show
        Curt Arnold added a comment - Rev 603118 is an initial implementation of SMTPAppender based on libesmtp. Use of libesmtp must be enabled using: ./configure --with-SMTP=libesmtp Supporting non US-ASCII characters would require integrating a MIME library (best candidate looks like libgmime-2 also LGPL'd), however it is likely better to accept loss of non US-ASCII characters for a hopefully simpler time getting SMTPAppender working on Windows. SMTPAppender has been synchronized with log4j's and supports to, cc, bcc, smtpUsername and smtpPassword options. Simple tests have been done posting both with and without password authentication. enabling libesmtp in the Ant build will likely be done when attempting to build on Windows.
        Hide
        Michael Waeber added a comment -

        Some months ago I've implemented SMTPAppender using CDO for a test. Now I updated the implementation to the current SVN Revision (680327). I submit a patch log4cxx-1.2.patch. Enable SMTPAppender using CDO with -Dwith-SMTP=CDO.

        Tested with ant build, MSVC 8.0 on Windows XP.

        Show
        Michael Waeber added a comment - Some months ago I've implemented SMTPAppender using CDO for a test. Now I updated the implementation to the current SVN Revision (680327). I submit a patch log4cxx-1.2.patch. Enable SMTPAppender using CDO with -Dwith-SMTP=CDO. Tested with ant build, MSVC 8.0 on Windows XP.
        Michael Waeber made changes -
        Field Original Value New Value
        Attachment log4cxx-1.2.patch [ 12387037 ]
        Hide
        Michael Waeber added a comment -

        For a test I need a SMTPAppender which sends all messages written to a special logger as email. So I implemented the SendAllEvaluator (patch log4cxx-1.3.patch).

        Enable with
        log4j.appender.SPECIAL_LOGGER.evaluatorClass=org.apache.log4j.net.SendAllEvaluator
        in property file

        Show
        Michael Waeber added a comment - For a test I need a SMTPAppender which sends all messages written to a special logger as email. So I implemented the SendAllEvaluator (patch log4cxx-1.3.patch). Enable with log4j.appender.SPECIAL_LOGGER.evaluatorClass=org.apache.log4j.net.SendAllEvaluator in property file
        Michael Waeber made changes -
        Attachment log4cxx-1.3.patch [ 12387038 ]

          People

          • Assignee:
            Michaël CATANZARITI
            Reporter:
            Michaël CATANZARITI
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:

              Development