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

RemoteDelivery tries to modify the returned Collection of Mail.getRecipients() directly

    XMLWordPrintableJSON

    Details

      Description

      In RemoteDelivery we try to modify the returned Collection of Mail.getRecipients() directly. This may fail because a Collection can be read-only as remove etc is an optional implementation. We need to copy it and then set it via Mail.setRecipients(..) to be 100% sure.

      See this related stack trace:

      INFO  17:41:25,409 | james.mailetcontext | Exception caught in RemoteDelivery.run()
      org.apache.james.queue.api.MailQueue$MailQueueException: Unable to perform dequeue;
       nested exception is:
         java.lang.UnsupportedOperationException
         at org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.java:768)
         at java.lang.Thread.run(Thread.java:679)
      Caused by: java.lang.UnsupportedOperationException
         at java.util.AbstractList.remove(AbstractList.java:161)
         at java.util.AbstractList$Itr.remove(AbstractList.java:375)
         at java.util.AbstractList.removeRange(AbstractList.java:572)
         at java.util.AbstractList.clear(AbstractList.java:234)
         at org.apache.james.transport.mailets.RemoteDelivery.deliver(RemoteDelivery.java:1132)
         at org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.java:718)
         ... 1 more

        Attachments

          Activity

            People

            • Assignee:
              norman Norman Maurer
              Reporter:
              norman Norman Maurer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: