[jira] [Closed] (JAMES-4115) FileMailRepository cache is never refreshed

"Benoit Tellier (Jira)" <[email protected]>
Newsgroups gmane.comp.jakarta.james.devel
Message-ID <[email protected]>
     [ https://issues.apache.org/jira/browse/JAMES-4115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benoit Tellier closed JAMES-4115.
---------------------------------
    Resolution: Fixed

> 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
>            Priority: Minor
>         Attachments: mailetcontainer.xml
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.