After I drilled down James codes. I found that the email message was in
spool when the mailet is processing. And the message is stored in filepair
(where the filename is generated by
org.apache.james.mailrepository.filepair.AbstractFileRepository.java) in the
spool directory.

Once the mailet chain finished processing, another thread (?) will move this
pair of file into user mailbox directory and generate a new pair of files.

So to make the association of mail id like

Mail1135709310983-10

with the filename

4D61696C313133353730393537323734332D3131.Repository.FileObjectStore

in the user mailbox seems not possible since the file pair in the user
mailbox has not been created when the mailet is processing the mail.

Any idea how I can make the association of mail Id during mailet processing
with filename of the file pair in user mailbox?

Of course, one idea is to do it after all is over using POP3 UIDL combined
with linear searching of UIDL for every file in user mailbox with extension
.Repository.FileObjectStore. But this is very ugly mechanism.

Anyone's help will be very much appreciated.

Regards,
Edward

On 12/28/05, Edward Tan <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Is there anyway to get the message filename in user's mailbox for a
> mailet?
>
> I notice that the email message will be stored in
> var/mail/inboxes/usermailbox after all the mailets are processed. So it
> seems that I need to change James internal code so that when it stores the
> message into var/mail/inboxes/usermailbox I can store the filename
> somewhere.
>
> The question is which part of the code (class) that is responsible in
> storing message (MIME) into var/mail/inboxes/usermailbox.
>
> The filename under var/mail/inboxes/usermailbox looks like this:
>
> 4D61696C313133353730393537323734332D3131.Repository.FileObjectStore
> 4D61696C313133353730393537323734332D3131.Repository.FileStreamStore
>
>
> Every email will have two files under var/mail/inboxes/usermailbox
>
> In the mailet I can get the mail Id something like this
>
> Mail1135709310983-10
>
> I need to make an association between
>
> Mail1135709310983-10
>
> and
>
> 4D61696C313133353730393537323734332D3131.Repository.FileObjectStore
> 4D61696C313133353730393537323734332D3131.Repository.FileStreamStore
>
>
> How can I do this?
>
> Thanks in advance
>
> Regards,
> Edward
>

Reply via email to