POP3 list return messages in order as they comes with file pair
---------------------------------------------------------------

                 Key: JAMES-641
                 URL: http://issues.apache.org/jira/browse/JAMES-641
             Project: James
          Issue Type: Improvement
          Components: James Core
    Affects Versions: 2.2.0
         Environment: linux, jdk1.5
            Reporter: davide.bz


I like to have the list method to return message so that the progressive number 
correpond to the receiving order (so all new messaged are on top/bottom).

With mbox I have already send a patch. But I have noted that mbox does not
work good with large attachment. So I go back to file pair (default 
mailrepository)

But this is not ordered too!!

I have noted that filenames is an encoded verion of the id of the mail! but the 
progressive number in id is not rpad so the string file name does not 
correspond with progressive number.

I haved maded by me a path. I does not have testet it in deep but I will send.
The patched method is the James.java:

-------------------------------------------------------------------------

    /**
     * Return a new mail id.
     *
     * @return a new mail id
     */
    public String getId() {
        long localCount = -1;
        synchronized (James.class) {
            localCount = count++;
        }
        // 2006-09-28 [EMAIL PROTECTED]: rpad progressive will make file name 
order 
        // like receiving order!
        String localCountStr = String.valueOf(localCount);
        localCountStr = "00000000000000000000" + localCountStr;
        localCountStr = localCountStr.substring(localCountStr.length() - 20);
        StringBuffer idBuffer =
            new StringBuffer(64)
                    .append("Mail")
                    .append(System.currentTimeMillis())
                    .append("-")
                    .append(localCountStr);
        return idBuffer.toString();
    }



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to