hi all,
i am using java mail for sending mails using SMTP server.
is there anyway by which i (my application) can get to know if the
mail bounced ?
is there any synchronous call which will let me know immidiately if
the mail bounced for a particular mail address (in case there are
multiple recepients).
i am aware that i can provide reply path but how does my application
come to know if the mail bounced / failed.
how is this generally taken care of ?
thanks
regards
amey
Andrew Thompson - 02 Aug 2007 16:43 GMT
...
>is there any synchronous call which will let me know immidiately if
>the mail bounced for a particular mail address (in case there are
>multiple recepients).
Many mail networks nowadays will refuse to acknowledge
whether any particular email address is valid, especially to
avoid encouraging spam email to multiple recipients.
The attitude is - if a sender does not know whether an
email address exists, they should not be sending email
to it, in the first place.

Signature
Andrew Thompson
http://www.athompson.info/andrew/
ameyas7 - 02 Aug 2007 18:01 GMT
Hi Andrew,
> The attitude is - if a sender does not know whether an
> email address exists, they should not be sending email
> to it, in the first place.
hmm but mail may bounce for several reasons.
say in an organisation which puts a max mailbox size limit on the
employee.
so if he is on longggggggggg vacation ;) maybe his box gets full.
so even though the recepient is valid, mail may bounce.
i wanted to know if there is any mechanism by which i will get to know
if the mail was successfully delivered (from my application).
thanks
amey
shakah - 02 Aug 2007 18:17 GMT
> Hi Andrew,
>
[quoted text clipped - 13 lines]
> thanks
> amey
As another poster suggested, the best answer to your question is
"maybe", depending on the destination mail server's configuration. In
the best case for you, the server "bounces" the message for any of
several reasons by sending an e-mail to one of:
1. the mail header's "Sender" address
2. the SMTP conversation's "From" address
3. the mail header's "Reply-To" address
Given that, your application can periodically check a mailbox for such
bounced messages, and try to correlate it with an e-mail that you
sent. Note that this "negative ACK" covers your original question
("how can I know if it bounced"), but not your most recent version of
"how can I know if it was successfully delivered" variation (which
would need a "positive ACK").
Greg R. Broderick - 02 Aug 2007 22:48 GMT
ameyas7 <amey.samant@gmail.com> wrote in news:1186065498.319240.38510
@d30g2000prg.googlegroups.com:
> hi all,
>
[quoted text clipped - 4 lines]
> the mail bounced for a particular mail address (in case there are
> multiple recepients).
A sent mail may 'bounce' in one of two ways:
1. the SMTP server to which you (the mail user agent/mail client) are
sending the mail may reject the message either temporarily or permanently.
This is handled with an SMTP result code of 4xx (temporary failure) or 5xx
(permanent failure), where the precise reasoning for the failure can be
determined from the other two digits of the result code. Consult RFC 2821
for the gory technical details of SMTP response codes. You may detect and
trap these in the sending SMTP client software immediately when the message
is sent -- this provides a synchronous feedback when the message is
immediately rejected.
2. SMTP and the Internet mail architecture is, by design, store-and-forward
-- you send a message to an intermediate host (your ISP's mail server) which
stores the message and forwards it on to another intermediate host, until it
eventually reaches the recipient. This storage and forwarding happens after
the initial sending of the message from the mail client to the mail server
has completed successfully, thus no synchronous means is available to notify
the mail client that the message has been rejected or bounced by one of the
intermediate hosts. What most mail servers will do is to return an email
message to the putative sender's email box, containing an error message,
indicating why the message failed to be sent, and possibly the original
message. This message may be retrieved from the sender's email box using
whatever method (usually POP3 or IMAP) the mail client normally uses to
retrieve inbound email messages.
Due to the nature of SMTP as a store-and-forward mail system, this can not
happen synchronously, thus no synchronous feedback is possible when one of
the intermediate hosts further down the line rejects the sender's email.
For more information, please consult the various Internet RFCs concerning
email and SMTP.
Cheers!
GRB

Signature
---------------------------------------------------------------------
Greg R. Broderick usenet200705@blackholio.dyndns.org
A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
Roedy Green - 05 Aug 2007 15:58 GMT
>i am aware that i can provide reply path but how does my application
>come to know if the mail bounced / failed.
I handle the problem by doing checking ahead of time that at least the
mailserver exists and has been alive some time in recent memory.
I use a "analog" measure of email address plausibility, so you can
filter out email addresses that are likely duds.
See http://mindprod.com/products1.html#BULK
The bounces come back later an wide variety of formats. Perhaps you
could write a JavaMail program to comb through these looking for
headers, or text that indicates a bounce.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
ameyas7 - 06 Aug 2007 07:25 GMT
On Aug 5, 7:58 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
........
> The bounces come back later an wide variety of formats. Perhaps you
> could write a JavaMail program to comb through these looking for
> headers, or text that indicates a bounce.
> --
> Roedy Green Canadian Mind Products
> The Java Glossaryhttp://mindprod.com
thanks roedy.
- amey