Søren Hjarlvig created JAMES-4115:
-------------------------------------

             Summary: FileMailRepository cache is never refreshed
                 Key: JAMES-4115
                 URL: https://issues.apache.org/jira/browse/JAMES-4115
             Project: James Server
          Issue Type: Bug
          Components: data
    Affects Versions: 3.8.2
         Environment: Windows Server 2019 / Java 11
            Reporter: Søren Hjarlvig


When I manually copy a message into a FileMailRepository, it seems that a 
service restart is required before James sees it.

Order of events:
 # Message FileObjectStore and FileStreamStore is copied to /var/mail/retry/
 # curl -XGET 
[http://127.0.0.1:8000/mailRepositories/var%2Fmail%2Fretry%2F/mails]
 # []
 # Service restart
 # curl -XGET 
[http://127.0.0.1:8000/mailRepositories/var%2Fmail%2Fretry%2F/mails]
 # ["Mail1738937327729-b8303e94-f959-420a-9d18-f6adccf132fa"]
 # curl -XPATCH 
[http://127.0.0.1:8000/mailRepositories/var%2Fmail%2Fretry%2F/mails?action=reprocess]
 # {"taskId":"ff8c877b-8a62-44b8-ba63-64cfb722c785"}

I took a look at the FileMailRepository source and the behavior seems to be 
caused by the cache being populated at startup and never refreshed from the 
filesystem.

If I disable the FileMailRepository cache in the config, manually added 
messages are registered as expected:

<mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">

  <protocols>

    <protocol>file</protocol>

  </protocols>

   <!-- Set CACHEKEYS to false to register manually added messages -->

   <config FIFO="false" CACHEKEYS="false"/>

 </mailrepository>



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to