Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-437

add failed recipient address to log when authorization fails

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0
    • Component/s: SMTPServer
    • Labels:
      None

      Description

      when an attempt to relay a message not intended for a local domain the following message is logged:
      "Rejected message - authentication is required for mail request"
      In this, and other similar error cases, it would be quite useful to append the actual failed recipient address to the log so that one can tell not only that an error had occured, but also why and by whom...

      Adding such simple useful information to logs (this and others) can make it much easier to diagnose delivery issues, rather than having a red light light up on the dashboard but not knowing what's wrong with the car (as the well known MS GPF story goes...)

      1. JAMES-437.full.patch
        5 kB
        Andrew Sykes
      2. JAMES-437.patch
        1.0 kB
        Andrew Sykes

        Activity

        Hide
        sykesdev Andrew Sykes added a comment -

        Added email address to logging

        Show
        sykesdev Andrew Sykes added a comment - Added email address to logging
        Hide
        sykesdev Andrew Sykes added a comment -

        Additional info added to all log messages

        Show
        sykesdev Andrew Sykes added a comment - Additional info added to all log messages
        Hide
        bago Stefano Bagnara added a comment -

        The provided patch is not reentrant.

        Please keep in mind that CmdHandlers must be Thread Safe.

        You should remove the 2 added fields because they add state to the CmdHandler and the state would be shared between threads.

        Furthermore when recipientAddress = new MailAddress(recipient); throw an exception you keep the old value in the field so the logging would contain the bad address.

        Show
        bago Stefano Bagnara added a comment - The provided patch is not reentrant. Please keep in mind that CmdHandlers must be Thread Safe. You should remove the 2 added fields because they add state to the CmdHandler and the state would be shared between threads. Furthermore when recipientAddress = new MailAddress(recipient); throw an exception you keep the old value in the field so the logging would contain the bad address.
        Hide
        bago Stefano Bagnara added a comment -

        Fixed the patch to be thread safe and applied.

        Show
        bago Stefano Bagnara added a comment - Fixed the patch to be thread safe and applied.
        Hide
        danny@apache.org Danny Angus added a comment -

        Closing issue fixed in released version.

        Show
        danny@apache.org Danny Angus added a comment - Closing issue fixed in released version.

          People

          • Assignee:
            bago Stefano Bagnara
            Reporter:
            amichai Amichai Rothman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development