On Wed, May 13, 2009 at 8:07 AM, Martin.Bergljung
<[email protected]> wrote:
> Hi,
>
>
>
> Would it be possible to add an extra method to the MailboxManager API
> for logouts?
>
>
>
> I am currently firing a login event when someone has been successfully
> authenticated (in the isAuthentic() method)
>
> and would like to fire a logout event when someone is logged out via
> LogoutProcessor.
>
>
>
> public void postLogout(MailboxSession session);
>
>
>
> Maybe we could actually also have a postLogin so I do not have to mix
> event firing with authentication.
>
>
>
> BTW. Is there a special reason why the authentication method is called
> isAuthentic()? I think authenticate() would be more logical as
>
> isAuthentic() gives me the idea that a user could already have been
> authenticated...maybe that is the idea

i'm not very happy with the Mailbox API in this area either

i've opened a JIRA to track this (https://issues.apache.org/jira/browse/IMAP-84)

i think something like:

MailboxSession authenticate(String user, String password, Log log)
throws MailboxException

would be an improvement with a BadCredentialsException thrown when the
user and password combination is incorrect. this would allow better
diagnosis when the Mailbox finds itself unable to authentic the user
for other reasons.

createSession would need to be renamed createSystemSession and be
retargeted at programmatic access which does not require
authentication (for example, from a SIEVE script)

i agree that that the current API lacks symmetry. so maybe 'login'
rather than authenticate would be better, thence:

logout(MailboxSession) throws MailboxException

connectivity issues are relatively common with IMAP so full support
would mean adding an additional message (SystemForceLogout, perhaps)
to inform the Mailbox that the session is dead.

opinions?

- robert

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to