Re: javamail send error



priyom wrote:

Hi,

I am using javamail 1.4 API to send messages through a SMTP server.
The problem is I get the following error:

550 5.7.1 Unable to relay for a@xxxxx
(I have changed the actual address here-but it's a valid address)

Note: The Outgoing server requires authentication.
Probably I'm going wrong there...
Is there any way to verify if authentication has succeeded or not?


How is authentication configured on your mail server?

A client must only attempt authentication if the server offers it. This will be
done in response to an EHLO message sent by the client. The response to this
indicates the services offered by the mail server. If AUTH is not among them
then it is incorrect for the client to attempt authentication.

Some mail servers will offer AUTH on the normal SMTP port of 25 and some will
only offer it on the mail submission port, 587. You can find out using telnet
what services your mail server offers on those ports. Telnet to port 25 and
send it a EHLO request. If the response doesn't include AUTH then try the same
on port 587. If that does include AUTH then you need to modify your smtp
Transport connection set the port to 587. If neither include AUTH then you need
to contact Microsoft and ask them what non-standard authentication scheme they
have implemented for mail submission in Exchange/Outlook.

One more thing, there is no problem accessing Inbox - Incoming mail
(IMAP) works absolutely fine ...

That's an entirely different protocol, on a different port, for reading mail.



.....
Output:
DEBUG SMTP: trying to connect to host "a.b.c.d", port 25, isSSL false
220 <host string> Microsoft ESMTP MAIL Service, Version: 5.0.2195.6713
ready at Wed, 8 Feb 2006 08:31:49 -0600
DEBUG SMTP: connected to host "a.b.c.d", port: 25
.
.
.
.
MAIL FROM:<a@xxxxx>
250 2.1.0 a@xxxxxxxxxxxxxxx OK
RCPT TO:<a@xxxxx>
550 5.7.1 Unable to relay for a@xxxxx
DEBUG SMTP: Invalid Addresses
DEBUG SMTP: a@xxxxx
DEBUG SMTP: Sending failed because of invalid destination addresses
RSET
250 2.0.0 Resetting

You've missed out the interesting bits...

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@xxxxxxxxxxxx
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
.



Relevant Pages

  • Exchange issues
    ... IP address that the MX record points, port forwarding is configured to route ... all traffic on port 25 to the SBS Exhange server. ... I suspected SMTP relaying becuase ... All the Exchange services are running and all looks fine. ...
    (microsoft.public.exchange2000.admin)
  • Re: Mail sent through IIS virtual SMTP server not arriving
    ... Juan T. Llibre, asp.net MVP ... In the Default SMTP Virtual Server's properties, in the "Access" tab, both ... a real sender address on the SMTP virtual server? ... Youi'll find sample code for changing the port number under system.web.amil here: ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: SMTPS - Exchange
    ... the newsgroups are staffed weekdays by Microsoft Support professionals to ... If the Exchange server is listening on other port rather than ... the external email server will not send emails to your SMTP ...
    (microsoft.public.windows.server.sbs)
  • Re: outlook express wont connect using ssl
    ... my smtp VS which is on 587 to the same settings as my default server ... the only difference is the port #. ... As soon as the cert has been added, SSL ...
    (microsoft.public.exchange.admin)
  • Re: OE 6& SP2 CORRECTION TO PREVIOUS
    ... >> The strange thing is that Port 25 is used for both my MSN ... Even my server uses port 25. ... > standard port for SMTP clients to connect when passing SMTP messages. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)