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 "Richard O. Hammer" <RO...@EarthLink.net> on 2002/05/03 21:36:43 UTC

processing of messages

Hi,

I am new to James, but am hoping to understand it well enough
to code some modifications.  I am trying to understand the way
that James processes email messages. I am looking at Javadoc
and into the source of james.transport.LinearProcesor,
mailet.Mailet, mailet.Matcher, etc.

It would help me to read a description of the scheme which the
programmers had in mind, for how messages would pass through
and be managed by James.  Has such a description been written
somewhere?

Thank you,
Rich Hammer
Hillsborough, N.C.

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


Re: processing of messages

Posted by "Richard O. Hammer" <RO...@EarthLink.net>.
Danny Angus wrote:
> IMHO this..
> > I aspire to program and offer a service, a service which
> > eliminates spam by forwarding messages from unknown senders
> > only after those senders have posted bond with a
> > micropayment.  So I need to insert my functionality in the
> > midst of the process of forwarding.
> 
> .. should be achieved using mailets and matchers, the best thing to do is to
> get your head round their configuration, and the mailet API.

I certainly have been trying to do this.  But I find it
difficult to understand what I should do, given the
documentation as it presently exists.  Perhaps part of my
weakness is that I have no prior experience administering
sendmail, or a similar program, so I can not bring to my
attempt to use James any experience telling what I need to do
to configure and run such a program.

> There shouldn't really be any need for you to greatly understand how james
> contains mailets if you understand how to use the container, it should hide
> low level mail handling, and mailet instatiation from your specific process
> logic.

I agree if what you are describing is a goal, toward which the
developers and documenters of James should continue to aim,
rather than a present reality.  But my experience during a few
weeks of studying James suggests that this goal has not yet
been reached.  I've scanned all the readily evident
documentation and read much of it (indeed, I've read many
parts twice now).  But, for instance, this "container" that
you say I need to understand seems new to me.  Have I
overlooked its documentation?  Is it a particular class, a
package, or the whole of James?  Where can I read about it,
apart from reading the source code of it?


> Check out matcher and mailet code in org.apache.james.transport.mailets, and
> mess with ~/james/apps/james/conf/config.xml to see the effect of changing
> mailet/matcher & processors to build new flows and behaviour.

I think there are people who are good at experimenting with
configuration commands and then inducing, from the observed
behavior, how the system can be used to their advantage, but
unfortunately I don't think I am one of them.  Since I am
hoping to offer a service, I think I owe my prospective
customers an administration whose knowledge of the system is
more sturdy than "Duh, it worked before."  Also, I'm curious. 
I want to understand much of the functioning at the level of
the Java source.

Thank you,
Rich Hammer

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


RE: processing of messages

Posted by Danny Angus <da...@thought.co.uk>.
Rich,
IMHO this..

> I aspire to program and offer a service, a service which
> eliminates spam by forwarding messages from unknown senders
> only after those senders have posted bond with a
> micropayment.  So I need to insert my functionality in the
> midst of the process of forwarding.


.. should be achieved using mailets and matchers, the best thing to do is to
get your head round their configuration, and the mailet API.

There shouldn't really be any need for you to greatly understand how james
contains mailets if you understand how to use the container, it should hide
low level mail handling, and mailet instatiation from your specific process
logic.

Check out matcher and mailet code in org.apache.james.transport.mailets, and
mess with ~/james/apps/james/conf/config.xml to see the effect of changing
mailet/matcher & processors to build new flows and behaviour.

d.


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


Re: processing of messages

Posted by "Richard O. Hammer" <RO...@EarthLink.net>.
Serge Knystautas wrote:
> Check out the source code... LinearProcessor 
> is reasonably documented at this point.

Thank you.  The documentation in LinearProcessor does help me,
but I still have a number of questions.  Here are seven:

1. Mailets ... Evidently the architects of this code hit upon
a scheme for lending some uniformity to the steps of
processing done within James, by using Mailets.  Mailets
encapsulate bits of functionality.  But as I write this I am
just making it up; it is what I surmise from my study thus far
of the code, and I might be wrong.  I'd like to read a
description of: the problem in other email-server
architectures which drove the invention of Mailets; the way
that Mailets help to solve the problem; the way that Mailets
interact with other significant classes.

2. I am trying to understand the chain of calls instigated
when the SMTP server receives a message.  So who (by which I
mean which class and method) calls the LinearProcessor methods
initialize(), add(), and service()?

3. As I study LinearProcessor, it appears to me that
initialize() may be called repeatedly on any instance.  But
after initialize() is called once add(Matcher, Mailet) must be
called at least once before service(MailImpl) is called
exactly once per call to initialize().  I don't see checks
within LinearProcessor to assure this sequence, so I gather
that is part of the understanding that LinearProcessor has
with whoever calls it.  Is that right?

4. Am I correct that when add(Matcher, Mailet) is called there
is an important correlation between the Matcher and the Mailet
being added?  This Matcher is to be used in conjunction with
this Mailet when the time comes?

5. What is a "stage"?  The main loop in service() goes through
things called stages, I think.  Where do stages come from? 
What new gets done in each successive pass through the main
loop?

6. About half way through the service() method there is a
test:
	if (recipients.size() == 0) { ...
It looks to me like that might be an error.  To the extent
that I presently understand the code, I expect this instead:
	if (notRecipients.size() == 0) { ...
But I really do not understand what is going on here enough to
be sure.

7. unprocessed is an array of Lists.  I have a vague
understanding of why unprocessed needs to be an array: each
index in the array represents another stage(?).  But I do not
understand why there needs to be a List at each index.  Does
it ever happen that one of these Lists contains more than one
Mail?  (From my reading of the code so far, I see only that
one Mail might get put in each List.  I have not noticed how
multiple Mails might wind up in a List, and I don't understand
the reason why there would be multiple Mails in one of these
Lists.)

> Can you explain a bit more as to how you're
> thinking of changing the processing?  Maybe
> I can point you in a better direction.

I aspire to program and offer a service, a service which
eliminates spam by forwarding messages from unknown senders
only after those senders have posted bond with a
micropayment.  So I need to insert my functionality in the
midst of the process of forwarding.

Thank you Serge.  I am quite impressed with what you are doing
here.  I appreciate your responsiveness.  But I will
understand if my big list of questions is too much to expect
of you now.

Rich Hammer


> Richard O. Hammer wrote:
> > Hi,
> >
> > I am new to James, but am hoping to understand it well enough
> > to code some modifications.  I am trying to understand the way
> > that James processes email messages. I am looking at Javadoc
> > and into the source of james.transport.LinearProcesor,
> > mailet.Mailet, mailet.Matcher, etc.
> >
> > It would help me to read a description of the scheme which the
> > programmers had in mind, for how messages would pass through
> > and be managed by James.  Has such a description been written
> > somewhere?
> >
> > Thank you,
> > Rich Hammer
> > Hillsborough, N.C.

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


Re: processing of messages

Posted by Serge Knystautas <se...@lokitech.com>.
Check out the source code... LinearProcessor is reasonably documented at 
this point.  Can you explain a bit more as to how you're thinking of 
changing the processing?  Maybe I can point you in a better direction.
-- 
Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/

Richard O. Hammer wrote:
> Hi,
> 
> I am new to James, but am hoping to understand it well enough
> to code some modifications.  I am trying to understand the way
> that James processes email messages. I am looking at Javadoc
> and into the source of james.transport.LinearProcesor,
> mailet.Mailet, mailet.Matcher, etc.
> 
> It would help me to read a description of the scheme which the
> programmers had in mind, for how messages would pass through
> and be managed by James.  Has such a description been written
> somewhere?
> 
> Thank you,
> Rich Hammer
> Hillsborough, N.C.


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