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).
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
--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)
A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------