james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joao Medeiros" <joao.medei...@ntlworld.com>
Subject RE: Return Messages
Date Fri, 10 Oct 2003 08:39:16 GMT
You can see the full document at
http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james
/transport/matchers/Attic/AbstractStorageQuota.java?rev=1.1.2.2&content-
type=text/vnd.viewcvs-markup

At the bottom look for:

...
    /** 
     * Gets the storage used in the recipient's inbox.
     *
     * @param recipient the recipient to check
     */    
    protected long getUsed(MailAddress recipient, Mail _) throws
MessagingException {
        long size = 0;
        MailRepository userInbox =
mailServer.getUserInbox(recipient.getUser());
        for (Iterator it = userInbox.list(); it.hasNext(); ) {
            String key = (String) it.next();
            MailImpl mc = userInbox.retrieve(key);
            // Retrieve can return null if the mail is no longer in the
store.
            if (mc != null) try {
                size += mc.getMessageSize();
            } catch (Throwable e) {
                // MailRepository.retrieve() does NOT lock the message.
                // It could be deleted while we're looping.
                log("Exception in getting message size: " +
e.getMessage());
            }
        }
        return size;
    }
...

Hope this helps,
-JM
-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com] 
Sent: 09 October 2003 17:58
To: James Developers List
Subject: RE: Return Messages

> I am working with James 2.1.3 and I don't seem to have the
> file AbstractStorageQuota in james.transport.matchers

See the CVS.  It is simply an example, as is the POP3 Handler.

	--- Noel


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


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


Mime
View raw message