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

Support for SMTP auth to gateway server in RemoteDelivery mailet

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0
    • Component/s: Remote Delivery
    • Labels:
      None
    • Environment:
      WinXP / JDK_1.4.2_04

      Description

      In a RemoteDelivery mailet, I may specify a gateway server and a gateway port for sending messages. Unfortunately, the SMTP server I intend to use requires username/password authentication. I want to be able to provide a username and password to use with a gateway in the RemoteDelivery mailet.

      1. RemoteDelivery.zip
        14 kB
        Jonathan Schwehm

        Issue Links

          Activity

          Hide
          jschwehm Jonathan Schwehm added a comment -

          I modified my copy of the RemoteDelivery mailet in 2.2.0 this past week to allow for SMTP Auth in response to some of my ISP's suprise changes. I'll run a diff and send it to everyone for review/use within a day or so.

          Show
          jschwehm Jonathan Schwehm added a comment - I modified my copy of the RemoteDelivery mailet in 2.2.0 this past week to allow for SMTP Auth in response to some of my ISP's suprise changes. I'll run a diff and send it to everyone for review/use within a day or so.
          Hide
          jschwehm Jonathan Schwehm added a comment -

          Attached is a zip file containing a diff and the full source of RemoteDelivery mailet to allow for SMTP Auth with the remote server if it supports auth. I've tested it against JAMES requiring AUTH and JAMES without AUTH as well as with BellSouth's mail servers with and without AUTH. I wrote it in haste, if you're thinking of using this in a production environment, please run some tests first. I've been running it for 6 days so far on RH9 and Win2000 servers running James2.2 and java 1.4.2. Do not use the source file in JAMES2.1.x as I modified the 2.2 source.

          Show
          jschwehm Jonathan Schwehm added a comment - Attached is a zip file containing a diff and the full source of RemoteDelivery mailet to allow for SMTP Auth with the remote server if it supports auth. I've tested it against JAMES requiring AUTH and JAMES without AUTH as well as with BellSouth's mail servers with and without AUTH. I wrote it in haste, if you're thinking of using this in a production environment, please run some tests first. I've been running it for 6 days so far on RH9 and Win2000 servers running James2.2 and java 1.4.2. Do not use the source file in JAMES2.1.x as I modified the 2.2 source.
          Hide
          jschwehm Jonathan Schwehm added a comment -

          I forgot to mention the config parameters in config.xml to use AUTH with RemoteDelivery. To specify a username, use <username>...</username>. To specify a password, use <password>...</password>. Both are withing the RemoteDelivery mailet config block. Again, this is most useful if you've specified a gateway mail server.

          Show
          jschwehm Jonathan Schwehm added a comment - I forgot to mention the config parameters in config.xml to use AUTH with RemoteDelivery. To specify a username, use <username>...</username>. To specify a password, use <password>...</password>. Both are withing the RemoteDelivery mailet config block. Again, this is most useful if you've specified a gateway mail server.
          Hide
          damianbrown Damian Brown added a comment -

          This sounds like just the fix I'm looking for however I do not have a java compiler to hand, I'm using windows, is it possible someone could compile the java source and attach the file. If I'm right this file is in the java archive work/james-1119808683468/SAR-INF/lib/james.jar. could this file be compiled and posted so that I can just swap the new file in.

          Show
          damianbrown Damian Brown added a comment - This sounds like just the fix I'm looking for however I do not have a java compiler to hand, I'm using windows, is it possible someone could compile the java source and attach the file. If I'm right this file is in the java archive work/james-1119808683468/SAR-INF/lib/james.jar. could this file be compiled and posted so that I can just swap the new file in.
          Hide
          bago Stefano Bagnara added a comment -

          Added support for gatewayUsername and gatewayPassword.

          It would probably better to split RemoteDelivery into 2 different Mailets:
          GatewayDelivery and RemoteDelivery
          The 2 mailets could extend a common abstract delivery mailet.

          Show
          bago Stefano Bagnara added a comment - Added support for gatewayUsername and gatewayPassword. It would probably better to split RemoteDelivery into 2 different Mailets: GatewayDelivery and RemoteDelivery The 2 mailets could extend a common abstract delivery mailet.
          Hide
          noel Noel J. Bergman added a comment -

          We may have to revisit this in the future, and the attributes should not be considered permament. Two issues come to mind:

          1. Do we require all gateways to have the same authentication?
          2. Do we want to be able to provide sender-specific authentication?

          Show
          noel Noel J. Bergman added a comment - We may have to revisit this in the future, and the attributes should not be considered permament. Two issues come to mind: 1. Do we require all gateways to have the same authentication? 2. Do we want to be able to provide sender-specific authentication?
          Hide
          bago Stefano Bagnara added a comment -

          1) we could allow this implementing an "url" like address: smtp://username:password@ip:port . This coult even be compatible with the comma separated value. What do you think?

          I applied this because the patch was here: I don't plan to work on other similar improvements by my own.

          Show
          bago Stefano Bagnara added a comment - 1) we could allow this implementing an "url" like address: smtp://username:password@ip:port . This coult even be compatible with the comma separated value. What do you think? I applied this because the patch was here: I don't plan to work on other similar improvements by my own.
          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:
              mgavagha Mike Gavaghan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development