Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
3.0-beta3
-
None
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