You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Brad Walker <BW...@studentadvantage.com> on 2002/09/10 15:31:52 UTC

Help with configuring james for multiple mail repositories

I am trying to setup james (2.1a1-2002-08-18) so that given a certain set of
circumstances, a message can either get processed by one repository, or
another.  Here's an example:
 
A message comes into the server and gets picked up by the root processor. If
the message is being sent to, say foo@myhost.com <ma...@myhost.com>
for example, the mail gets routed through one type of repository ( some
subclass of org.apache.james.mailrepository.AvalonMailRepository) which
saves the message on the local filesystem.
 
If the message is not sent to foo@myhost.com <ma...@myhost.com> , I
would like to route it through a DIFFERENT repository which would save it in
a database, for example.
 
The bottom line is that I have different storage logic that I need to employ
depending on what kind of message is received. When looking through the
config.xml file, I see where I can manage the list of repositories, but it
seems to me that it only allows one kind of each type ( MAIL, SPOOL) of
repository. If I have two <repository> nodes, each of which point to
different classes, and both of which use the same type and protocol, the one
that was defined last is the one that gets used.
 
Any help would be appreciated.
 
Thanks,
Brad

Re: Help with configuring james for multiple mail repositories

Posted by Stefano Debenedetti <st...@webaccess.mozquito.com>.
Danny Angus wrote:
> As far as creating a new different type I think it should only be as hard
> as,
> a) writing the damned thing, it should implement
> o.a.j.servicesMailRepository
> b) setting it up in config:
>          <repository class="com.foo.MboxRepository">
>             <protocols>
>                <protocol>mbox</protocol>
>             </protocols>
>             <types>
>                <type>MAIL</type>
>             </types>
>          </repository>
> c) setting up mailets to use it via config

I'm trying to do that but I encountered two problems:

1) if a protocol name unknown to java.net.URL is used (for example 
"mbox") a MalformedURLException gets thrown @ 
org.apache.avalon.cornerstone.blocks.masterstore.RepositoryManager.se
lect(RepositoryManager.java:137)

2) so I used "http" as a protocol identifier to get past that but I get 
stuck anyway like this:

org.apache.avalon.framework.component.ComponentException: Cannot find or 
init repository: null
         at 
org.apache.avalon.cornerstone.blocks.masterstore.RepositoryManager.se
lect(RepositoryManager.java:205)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at 
org.apache.avalon.phoenix.components.application.BlockInvocationHandl
er.invoke(BlockInvocationHandler.java:92)
         at $Proxy1.select(Unknown Source)
         at 
org.apache.james.mailrepository.AvalonXMLMailRepository.initialize(Av
alonXMLMailRepository.java:130)

(remainder of exception dump snipped)

where AvalonXMLMailRepository is the name of my repository class that is 
basically a clone of the original AvalonMailRepository.

The config I'm using is this:

          <repository 
class="org.apache.james.mailrepository.AvalonXMLMailRepository">
             <protocols>
                <protocol>http</protocol>
             </protocols>
             <types>
                <type>MAIL</type>
             </types>
          </repository>

Now I'll try to debug that but of course any hint would be greatly 
appreciated, thanks ciao
ste



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: james 2.1a1 installation problem

Posted by "Noel J. Bergman" <no...@devtech.com>.
I suspect that you need to export PHOENIX_SECURE=false.

	--- Noel

-----Original Message-----
From: Davide Frigerio [mailto:davide.frigerio@wise-lab.it]
Sent: Tuesday, September 10, 2002 10:28
To: James Users List
Subject: james 2.1a1 installation problem


I just download the latest version of James and I try to use it with Linux.
I have encontered some problem about the files access permission, I try to
copnfigure 777 chmod for all files and directory but the problem still
exists.

org.apache.avalon.framework.component.ComponentException: Cannot find or
init repository: access denied (java.io.FilePermission
/var/james2/apps/james/var/mail/spool read)
......

Any suggestion?

Davide Frigerio


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


james 2.1a1 installation problem

Posted by Davide Frigerio <da...@wise-lab.it>.
I just download the latest version of James and I try to use it with Linux.
I have encontered some problem about the files access permission, I try to
copnfigure 777 chmod for all files and directory but the problem still
exists.

org.apache.avalon.framework.component.ComponentException: Cannot find or
init repository: access denied (java.io.FilePermission
/var/james2/apps/james/var/mail/spool read)
......

Any suggestion?

Davide Frigerio





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Help with configuring james for multiple mail repositories

Posted by Danny Angus <da...@apache.org>.
> If the message is not sent to foo@myhost.com <ma...@myhost.com> , I
> would like to route it through a DIFFERENT repository which would
> save it in
> a database, for example.

For local delivery via the localDelivery mailet I believe that it is only
possible to define one local storage for James. Using:
		<inboxRepository>
			<repository destinationURL="db://maildb/inbox/" type="MAIL"/>
		</inboxRepository>

This means you can only access one repository using POP3


However if you have another mailet which will filter other mail, there is no
earthly reason why it shouldn't use another repository:
			<mailet match="All" class="ToRepository">
				<repositoryPath>db://maildb/errors/spam</repositoryPath>
			</mailet>
Even one of a different type.

As far as creating a new different type I think it should only be as hard
as,
a) writing the damned thing, it should implement
o.a.j.servicesMailRepository
b) setting it up in config:
         <repository class="com.foo.MboxRepository">
            <protocols>
               <protocol>mbox</protocol>
            </protocols>
            <types>
               <type>MAIL</type>
            </types>
         </repository>
c) setting up mailets to use it via config



d.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>