james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard O. Hammer" <ROHam...@EarthLink.net>
Subject Re: processing of messages
Date Sat, 04 May 2002 16:49:38 GMT
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:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message