You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Wall <d....@computer.org> on 2006/02/10 22:01:59 UTC

Off topic: Email bounce handler code?

Does anybody know of any good Java/servlet code that handles email 
bounce processing?  When our automated systems send an email that 
bounces (lots of hotmail bounce if the user has an account but just 
hasn't logged in the past 30 days), we'd like a "somewhat reliable" 
mechanism to associate the bounce with a transaction in our system.  I'd 
guess I'd put a special header in so that bounces that return headers or 
return the original message can be parsed.

I've seen some mailman type code, but they rely on the SMTP server being 
able to handle mangled email addresses, but that's not generally an 
option for us as we often need to rely on existing SMTP systems in which 
at best we can configure the return path to be a given mailbox that we 
can analyze.

Thanks,
David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Off topic: Email bounce handler code?

Posted by Kenevel <ke...@hotmail.com>.
David Wall wrote:
> Does anybody know of any good Java/servlet code that handles email
> bounce processing?  When our automated systems send an email that
> bounces (lots of hotmail bounce if the user has an account but just
> hasn't logged in the past 30 days), we'd like a "somewhat reliable"
> mechanism to associate the bounce with a transaction in our system.
> I'd guess I'd put a special header in so that bounces that return
> headers or return the original message can be parsed.

Hi David,

I've just done exactly that with the Exim mailserver, the JavaMail and Java
Timer API inside Tomcat. The "mangling" process you mentioned is called VERP
which stands for Variable Envelope Return Paths. The gist is that when I
send an email out to someone@somewhere.com, the return path header on the
email is set to:

bounce-someone=somewhere.com@mydomain.com

As long as you configure your SMTP server to recognise these bounce messages
and deliver them to a mailbox, you can use JavaMail to poll for updates,
parse the TO: field using a regular expression and then move the parsed
email to a sub-folder, say.

This doesn't affect your reply-to address on the emails. If it is delivered
successfully, and the reciepient tries to reply, it will be delivered as
expected - the return path header is ignored.

HTH.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Off topic: Email bounce handler code?

Posted by Nicholas Irving <ni...@darkedges.com>.
Yeah did something similair a number of yeah ago, but was not with TomCat.
Instead used ACS, Oracle Server and qmail, where we used oracle to read the
mail messages, from qmail store, into the database and the ACS to read those
messages. Cannot remember off the top of my head how it was done, but we had
set the bounce back to a unique id which qmail would associate with a
mailbox for us. Will try and dig out how it all work properly later.

-----Original Message-----
From: David Wall [mailto:d.wall@computer.org] 
Sent: Saturday, 11 February 2006 8:02 AM
To: Tomcat Users List
Subject: Off topic: Email bounce handler code?

Does anybody know of any good Java/servlet code that handles email 
bounce processing?  When our automated systems send an email that 
bounces (lots of hotmail bounce if the user has an account but just 
hasn't logged in the past 30 days), we'd like a "somewhat reliable" 
mechanism to associate the bounce with a transaction in our system.  I'd 
guess I'd put a special header in so that bounces that return headers or 
return the original message can be parsed.

I've seen some mailman type code, but they rely on the SMTP server being 
able to handle mangled email addresses, but that's not generally an 
option for us as we often need to rely on existing SMTP systems in which 
at best we can configure the return path to be a given mailbox that we 
can analyze.

Thanks,
David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 7/02/2006
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.6/257 - Release Date: 10/02/2006
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Off topic: Email bounce handler code?

Posted by Nicholas Irving <ni...@darkedges.com>.
Take a look at 
http://rhea.redhat.com/asj/webmail/ 
http://www.eveandersson.com/arsdigita/doc/email-handler
http://ryanlee.org/doc/bulkmail.html

Basis of what you are trying to do is here, just may need some adaptation to
your systems.

-----Original Message-----
From: David Wall [mailto:d.wall@computer.org] 
Sent: Saturday, 11 February 2006 8:02 AM
To: Tomcat Users List
Subject: Off topic: Email bounce handler code?

Does anybody know of any good Java/servlet code that handles email 
bounce processing?  When our automated systems send an email that 
bounces (lots of hotmail bounce if the user has an account but just 
hasn't logged in the past 30 days), we'd like a "somewhat reliable" 
mechanism to associate the bounce with a transaction in our system.  I'd 
guess I'd put a special header in so that bounces that return headers or 
return the original message can be parsed.

I've seen some mailman type code, but they rely on the SMTP server being 
able to handle mangled email addresses, but that's not generally an 
option for us as we often need to rely on existing SMTP systems in which 
at best we can configure the return path to be a given mailbox that we 
can analyze.

Thanks,
David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 7/02/2006
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.6/257 - Release Date: 10/02/2006
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org