Maxime,

>     i)  Suppose Jame's smtp server is midway in swallowing an email and 
> I pull the plug on the machine, what will happen ?

The connection will be terminated and the sending MTA will time-out and (presumably) 
re-try.
 
>    ii)  When a mailet's service method gets called, is the mail read 
> from the spool file ?

No, it is read (from file or database) only when it is fetched from the spool and 
inserted into the top of the relevant processor.

>   iii) If a mailet's service method is midway in execution and I pull the
>    plug, what happens ?

Its easier if I answer a different question first ;-)
"What happens to a mail as it is processed"
1/ the spool manager reads a mail from the spool
2/ based upon its "state" it is inserted into a linear processor
3/ the processor is responsible for passing the mail through its mailets/matchers
4/ only when the "state" changes is the mail written to the spool

So.. if a mail reaches a mailet and is processed, but the plug is pulled, then that 
mail *will* be passed through the processor, including any mailets it had previously 
passed through, again.
If a mailet has to ensure that it only processes mail once that mailet would currently 
have to take its own steps to ensure that this was the case. 


>   In general, how can one achieve guaranteed "once and only once" email 
> receival with James ?

I don't understand what "guaranteed once and only once email receival" is, James will 
receive a mail or not receive it.
If you mean how to ensure that a mailet will only every process a mail once it is not 
100% possible.
There will always be a chance that a mail being processed when james is killed will be 
re-processed when it is re-started.

> Suppose I have the following email pipeline, and I want the guarantee 
> that : "if an email makes it's way to the smtp middleman, it will 
> eventually result in one execution of myMailet's service method." :
> 
>    EMailCLient---> smtpd(sendmail?)--->james(SMTP->james-spool)->myMailet
> 
> Should I configure sendmail to retry upon failure (lets say, retry up to 
>   5 times with a 10 minute sleep in between) ?

Sendmail is irrelevant here, your mail client should connect straight to James, James 
is an SMTP Mail server too.
If you have to use sendmail for other reasons, fine, but it changes nothing, sendmail 
and James both know how to send and recieve mail properly. Any valid SMTP 
configuration of either will result in the correct transmission of your messages.

d.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to