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

Re: Help with was6.1 mailsessions via jython, anyone had this issue?

21 views
Skip to first unread message

HenkW

unread,
Oct 26, 2009, 10:45:35 AM10/26/09
to
..... and is port 25 in listen state?


jholmes123

unread,
Oct 26, 2009, 10:27:13 AM10/26/09
to
Question, im creating mail sessions via a jython script. The script creates everything fine, but whenever the sessions are used by the jvms a connection failure occurs when trying to send mail:

[10/21/09 9:01:50:133 EDT] 00000036 email E com.ibm.sr.email.notify.EMailUtilities getEMailSMTPTransport GSR5000I: Captured exception [274]: javax.mail.
MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception is: java.net.ConnectException: A remote host refused an attempted connect operation.
[10/21/09 9:01:50:135 EDT] 00000036 email E com.ibm.sr.email.notify.EMailUtilities getEMailSMTPTransport javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception is: java.net.ConnectException: A remote host refused an attempted connect operation.
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1008)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:197)
at javax.mail.Service.connect(Service.java:233)
at javax.mail.Service.connect(Service.java:134)
at javax.mail.Service.connect(Service.java:86)

To resolve I simply delete and readd the mailsessions with the same exact info setup via the script. Below is the script im using:

{code}
serverName = sys.argv[0]
mailSessionName = sys.argv[1]
MailJndi = sys.argv[2]


nodeMlist = AdminConfig.list('Node').splitlines()

for node in nodeMlist :
if node.find("_dm") =0:
nodeName = AdminConfig.showAttribute(node, 'name')
server = AdminConfig.getid("/Node:" + nodeName + "/Server:" + serverName + "/")
msList = AdminConfig.list("MailSession", server).split(java.lang.System.getProperty("line.separator"))
for mail in msList:
if(mail != ""):
getName = AdminConfig.showAttribute(mail, "name")
getJNDI = AdminConfig.showAttribute(mail, "jndiName")
if (getName == mailSessionName or getJNDI == MailJndi):
print "Match found .. deleting " + mailSessionName
AdminConfig.remove(mail)
break

path = "/Cell:" + cellName
path += "/Node:" + nodeName + "/Server:" + serverName + "/"
server = AdminConfig.getid(path)
newmp = AdminConfig.getid(path+'MailProvider:Built-in Mail Provider/')
name = ["name", mailSessionName]
jndi = ["jndiName", MailJndi]
mailTransportHost = ["mailTransportHost", "mail.somewhere.com"]
msAttrs = [name, jndi, mailTransportHost]
AdminConfig.create("MailSession", newmp, msAttrs)

AdminConfig.save()

print "Creation complete for Mail Session " + mailSessionName

{code}

infyniti

unread,
Oct 26, 2009, 12:26:22 PM10/26/09
to
The problem is not with the script. Check the host and port number if they are correct.

Strive

unread,
Oct 26, 2009, 12:43:05 PM10/26/09
to
To send mail you need to open default port# 25. its not open at your m/c.

Thanks,

0 new messages