Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 39964 invoked from network); 22 Feb 2007 15:26:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2007 15:26:24 -0000 Received: (qmail 64286 invoked by uid 500); 22 Feb 2007 15:26:31 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 64264 invoked by uid 500); 22 Feb 2007 15:26:31 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 64250 invoked by uid 99); 22 Feb 2007 15:26:31 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Feb 2007 07:26:31 -0800 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=INFO_TLD X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [220.227.179.21] (HELO Kecgate03.infosys.com) (220.227.179.21) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Feb 2007 07:26:20 -0800 Received: from indhubbhs04.ad.infosys.com ([192.168.200.84]) by Kecgate03.infosys.com with InterScan Messaging Security Suite; Thu, 22 Feb 2007 17:27:06 +0530 Received: from BLRKECMSG14.ad.infosys.com ([172.22.147.6]) by indhubbhs04.ad.infosys.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 22 Feb 2007 17:26:30 +0530 Received: from BLRKECMSG13.ad.infosys.com ([172.22.147.5]) by BLRKECMSG14.ad.infosys.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 22 Feb 2007 17:26:29 +0530 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: javax.mail.MessagingException: .. could not connect to SMTPhost-Reg Date: Thu, 22 Feb 2007 17:26:28 +0530 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: javax.mail.MessagingException: .. could not connect to SMTPhost-Reg Thread-Index: AcdWdwBL/ZPuRvjETVuOhk/KQWG+OQAAN+5A References: <45DD6E58.4060302@gmail.com> <45DD826E.2010003@gmail.com> From: "Kamalanathan Raman" To: , X-OriginalArrivalTime: 22 Feb 2007 11:56:29.0682 (UTC) FILETIME=[7D03E520:01C75678] X-Virus-Checked: Checked by ClamAV on apache.org Hi Rick ,=20 The information u have given was really useful , now I have changed the "mail.smtp.host" attribute to "mail.host" and now it is throwing this particular error. As u said iam using the following code , by calling "Session.getDefaultInstance" , find attached the code and the stack trace that iam getting now. Kindly help me out.=20 public static void sendNotification(String to, String from, String host, String emailContent, String subject, String fileName) throws MessagingException { final String methodName =3D "sendNotification(...)"; try { if (logger.isEnabledFor(Priority.INFO)) { logger.log(Priority.INFO, new LoggableMessage(methodName, true)); } try { Properties props =3D System.getProperties(); props.put("mail.host", host); Session session =3D Session.getDefaultInstance(props, null); sendNotification(session, to, from, emailContent, subject, fileName); } catch (MessagingException me) { logger.log(Priority.ERROR, new LoggableMessage(methodName, "MessagingException "), me); throw me; } } finally { if (logger.isEnabledFor(Priority.INFO)) { logger.log(Priority.INFO, new LoggableMessage(methodName, false)); } } } Stack trace : javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: 454 5.7.3 Client does not have permission to submit mail to this server. ) at javax.mail.Transport.send(Transport.java:161) at javax.mail.Transport.send(Transport.java:46) at com.symcor.common.util.SendMail.sendNotification(SendMail.java:172) at com.symcor.common.util.SendMail.sendNotification(SendMail.java:93) at com.symcor.eds.app.RunEDSService.sendMail(RunEDSService.java:411) at com.symcor.eds.app.RunEDSService.main(RunEDSService.java:338) Caused by: javax.mail.MessagingException: 454 5.7.3 Client does not have permission to submit mail to this server. at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:879) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:599) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:319) at javax.mail.Transport.send(Transport.java:93) ... 5 more 2007-02-22 17:22:50,066 INFO com.symcor.common.util.SendMail -sendNotification(...):exit 2007-02-22 17:22:50,066 ERROR root -main[]:Send failure (javax.mail.MessagingException: 454 5.7.3 Client does not have permission to submit mail to this server. ) javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: 454 5.7.3 Client does not have permission to submit mail to this server. ) at javax.mail.Transport.send(Transport.java:161) at javax.mail.Transport.send(Transport.java:46) at com.symcor.common.util.SendMail.sendNotification(SendMail.java:172) at com.symcor.common.util.SendMail.sendNotification(SendMail.java:93) at com.symcor.eds.app.RunEDSService.sendMail(RunEDSService.java:411) at com.symcor.eds.app.RunEDSService.main(RunEDSService.java:338) Caused by: javax.mail.MessagingException: 454 5.7.3 Client does not have permission to submit mail to this server. at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:879) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:599) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:319) at javax.mail.Transport.send(Transport.java:93) ... 5 more Thanks and Regards, Kamal -----Original Message----- From: Rick McGuire [mailto:rickmcg@gmail.com]=20 Sent: Thursday, February 22, 2007 5:16 PM To: user@geronimo.apache.org Subject: Re: javax.mail.MessagingException: .. could not connect to SMTPhost-Reg I already did. It is picking up the "localhost" attribute because it's=20 not properly using the "mail.smtp.host" property to configure the target SMTP host. Either of the two solutions I gave you below will fix the=20 problem. How are you creating the mail Session in your application? Are you=20 picking up the Geronimo mail resource, or are you configuring one=20 yourself by calling Session.getInstance() or=20 Session.getDefaultInstance()? If you are using the Geronimo resource,=20 then you need to specify a hostname on the MailGBean in your=20 config.xml. The following added in the same section as the=20 SMTPTransport should do it: myhost If you're not using the mail/MailResource provided by the server, then=20 you need to make sure you set the property "mail.host" to your host in=20 the property bundle you use when you call Session.getInstance().=20 Rick Kamalanathan Raman wrote: > Hi Rick, > > Thanks for replying, iam not sure from where it is picking the > "localhost" attribute . I have mentioned my mail server host which is > different everywhere in my application and also i have changed in the > "config.xml" file inside Geronimo/var folder also to reflect to my host > , but iam not sure from where it is picking up this attribute. Kindly > help me resolve this issue. > > Thanks and Regards, > Kamal > > -----Original Message----- > From: Rick McGuire [mailto:rickmcg@gmail.com]=20 > Sent: Thursday, February 22, 2007 3:50 PM > To: user@geronimo.apache.org > Subject: Re: javax.mail.MessagingException: .. could not connect to > SMTPhost -Reg > > There's a bug in the code that sorts out the connection host when you=20 > are using Transport.send(). There are two workarounds I know of for the=20 > problem: > > 1) set the target SMTP host using the "mail.host" property rather than > "mail.smtp.host", or > 2) Rather than use Transport.send(), explicitly request a transport=20 > instance from the Session and call connect() yourself, passing in the=20 > appropriate target and port. > > It also appears from the Exception getting thrown and the stack trace, > that your application is picking up the Sun mail.jar, resulting in=20 > mixing of the Geronimo mail api code with the Sun SMTPTransport=20 > implemenation. This should, in theory, work, but is not a configuration=20 > we've doing any testing with at all. You should remove any dependency=20 > you have on the sun mail.jar and make sure you're picking up the=20 > geronimo-javamail-transport jar included with 1.1.1. > > Rick > > Kamalanathan Raman wrote: > =20 >> Hi , >> >> Iam trying to send a notification mail using the java mail in Geronimo >> =20 > > =20 >> 1.1.1 . When I try to send the mail iam getting this following=20 >> exception , can any one give a pointer regarding where iam going wrong >> =20 > > =20 >> and what to do... >> >> _javax.mail.SendFailedException_: Send failure=20 >> (_javax.mail.MessagingException_: Could not connect to SMTP host:=20 >> localhost, port: 25 (_java.net.ConnectException_: Connection refused: >> connect)) >> >> at javax.mail.Transport.send(_Transport.java:161_) >> >> at javax.mail.Transport.send(_Transport.java:46_) >> >> at >> =20 > com.symcor.common.util.SendMail.sendNotification(_SendMail.java:171_) > =20 >> at >> =20 > com.symcor.common.util.SendMail.sendNotification(_SendMail.java:92_) > =20 >> at com.symcor.eds.app.RunEDSService.sendMail(_RunEDSService.java:411_) >> >> at com.symcor.eds.app.RunEDSService.main(_RunEDSService.java:338_) >> >> Caused by: _javax.mail.MessagingException_: Could not connect to SMTP >> host: localhost, port: 25 (_java.net.ConnectException_: Connection=20 >> refused: connect) >> >> at >> =20 > com.sun.mail.smtp.SMTPTransport.openServer(_SMTPTransport.java:867_) > =20 >> at=20 >> >> =20 > com.sun.mail.smtp.SMTPTransport.protocolConnect(_SMTPTransport.java:156_ > ) > =20 >> at javax.mail.Service.connect(_Service.java:215_) >> >> at javax.mail.Service.connect(_Service.java:83_) >> >> at javax.mail.Service.connect(_Service.java:68_) >> >> at com.sun.mail.smtp.SMTPTransport.connect(_SMTPTransport.java:93_) >> >> at javax.mail.Transport.send(_Transport.java:92_) >> >> ... 5 more >> >> Caused by: _java.net.ConnectException_: Connection refused: connect >> >> at java.net.PlainSocketImpl.socketConnect(_Native Method_) >> >> at java.net.PlainSocketImpl.doConnect(Unknown Source) >> >> at java.net.PlainSocketImpl.connectToAddress(Unknown Source) >> >> at java.net.PlainSocketImpl.connect(Unknown Source) >> >> at java.net.SocksSocketImpl.connect(Unknown Source) >> >> at java.net.Socket.connect(Unknown Source) >> >> at java.net.Socket.connect(Unknown Source) >> >> at java.net.Socket.(Unknown Source) >> >> at java.net.Socket.(Unknown Source) >> >> at >> =20 > com.sun.mail.util.SocketFetcher.getSocket0(_SocketFetcher.java:131_) > =20 >> at com.sun.mail.util.SocketFetcher.getSocket(_SocketFetcher.java:113_) >> >> at >> =20 > com.sun.mail.smtp.SMTPTransport.openServer(_SMTPTransport.java:836_) > =20 >> ... 11 more >> >> 2007-02-22 14:50:47,674 INFO com.symcor.common.util.SendMail=20 >> -sendNotification(...):exit >> >> 2007-02-22 14:50:47,674 ERROR root -main[]:Send failure=20 >> (_javax.mail.MessagingException_: Could not connect to SMTP host:=20 >> localhost, port: 25 (_java.net.ConnectException_: Connection refused: >> connect)) >> >> _javax.mail.SendFailedException_: Send failure=20 >> (_javax.mail.MessagingException_: Could not connect to SMTP host:=20 >> localhost, port: 25 (_java.net.ConnectException_: Connection refused: >> connect)) >> >> at javax.mail.Transport.send(_Transport.java:161_) >> >> at javax.mail.Transport.send(_Transport.java:46_) >> >> at >> =20 > com.symcor.common.util.SendMail.sendNotification(_SendMail.java:171_) > =20 >> at >> =20 > com.symcor.common.util.SendMail.sendNotification(_SendMail.java:92_) > =20 >> at com.symcor.eds.app.RunEDSService.sendMail(_RunEDSService.java:411_) >> >> at com.symcor.eds.app.RunEDSService.main(_RunEDSService.java:338_) >> >> Caused by: _javax.mail.MessagingException_: Could not connect to SMTP >> host: localhost, port: 25 (_java.net.ConnectException_: Connection=20 >> refused: connect) >> >> at >> =20 > com.sun.mail.smtp.SMTPTransport.openServer(_SMTPTransport.java:867_) > =20 >> at=20 >> >> =20 > com.sun.mail.smtp.SMTPTransport.protocolConnect(_SMTPTransport.java:156_ > ) > =20 >> at javax.mail.Service.connect(_Service.java:215_) >> >> at javax.mail.Service.connect(_Service.java:83_) >> >> at javax.mail.Service.connect(_Service.java:68_) >> >> at com.sun.mail.smtp.SMTPTransport.connect(_SMTPTransport.java:93_) >> >> at javax.mail.Transport.send(_Transport.java:92_) >> >> ... 5 more >> >> Caused by: _java.net.ConnectException_: Connection refused: connect >> >> at java.net.PlainSocketImpl.socketConnect(_Native Method_) >> >> at java.net.PlainSocketImpl.doConnect(Unknown Source) >> >> at java.net.PlainSocketImpl.connectToAddress(Unknown Source) >> >> at java.net.PlainSocketImpl.connect(Unknown Source) >> >> at java.net.SocksSocketImpl.connect(Unknown Source) >> >> at java.net.Socket.connect(Unknown Source) >> >> at java.net.Socket.connect(Unknown Source) >> >> at java.net.Socket.(Unknown Source) >> >> at java.net.Socket.(Unknown Source) >> >> at >> =20 > com.sun.mail.util.SocketFetcher.getSocket0(_SocketFetcher.java:131_) > =20 >> at com.sun.mail.util.SocketFetcher.getSocket(_SocketFetcher.java:113_) >> >> at >> =20 > com.sun.mail.smtp.SMTPTransport.openServer(_SMTPTransport.java:836_) > =20 >> ... 11 more >> >> Thanks and Regards, >> >> Kamal >> >> **************** CAUTION - Disclaimer ***************** >> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended >> solely for the use of the addressee(s). If you are not the intended=20 >> recipient, please notify the sender by e-mail and delete the original >> message. Further, you are not to copy, disclose, or distribute this=20 >> e-mail or its contents to any other person and any such actions are=20 >> unlawful. This e-mail may contain viruses. Infosys has taken every=20 >> reasonable precaution to minimize this risk, but is not liable for any >> =20 > > =20 >> damage you may sustain as a result of any virus in this e-mail. You=20 >> should carry out your own virus checks before opening the e-mail or=20 >> attachment. Infosys reserves the right to monitor and review the=20 >> content of all messages sent to or from this e-mail address. Messages >> sent to or from this e-mail address may be stored on the Infosys=20 >> e-mail system. >> ***INFOSYS******** End of Disclaimer ********INFOSYS*** >> >> =20 > > > =20