You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Jerry Malcolm <te...@malcolms.com> on 2019/10/22 21:10:44 UTC

Mailbox ReadOnlyException

I pulled out my legacy code for writing to folders and replaced with the 
default mailets.  But I still get this exception on one of my accounts' 
Sent folder.   Any ideas what could lock up a mailbox?  (I've restarted 
JAMES several times... no change) Sending from another account appears 
to be working.

ERROR 15:54:35,135 | 
org.apache.james.mailetcontainer.impl.camel.CamelProcessor | Exception 
calling ToSenderFolder: Unable to access mailbox.
javax.mail.MessagingException: Unable to access mailbox.;
   nested exception is:
org.apache.james.mailbox.exception.ReadOnlyException: #private.Sent
         at 
org.apache.james.transport.mailets.delivery.MailboxAppender.append(MailboxAppender.java:70)
         at 
org.apache.james.transport.mailets.delivery.MailboxAppender.append(MailboxAppender.java:50)
         at 
org.apache.james.transport.mailets.ToSenderFolder.doService(ToSenderFolder.java:86)
         at 
org.apache.james.transport.mailets.ToSenderFolder.service(ToSenderFolder.java:74)
         at 
org.apache.james.mailetcontainer.impl.camel.CamelProcessor.process(CamelProcessor.java:81)
         at 
org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor$MailetContainerRouteBuilder.handleMailet(CamelMailetProcessor.java:178)
         at 
org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor$MailetContainerRouteBuilder.lambda$configure$0(CamelMailetProcessor.java:155)
         at 
org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
         at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
         at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
         at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
         at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
         at 
org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:715)
         at 
org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:638)
         at 
org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:248)



Re: Mailbox ReadOnlyException

Posted by Jerry Malcolm <te...@malcolms.com>.
I've found something in the ToSenderFolder mailet that was causing this 
and another problem as well.  I added logging of the username field 
along with the sender, folder, etc. in the mailet.   The sender was 
"Jerry@malcolmbusinesssolutions.com" (note capital "J").  I'm not 
mapping this id in rrt, so the user was also "Jerry@....".  In the 
JAMES_USER table, that id is all lower case.  I added a ".toLowerCase()" 
on the username and voila... no more locked "Sent" folders.  I haven't 
tracked back to see why the domain was lowercased in the sender, but the 
user was not (The actual email sender field was 
"Jerry@MalcolmBusinessSolutions.com" with mixed case in the domain 
name).  But it appears that somewhere in the MailBox.append processing, 
it is not happy when the case is incorrect on the user name.

Secondly, I had another account that was not giving me the ReadOnly 
exception (actually no errors at all).  Logs were saying it was storing 
my test outbound emails in Sent.  But they never showed up.  So I went 
back to the username field again in the log for ToSenderFolder.  This 
account makes heavy use of rrt.  My 'sender' jerry@2gvp.com is mapped in 
rrt to mail@2gvp.net, which is the actual account name.  But in the log 
entry, the user name was still the same as the sender, i.e. unmapped.  
Hence it was trying to write to a non-existent user account.  I would 
have hoped for an error message in that case, but didn't see one. I had 
some code in another mailet that maps an email address to an rrt target 
account that I knew worked.  So I added my mapper code to the mailet so 
that the Mailbox.append would have the correct account.  This fixed the 
second problem.

Right now, it's hacked and band-aided.  I'm not really sure yet how it 
was supposed to work.  All I know that currently in my case, it wasn't.  
I am using the default (out of the box) pipeline flow here.  RRT is 
called.  Then ToSenderFolder is called if LocalSender.  So if I've 
totally misinterpreted this and did the wrong things to fix it, let me 
know.

I'm not fully confident that this fixes all of my locked folder problems 
with such a small amount of testing so far.  But I am encouraged.  I 
still have no clue on the iPhone issue.

Please advise as to the correct way to proceed with this 'fix'.

Thx

Thx.

Jerry

On 10/22/2019 4:10 PM, Jerry Malcolm wrote:
> I pulled out my legacy code for writing to folders and replaced with 
> the default mailets.  But I still get this exception on one of my 
> accounts' Sent folder.   Any ideas what could lock up a mailbox? (I've 
> restarted JAMES several times... no change) Sending from another 
> account appears to be working.
>
> ERROR 15:54:35,135 | 
> org.apache.james.mailetcontainer.impl.camel.CamelProcessor | Exception 
> calling ToSenderFolder: Unable to access mailbox.
> javax.mail.MessagingException: Unable to access mailbox.;
>   nested exception is:
> org.apache.james.mailbox.exception.ReadOnlyException: #private.Sent
>         at 
> org.apache.james.transport.mailets.delivery.MailboxAppender.append(MailboxAppender.java:70)
>         at 
> org.apache.james.transport.mailets.delivery.MailboxAppender.append(MailboxAppender.java:50)
>         at 
> org.apache.james.transport.mailets.ToSenderFolder.doService(ToSenderFolder.java:86)
>         at 
> org.apache.james.transport.mailets.ToSenderFolder.service(ToSenderFolder.java:74)
>         at 
> org.apache.james.mailetcontainer.impl.camel.CamelProcessor.process(CamelProcessor.java:81)
>         at 
> org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor$MailetContainerRouteBuilder.handleMailet(CamelMailetProcessor.java:178)
>         at 
> org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor$MailetContainerRouteBuilder.lambda$configure$0(CamelMailetProcessor.java:155)
>         at 
> org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
>         at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
>         at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
>         at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
>         at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
>         at 
> org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:715)
>         at 
> org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:638)
>         at 
> org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:248)
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Mailbox ReadOnlyException

Posted by Jerry Malcolm <te...@malcolms.com>.
This has gone from bad to worse over the past few hours.  Now the Sent 
folder is locked up (ReadOnlyException) on all but a few of my 
accounts.  This is a bad one.  All sent mail is being sent, but the 
local copy is not being written.  I really need to figure out what is 
locking all of these folders and how to restore them.


On 10/22/2019 4:10 PM, Jerry Malcolm wrote:
> I pulled out my legacy code for writing to folders and replaced with 
> the default mailets.  But I still get this exception on one of my 
> accounts' Sent folder.   Any ideas what could lock up a mailbox? (I've 
> restarted JAMES several times... no change) Sending from another 
> account appears to be working.
>
> ERROR 15:54:35,135 | 
> org.apache.james.mailetcontainer.impl.camel.CamelProcessor | Exception 
> calling ToSenderFolder: Unable to access mailbox.
> javax.mail.MessagingException: Unable to access mailbox.;
>   nested exception is:
> org.apache.james.mailbox.exception.ReadOnlyException: #private.Sent
>         at 
> org.apache.james.transport.mailets.delivery.MailboxAppender.append(MailboxAppender.java:70)
>         at 
> org.apache.james.transport.mailets.delivery.MailboxAppender.append(MailboxAppender.java:50)
>         at 
> org.apache.james.transport.mailets.ToSenderFolder.doService(ToSenderFolder.java:86)
>         at 
> org.apache.james.transport.mailets.ToSenderFolder.service(ToSenderFolder.java:74)
>         at 
> org.apache.james.mailetcontainer.impl.camel.CamelProcessor.process(CamelProcessor.java:81)
>         at 
> org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor$MailetContainerRouteBuilder.handleMailet(CamelMailetProcessor.java:178)
>         at 
> org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor$MailetContainerRouteBuilder.lambda$configure$0(CamelMailetProcessor.java:155)
>         at 
> org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
>         at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
>         at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
>         at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
>         at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
>         at 
> org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:715)
>         at 
> org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:638)
>         at 
> org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:248)
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org