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 Gino Marckx <gi...@skynet.be> on 2004/02/12 21:17:44 UTC

Differentiate between bounce and reply

Hi,

Is it possible to differentiate between bounces and replies for a mail 
using matchers or mailets?  I noticed that bounces are sent to the from 
address instead of the reply-to address, but not really knowing this is 
just a coincidence or according the specs.
I read that inside a mail, there is yet another address, the envelope 
address, and that address is used to send the bounce to...  Now, what 
if I just specify another from and reply-to address for mails send with 
James?  Do the bounces go to the from or reply-to, or will they go to 
the envelope addres I can't see?  What happens with read-notification 
mails, because I also need to be able to trigger those using a 
mailet...
This is fairly important for me since I am integrating with James to 
provide robust reporting for an electronic mailing system.  And my 
customer rather wants to see his email address in the from and reply, 
instead of some fishy address referring to the mail server of the 
mailing system.

Regards,
Gino Marckx.


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


Re: Differentiate between bounce and reply

Posted by Serge Knystautas <se...@lokitech.com>.
Gino Marckx wrote:
> Is it possible to differentiate between bounces and replies for a mail 
> using matchers or mailets?  I noticed that bounces are sent to the from 
> address instead of the reply-to address, but not really knowing this is 
> just a coincidence or according the specs.
> I read that inside a mail, there is yet another address, the envelope 
> address, and that address is used to send the bounce to...  Now, what if 
> I just specify another from and reply-to address for mails send with 
> James?  Do the bounces go to the from or reply-to, or will they go to 
> the envelope addres I can't see?  What happens with read-notification 
> mails, because I also need to be able to trigger those using a mailet...
> This is fairly important for me since I am integrating with James to 
> provide robust reporting for an electronic mailing system.  And my 
> customer rather wants to see his email address in the from and reply, 
> instead of some fishy address referring to the mail server of the 
> mailing system.

I can give a definitive "probably".  Here's what we've got:
- an email server will use the SMTP MAIL FROM email address.  servers do 
all the delivery, so a bounce will be sent to that address.  People who 
want to track bounces use an approach called VERP where every email gets 
a unique sending address.
- an email client will use the From (or reply-to or other) header to 
reply.  so a reply will use that address.

The kicker is vacation messages, and to a less extent, mailing lists.

Vacation messages are not undefined... they are sometimes handled by the 
client, sometimes by the server, so that's the first problem.  Second, 
nobody defines how to send a vacation bounce as temporary as opposed to 
a permanent bounce.  Basically, vacation messages are very rare as a 
result of this lack of specificity.

Mailing lists do not always follow the rules.  Poor implementations 
(like the first one in James I wrote) reply to the wrong place.  Man, my 
frisbee team was pissed when everyone received hundreds of bounces in an 
hour because one address was bouncing and created a bad loop.  Anyway, 
mailing lists are not 100% reliable.

Oh, you ask about read confirmations.  Honestly I don't know much about 
it, but believe they would follow the email client behavior.

So you can overlay that with your need for robustness.  Generally, 
sounds like you want VERP and just make sure you set the From (and 
Reply-To if you want) correctly.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

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


Re: Differentiate between bounce and reply

Posted by Serge Knystautas <se...@lokitech.com>.
Bosco So wrote:
> *    Some external mail servers immediately tells James'
> RemoteDelivery mailet that the message is not deliverable (lets call it
> "FAST FAIL" for this discussion). James then sends a message to our
> Reply-To: address notifying us of that. I think this is a bug, because
> James should really send that notification to our Return-Path: address.
> Because the VERP prefix for Reply-To: is different than Return-Path:, we
> catch this with a different "reply handler" mailet. In our initial
> (naive) implementation, some of our mailing are configured with an
> auto-responder when a reply is encountered, and this James behavior got
> us into REALLY BAD loops. We auto-replied to James' bounce notification
> with the original intended recipient, which caused the external server
> to FAST FAIL, which caused James to send bounce message to the Reply-To:
> address, which caused us to auto-reply to the intended recipient, and so
> on. Yuck. I fixed this by checking the sender of the the Mail object for
> null - it turns out that if James had sent the reply, then the sender is
> null. If an external entity had sent the reply, then the sender is some
> valid address. Once I detect a null, I handle that mail with the bounce
> handler.

That's definitely a bug, but I'm doing notionally the same thing with 
James 2.1.3 and James is using the return-path.  Hmmm... I guess I'm not 
setting the Reply-to header, just the From, but I would hope that's not 
the problem.

Can you prepare some info (configuration, whatever else) and submit a 
bug to JIRA?  Thanks.

http://nagoya.apache.org/jira/

-- 
Serge Knystautas
President
Lokitech >>> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

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


RE: Differentiate between bounce and reply

Posted by Danny Angus <da...@apache.org>.
Some great insights there Bosco, thanks.

d.

> After sending 133,000 messages over the course of last 2 weeks where we
..... 
> 



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


Re: Differentiate between bounce and reply

Posted by Bosco So <bo...@despammed.com>.
After sending 133,000 messages over the course of last 2 weeks where we
VERP our Return-Path: and Reply-To: while keeping our From: static, this
is what I'm noticing:


*	Some external mail servers successfully take our messages and
some time later (up to 5 days), sends an email to the Return-Path:
address saying that the messages bounced for some reason. We have a
matcher that catches that VERP address and sends it to our "bounce
handler" mailet. The VERP prefix for our Return-Path: address is
different that that of the Reply-To: so bounces are differentiated from
replies.
*	Some external mail servers immediately tells James'
RemoteDelivery mailet that the message is not deliverable (lets call it
"FAST FAIL" for this discussion). James then sends a message to our
Reply-To: address notifying us of that. I think this is a bug, because
James should really send that notification to our Return-Path: address.
Because the VERP prefix for Reply-To: is different than Return-Path:, we
catch this with a different "reply handler" mailet. In our initial
(naive) implementation, some of our mailing are configured with an
auto-responder when a reply is encountered, and this James behavior got
us into REALLY BAD loops. We auto-replied to James' bounce notification
with the original intended recipient, which caused the external server
to FAST FAIL, which caused James to send bounce message to the Reply-To:
address, which caused us to auto-reply to the intended recipient, and so
on. Yuck. I fixed this by checking the sender of the the Mail object for
null - it turns out that if James had sent the reply, then the sender is
null. If an external entity had sent the reply, then the sender is some
valid address. Once I detect a null, I handle that mail with the bounce
handler.
*	External vacation repliers and auto-responders send their
reponses to either the Return-Path: (bounce) address or the Reply-To:
(reply) address. It seems like there's no convention that anyone adheres
to.
*	We're getting a smidgen (around 10) of replies from
challenge-response systems. They all seem to be going to the Reply-To:
address. That's a bummer since I was hoping that keeping the From:
header constant from mailing to mailing will let us respond once to such
systems and that'll let us through for the future.

Hope this helps. We're running James-2.2.0a15 on Redhat Linux 8 with
Sun's 1.4.2_01-b06 configured with 128MB for the JVM; the machine is a
dual-CPU P3 at 1GHz.

Quick note on performance:


*	We can queue to James at about 37,000 messages per hour
(622/min). This is with full token expansion of content customized for
each recipient (using Velocity), URL tracking, etc.
*	With normal email addresses going to diverse domains and hopping
all over the net, James delivers them at around 8000 per hour (133/min).
These messages average 13.4 KB in size. The rate was 7000 per hour until
I configured the inbound spool queue to use local file instead of DB.

*	With test emails - all of which are valid, belonging to one
domain, and hopping across the net - James delivers them at about 15,000
per hour (250/min). I suspect that most of the performance difference is
from not having to repeatedly resolve domains.



-- Bosco



Is it possible to differentiate between bounces and replies for a mail
using matchers or mailets?  I noticed that bounces are sent to the from
address instead of the reply-to address, but not really knowing this is
just a coincidence or according the specs. 
I read that inside a mail, there is yet another address, the envelope
address, and that address is used to send the bounce to...  Now, what if
I just specify another from and reply-to address for mails send with
James?  Do the bounces go to the from or reply-to, or will they go to
the envelope addres I can't see?  What happens with read-notification
mails, because I also need to be able to trigger those using a mailet...

This is fairly important for me since I am integrating with James to
provide robust reporting for an electronic mailing system.  And my
customer rather wants to see his email address in the from and reply,
instead of some fishy address referring to the mail server of the
mailing system. 



RE: Differentiate between bounce and reply

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
if "B" is a bounce to message "A", "B" must be sent to "A"'s Return-Path header, and "B"'s Return-Path header must be set to <>, ("null return path"), meaning that no bounce can further be done to "B".

So, if you receive a message with 
	Return-Path: <>
it is a bounce (or some fake email); if Return-Path has a different value it is not a bounce (unless the bouncer is not following the rules, which happens frequently).

Vincenzo

 

> -----Original Message-----
> From: Gino Marckx [mailto:gino.marckx@skynet.be]
> Sent: giovedi 12 febbraio 2004 21.18
> To: server-user@james.apache.org
> Subject: Differentiate between bounce and reply
> 
> 
> Hi,
> 
> Is it possible to differentiate between bounces and replies for a mail 
> using matchers or mailets?  I noticed that bounces are sent to the from 
> address instead of the reply-to address, but not really knowing this is 
> just a coincidence or according the specs.
> I read that inside a mail, there is yet another address, the envelope 
> address, and that address is used to send the bounce to...  Now, what 
> if I just specify another from and reply-to address for mails send with 
> James?  Do the bounces go to the from or reply-to, or will they go to 
> the envelope addres I can't see?  What happens with read-notification 
> mails, because I also need to be able to trigger those using a 
> mailet...
> This is fairly important for me since I am integrating with James to 
> provide robust reporting for an electronic mailing system.  And my 
> customer rather wants to see his email address in the from and reply, 
> instead of some fishy address referring to the mail server of the 
> mailing system.
> 
> Regards,
> Gino Marckx.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 


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