You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Marco Tedone <mt...@jemos.org> on 2003/05/09 00:58:33 UTC

[NEWBIE]Getting a MailServer reference

Hi, 

from within a Mailet, how could I get a reference to a MailServer object?

Regards,

Marco

RE: [NEWBIE]Getting a MailServer reference

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Do you know where the new version will be operative?

Nope.  All depends upon participation.

	--- Noel

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


Re: [NEWBIE]Getting a MailServer reference

Posted by Marco Tedone <mt...@jemos.org>.
Thank you, that's exactly what I was looking for. Do you know where the new
version will be operative?

Marco
----- Original Message ----- 
From: "Noel J. Bergman" <no...@devtech.com>
To: "James Developers List" <ja...@jakarta.apache.org>
Sent: Friday, May 09, 2003 7:25 AM
Subject: RE: [NEWBIE]Getting a MailServer reference


> > in order to get user inbox shouldn't I use a method like:
> > MailServer.getUserInbox(user);
>
> The way to do it in James v2 is to accesss the underlying Avalon platform,
> as shown in a couple of mailets.  Basically, you need to do something like
> this:
>
>   ComponentManager compMgr =
>
(ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT
> _MANAGER);
>   MailServer mailServer = (MailServer) compMgr.lookup(MailServer.ROLE);
>
> This will change in the future, where you will likely use JNDI to lookup
> information related to the user.  That approach will also allow you to
store
> the quota as an attribute of the user's JNDI entry.
>
> --- Noel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>




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


Re: [NEWBIE]Getting a MailServer reference

Posted by Marco Tedone <mt...@jemos.org>.
Yes Danny I saw that method, but I was wondering what the formal parameter
should contain.

Marco
----- Original Message ----- 
From: "Danny Angus" <da...@apache.org>
To: "James Developers List" <ja...@jakarta.apache.org>
Sent: Friday, May 09, 2003 8:22 AM
Subject: RE: [NEWBIE]Getting a MailServer reference


Noel,

> This will change in the future, where you will likely use JNDI to lookup
> information related to the user.

Not that soon though.
Although you have kindly proposed this I don't see *anyone* stepping up to
actually do the work...

In the meantime James v3 provides MailetContext.getMailRepository(String
URI)

d.


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





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


RE: [NEWBIE]Getting a MailServer reference

Posted by "Noel J. Bergman" <no...@devtech.com>.
> > This will change in the future, where you will likely use JNDI to lookup
> > information related to the user.

> Not that soon though.

> Although you have kindly proposed this I don't see *anyone*
> stepping up to actually do the work...

I know.  I've been a bit occupied with James v2.  But at this point, my
plans for James v2 are:

  1. Release v2.1.3 (next week?)
  2. Release v2.2.0
     - Remaining practical bugfixes (low hanging fruit)
     - your classloader changes (any ETA?)
     - DNSJava changes (from HEAD)
     - Mail Attributes (from Søren Hilmer)
     - Official Avalon packaging

and then to start work on James v3.  In the latter area, there are several
areas:

  1. JNDI/LDAP
  2. Spooler
  3. JavaMail

that I have an interest in.  My current thought was to start with the
spooler, but perhaps we could start with JNDI.

> In the meantime James v3 provides MailetContext.getMailRepository(String
URI)

I thought I had mentioned that, although without the API detail.  But it was
late, so maybe I goofed.

	--- Noel


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


RE: [NEWBIE]Getting a MailServer reference

Posted by Danny Angus <da...@apache.org>.
Noel,

> This will change in the future, where you will likely use JNDI to lookup
> information related to the user.  

Not that soon though.
Although you have kindly proposed this I don't see *anyone* stepping up to actually do the work...

In the meantime James v3 provides MailetContext.getMailRepository(String URI) 

d.


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


RE: [NEWBIE]Getting a MailServer reference

Posted by "Noel J. Bergman" <no...@devtech.com>.
> in order to get user inbox shouldn't I use a method like:
> MailServer.getUserInbox(user);

The way to do it in James v2 is to accesss the underlying Avalon platform,
as shown in a couple of mailets.  Basically, you need to do something like
this:

  ComponentManager compMgr =
(ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT
_MANAGER);
  MailServer mailServer = (MailServer) compMgr.lookup(MailServer.ROLE);

This will change in the future, where you will likely use JNDI to lookup
information related to the user.  That approach will also allow you to store
the quota as an attribute of the user's JNDI entry.

	--- Noel


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


Re: [NEWBIE]Getting a MailServer reference

Posted by Marco Tedone <mt...@jemos.org>.
Yes, but in order to get user inbox shouldn't I use a method like:

MailServer.getUserInbox(user);    ?

Marco
----- Original Message ----- 
From: "Noel J. Bergman" <no...@devtech.com>
To: "James Developers List" <ja...@jakarta.apache.org>
Sent: Friday, May 09, 2003 4:04 AM
Subject: RE: [NEWBIE]Getting a MailServer reference


> > from within a Mailet, how could I get a reference
> > to a MailServer object?
> 
> You don't.  You get the MailetContext.
> 
> --- Noel
> 
> P.S.  Please turn off HTML e-mail.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
> 
> 



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


RE: [NEWBIE]Getting a MailServer reference

Posted by "Noel J. Bergman" <no...@devtech.com>.
> from within a Mailet, how could I get a reference
> to a MailServer object?

You don't.  You get the MailetContext.

	--- Noel

P.S.  Please turn off HTML e-mail.

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