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 Bosco So <bo...@despammed.com> on 2003/07/14 19:44:55 UTC

result from sending mail

All of the MailetContext.sendMail(...) methods return void. When I'm 
writing a mailet, how can I find out the status of a piece of mail I 
just sent?

For a bounce, I can VERP the From: address and catch the bounce in 
another mailet. How do I find out other errors like: no domain, SMTP 
server down, SPEWS blocking, etc?

BTW, does a VERP matcher already exist in James?

-- Bosco

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BOSCO SO				www.groundspring.org

Senior Software Engineer, Groundspring.org.  Growing nonprofits
with Internet tools and training.

  DonateNow:  accept credit card donations through your website
   EmailNow:  send eNewsletters and communicate with supporters
      ebase:  manage your stakeholder relationships

P.O. Box 29256, San Francisco, CA 94129-0256
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .




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


RE: result from sending mail

Posted by "Noel J. Bergman" <no...@devtech.com>.
> I am writing a CRM-like list mailer that needs to track what
> happens to each email sent to a member

> With the JavaMail model, I can get the status and immediately
> note it in the database.  With the spooling model, I'll VERP
> each piece of outbound mail, check for bounces, and assume "no
> news is good news" for the rest.

All that the "direct" model does for you is tell you that the message was
accepted for relay by the remote MTA.  You still need to be able to handle
delivery failures that occur later.  Don't forget that the message can
bounce after being accepted, and that the MTA to accept the mail is not
necessarily the one deliverying it.  Even if you used a custom JavaMail
delivery mailet, you'd still have to handle VERP.

There are people who have done similar applications with James.  I don't
know if they'll be willing to provide any insights.

	--- Noel


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


Re: result from sending mail

Posted by Bosco So <bo...@despammed.com>.
>>You're right, I missed the "james-is-your-agent" model; instead, I was
>>thinking of the JavaMail model where I get a status code upon each send.
>>    
>>
>
>You may have also missed the fact that messages inserted into the spool go
>through the pipeline, and can still be processed by other mailets.
>
>If your mailet needs to be a delivery agent, you can always replicate
>everything done for you by RemoteDelivery.  You'd spawn your own threads so
>that you're not consuming those available for spool processing, do your own
>retry queue, etc.
>
Yup, I missed that too. Good thing you reminded me. I really don't want 
to replicate code and/or write a delivery agent - it's sufficient for me 
to catch bounces. But your mention of thread-spawning leads to issues 
regarding long-running mailets which I'll bring up under a new subject.

>>I was hoping for some sort of direct notification mechanism
>>(Observer pattern?) where my code can know the status of each
>>outbound piece of email.
>>    
>>
>
>For each SMTP transaction?  For each recipient?
>
For each recipient. I am writing a CRM-like list mailer that needs to 
track what happens to each email sent to a member (in addition to 
click-thrus of URLs in the message body, explicit administrator 
initiated retries, etc). With the JavaMail model, I can get the status 
and immediately note it in the database. With the spooling model, I'll 
VERP each piece of outbound mail, check for bounces, and assume "no news 
is good news" for the rest.

-- Bosco


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


RE: result from sending mail

Posted by "Noel J. Bergman" <no...@devtech.com>.
> You're right, I missed the "james-is-your-agent" model; instead, I was
> thinking of the JavaMail model where I get a status code upon each send.

You may have also missed the fact that messages inserted into the spool go
through the pipeline, and can still be processed by other mailets.

If your mailet needs to be a delivery agent, you can always replicate
everything done for you by RemoteDelivery.  You'd spawn your own threads so
that you're not consuming those available for spool processing, do your own
retry queue, etc.

> I was hoping for some sort of direct notification mechanism
> (Observer pattern?) where my code can know the status of each
> outbound piece of email.

For each SMTP transaction?  For each recipient?

Once we have mail attributes in place, in theory we could implement some
sort of callback with RemoteDelivery where one could attach a serializable
event listener object to a mail object.  Alternatively, we could add an
event model to the Mailet API, and not be message specific.  Come up with
reasonable use-cases.

	--- Noel


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


Re: result from sending mail

Posted by Bosco So <bo...@despammed.com>.
You're right, I missed the "james-is-your-agent" model; instead, I was 
thinking of the JavaMail model where I get a status code upon each send. 
With James, I'll just have to be smarter about interpreting bounce 
messages (ie, VERP). I was hoping for some sort of direct notification 
mechanism (Observer pattern?) where my code can know the status of each 
outbound piece of email.

>>All of the MailetContext.sendMail(...) methods return void.
>>    
>>
>
>They just spool mail.  There is no status.  I think you are missing the
>architectural view.
>
>  
>
>>When I'm writing a mailet, how can I find out the status of
>>a piece of mail I just sent?
>>    
>>
>
>You didn't send it.  You inserted it into a spool for processing along with
>all the rest of the messages.
>
>  
>
>>How do I find out other errors like: no domain, SMTP server down,
>>SPEWS blocking, etc?
>>    
>>
>
>The remote delivery code will handle transient ones, and bounce permanent
>ones.  Handle the bounce messages.
>
>  
>
>>BTW, does a VERP matcher already exist in James?
>>    
>>
>
>Not yet.
>
-------- processed by Jakarta James --------

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


RE: result from sending mail

Posted by "Noel J. Bergman" <no...@devtech.com>.
> All of the MailetContext.sendMail(...) methods return void.

They just spool mail.  There is no status.  I think you are missing the
architectural view.

> When I'm writing a mailet, how can I find out the status of
> a piece of mail I just sent?

You didn't send it.  You inserted it into a spool for processing along with
all the rest of the messages.

> How do I find out other errors like: no domain, SMTP server down,
> SPEWS blocking, etc?

The remote delivery code will handle transient ones, and bounce permanent
ones.  Handle the bounce messages.

> BTW, does a VERP matcher already exist in James?

Not yet.

	--- Noel


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