Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JavaMail : Intermittent Exception

40 views
Skip to first unread message

rc

unread,
Mar 13, 2001, 9:50:41 PM3/13/01
to
Hi,
I am developing an application using the JavaMail1.2 API(JDK1.3). The
application does Transport.send to send an email message to an address.
The code is very similar to the code given in the sample
program,msgsendsample.java, that comes with the JavaMail API package.
My application intermittently raises the javax.mail.SendFailedException.
I am pasting below the stack trace I get. Once it gets into this state,
it keeps raising this exception, until ofcourse I restart the program.
I would appreciate it if someone could give me some ideas as to why this
might be happening & what I could do in code to fix it.
One thing that might be different in my application & the
msgsendsample.java is that my application, during it's lifetime does a
Session.getDefaultInstance(Properties) multiple times. This is just
because the application can be initialized multiple times(which is where
it does a Session.getDefaultInstance()). Could this be part of the
problem?

Given below is the stacktrace :

javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
javax.mail.SendFailedException: 550 <cafe...@hotmail.com>...
Relaying denied

at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at dev.app.EmailApp.sendMail(EmailApp.java:328)

thanks
rc


Robert Lynch

unread,
Mar 13, 2001, 11:46:27 PM3/13/01
to

Completely aside from Java programming, "Relaying denied" comes
up when someone not a member of domain A tries to send mail
through domain A's mail server to someone in domain B, where that
someone in domain B is also outside of domain A.

So I wonder if you are not sending to a list of addresses, one of
which is not permitted to "go" due to relaying being denied?

Try catching the exception, then log the address which caused it
to fail, then check it against the above possibility.

HTH. Bob L.
--
Robert Lynch Berkeley CA USA rml...@pacbell.net

Adnan

unread,
Mar 14, 2001, 2:44:46 AM3/14/01
to
On Tue, 13 Mar 2001 20:50:41 -0600, rc <cafe...@hotmail.com> wrote:

>
>javax.mail.SendFailedException: Sending failed;
> nested exception is:
> javax.mail.SendFailedException: Invalid Addresses;
> nested exception is:
> javax.mail.SendFailedException: 550 <cafe...@hotmail.com>...
>Relaying denied


Doesn't "Relaying denied" mean your ISP's SMTP server doesn't allow relaying?
i.e., if the email address in "From" (or "To") header is not in the domain, some
SMTP servers will reject the post.

I am not sure, but a couple of years ago I tried to send email through
smtp.idt.net, but the address in "From" header was not balb...@idt.net, and
the response I got was "Relaying denied."


rc

unread,
Mar 14, 2001, 11:12:11 AM3/14/01
to
The "To" address is outside the domain of the originating mail server, but the
"From" address is within the the domain of the sending mail server. If the
originating mailServer is "mail.server.net.com" for example, then the "from" is
emailA...@server.net.com.
But if it were an unauthorised/incorrect email address in the "from" / "to" / "cc"
field why would the exception be intermittent for the same email addresses?

Wayne Pollock

unread,
Mar 14, 2001, 11:45:48 AM3/14/01
to
I don't know much about this, but I wonder if the problems isn't due
to an intermittent problem with your DNS server. Many email sites that
don't permit relaying use a DNS lookup to see if the originating site
is really winthin their domain. If this lookup fails the mail is
dropped. So, if the DNS server is failing/overtaxed, a symtom might be
intertmittent email failure.

Just a pseudo-random thought, hope it helps.

-Wayne Pollock

Babu Kalakrishnan

unread,
Mar 15, 2001, 2:49:02 AM3/15/01
to
On Wed, 14 Mar 2001 10:12:11 -0600, rc <cafe...@hotmail.com> wrote:
>The "To" address is outside the domain of the originating mail server, but the
>"From" address is within the the domain of the sending mail server. If the
>originating mailServer is "mail.server.net.com" for example, then the "from" is
>emailA...@server.net.com.
>But if it were an unauthorised/incorrect email address in the "from" / "to" / "cc"
>field why would the exception be intermittent for the same email addresses?

The "550 Relaying denied" error is certainly coming from the SMTP server which
indicates that it is refusing to relay the mail for the addressee. Can you give
some more details regarding the error such as

a) The smtp server to whom you're trying to connect to
b) The To: address
c) The envelope From: address

A lot of SMTP providers are quite wary about relaying mail these days
(rightly so) to avoid misuse by spammers.

Kala

Adnan

unread,
Mar 15, 2001, 6:07:46 AM3/15/01
to
On Wed, 14 Mar 2001 11:45:48 -0500, Wayne Pollock <pol...@acm.org> wrote:

>rc wrote:
>>
>> The "To" address is outside the domain of the originating mail server, but the
>> "From" address is within the the domain of the sending mail server. If the
>> originating mailServer is "mail.server.net.com" for example, then the "from" is
>> emailA...@server.net.com.
>> But if it were an unauthorised/incorrect email address in the "from" / "to" / "cc"
>> field why would the exception be intermittent for the same email addresses?

I have even seen some SMTP servers that do not allow sending e-mail to anyone
except within domain. Some universities have this policy. i.e. they allow
sending e-mail only to people within university (or even only within
department).

Try sending e-mail where both "To" and "From" is the same address and is within
domain and valid, i.e. FROM: kar...@softhome.net ... TO: kar...@softhome.net ...

Kh

unread,
Mar 15, 2001, 4:11:12 PM3/15/01
to
I want to do

Double number1 = 36893488147419103231;
Double number2 = 2305843009213693951;

to check whether these numbers are primes. But I get
java:7: integer number too large: 2305843009213693951

So there is no way to represent these numbers in java?

Chris Wolfe

unread,
Mar 15, 2001, 4:27:05 PM3/15/01
to
What you are looking for is the BigInteger class. Check the API
documentation for java.math.BigInteger, especially the String
constructor. e.g. BigInteger number2 = new
BigInteger("36893488147419103231");

Java ints only store numbers from -2147483648 to 2147483647.
Because the compiler always assumes int unless told otherwise, it
will choke on large numbers.

The next step up from ints, longs, store numbers from
-9223372036854775808 to 9223372036854775807. To specify that a
number is of type long, append an L (lower-case works too). e.g.
long number2 = 2305843009213693951L;

Now, if you only want to store approximations of the numbers
(probably not for prime determination), double and float are also
usable. To tell the compiler that a number is a double just
include a decimal point. e.g. double number1 =
36893488147419103231.0; The float type is less precise, and is
specified by including a decimal point and an F (lower-case works
too). e.g. float number2 = 36893488147419103231.0f;

The upper-case types (Double, Integer, Long, etc) are actually
classes rather than primitive types (double, int, long, etc). Be
careful mixing the two, as they are _really_ not the same thing.

Cheers,
Chris

Jan Uhre

unread,
Mar 15, 2001, 9:01:16 PM3/15/01
to

Kh <k...@home.net> skrev i en
nyhedsmeddelelse:oob2btg684m5m40fp...@4ax.com...

Yes, there is. But is it a mistake, that you typed Double with a capital D?

If you want the class Double to contain this number, you do the following:
Double number1 = new Double(36893488147419103231.0);

Remember the .0 to indicate that it is a double value.

If you really meant this to be a primitive type double, you do the
following:
double number1 = 36893488147419103231.0

Again .0 to indicate a double value.

If nothing else is indicated the compiler assumes that the constant
initializer value is an int. Therefore:
double number1 = 36893488147419103231;
will cause an "integer number too large" error.


0 new messages