Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.3.0
    • Component/s: Remote Delivery
    • Labels:
      None

      Description

      I get the following exception in RemoteDelivery.getGatewaySMTPHostAddresses():

      java.lang.NullPointerException
      at org.apache.james.transport.mailets.RemoteDelivery$1.hasNext(RemoteDelivery.java:1331)
      at org.apache.james.transport.mailets.RemoteDelivery.deliver(RemoteDelivery.java:453)
      at org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.java:1098)
      at java.lang.Thread.run(Thread.java:595)

      in hasNext(), the break condition is not complete (missing addresses == null check)

      I'm working on a patch.

      RemoteDelivery config in question:

      <mailet match="All" class="RemoteDelivery">
      <outgoing> file://var/mail/outgoing/ </outgoing>

      <delayTime> 5 minutes </delayTime>
      <delayTime> 10 minutes </delayTime>
      <delayTime> 45 minutes </delayTime>
      <delayTime> 2 hours </delayTime>
      <delayTime> 3 hours </delayTime>
      <delayTime> 6 hours </delayTime>
      <maxRetries> 25 </maxRetries>

      <deliveryThreads> 1 </deliveryThreads>

      <sendpartial>false</sendpartial>

      <bounceProcessor>bounces</bounceProcessor>
      <gateway>localhost</gateway>
      <gatewayPort>2525</gatewayPort>
      </mailet>

      1. remotedelivery.patch
        4 kB
        Bernd Fondermann

        Activity

        Hide
        bago Stefano Bagnara added a comment -

        How could it happen to have a message with no recipients in the outgoing spool?
        IIRC RemoteDelivery store a copy of serviced Mail for each domain of the recipients. If the message has no recipients it should not write anything to the outgoing spool.

        Show
        bago Stefano Bagnara added a comment - How could it happen to have a message with no recipients in the outgoing spool? IIRC RemoteDelivery store a copy of serviced Mail for each domain of the recipients. If the message has no recipients it should not write anything to the outgoing spool.
        Hide
        brainlounge Bernd Fondermann added a comment -

        how is this question related to the reported little bug? in this case here, where a gateway is defined, the message and its recepients are not visited. instead, the deliver() method calls getGatewaySMTPHostAddresses() and i get the NPE right there.

        IMO, the bugfix can be justified by looking only at getGatewaySMTPHostAddresses() and no calling code.

        but first, to get a better understanding of this important mailet, i'll write some unit tests.

        Show
        brainlounge Bernd Fondermann added a comment - how is this question related to the reported little bug? in this case here, where a gateway is defined, the message and its recepients are not visited. instead, the deliver() method calls getGatewaySMTPHostAddresses() and i get the NPE right there. IMO, the bugfix can be justified by looking only at getGatewaySMTPHostAddresses() and no calling code. but first, to get a better understanding of this important mailet, i'll write some unit tests.
        Hide
        bago Stefano Bagnara added a comment -

        I was just wondering how it would be possible to have a message with no recipients. I wasn't "rejecting" the bug/patch

        I didn't consider the "gateway" configuration: it now makes much more sense.

        Show
        bago Stefano Bagnara added a comment - I was just wondering how it would be possible to have a message with no recipients. I wasn't "rejecting" the bug/patch I didn't consider the "gateway" configuration: it now makes much more sense.
        Hide
        bago Stefano Bagnara added a comment -

        Applied.
        Another option (better?) would be to set it to GHOST in the service method and avoid storing the message in the outgoing spool.

        Show
        bago Stefano Bagnara added a comment - Applied. Another option (better?) would be to set it to GHOST in the service method and avoid storing the message in the outgoing spool.
        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:
            brainlounge Bernd Fondermann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development