You can use scripting and the wsadmin tool to configure new mail sessions.
Using Jacl:
set newmp [$AdminConfig getid /Cell:mycell/Node:mynode/MailProvider:MP1/]
newmp = AdminConfig.getid('/Cell:mycell/Node:mynode/MailProvider:MP1/') print newmp
MP1(cells/mycell/nodes/mynode|resources.xml#MailProvider_1)
Using Jacl:
$AdminConfig required MailSession
print AdminConfig.required('MailSession')
Attribute Type name String jndiName String
Using Jacl:
set name [list name MS1] set jndi [list jndiName mail/MS1] set msAttrs [list $name $jndi]
{name MS1} {jndiName mail/MS1}
name = ['name', 'MS1'] jndi = ['jndiName', 'mail/MS1'] msAttrs = [name, jndi] print msAttrs
[[name, MS1], [jndiName, mail/MS1]]
Using Jacl:
$AdminConfig create MailSession $newmp $msAttrs
print AdminConfig.create('MailSession', newmp, msAttrs)
MS1(cells/mycell/nodes/mynode|resources.xml#MailSession_1)
#Mail Provider set node [$AdminConfig getid /Node:Node_Name/] set name [list name MP1] set mpAttrs [list $name] set newmp [$AdminConfig create MailProvider $node $mpAttrs] $AdminConfig save # Get the available ProtocolProvider from existing list wsadmin>$AdminConfig list ProtocolProvider (cells/cell_name/clusters/TestCluster|resources.xml#builtin_imap) (cells/cell_name/clusters/TestCluster|resources.xml#builtin_pop3) (cells/cell_name/clusters/TestCluster|resources.xml#builtin_smtp) (cells/cell_name/nodes/CellManager01|resources.xml#builtin_imap) (cells/cell_name/nodes/CellManager01|resources.xml#builtin_pop3) (cells/cell_name/nodes/CellManager01|resources.xml#builtin_smtp) (cells/cell_name/nodes/Node_Name/servers/TestClusterMem1|resources.x ml#builtin_imap) (cells/cell_name/nodes/Node_Name/servers/TestClusterMem1|resources.x ml#builtin_pop3) (cells/cell_name/nodes/Node_Name/servers/TestClusterMem1|resources.x ml#builtin_smtp) (cells/cell_name/nodes/Node_Name/servers/TestClusterMember2|resource s.xml#builtin_imap) (cells/cell_name/nodes/Node_Name/servers/TestClusterMember2|resource s.xml#builtin_pop3) (cells/cell_name/nodes/Node_Name/servers/TestClusterMember2|resource s.xml#builtin_smtp) (cells/cell_name/nodes/Node_Name/servers/server1|resources.xml#built in_imap) (cells/cell_name/nodes/Node_Name/servers/server1|resources.xml#built in_pop3) (cells/cell_name/nodes/Node_Name/servers/server1|resources.xml#built in_smtp) (cells/cell_name/nodes/Node_Name/servers/test|resources.xml#builtin_imap) (cells/cell_name/nodes/Node_Name/servers/test|resources.xml#builtin_pop3) (cells/cell_name/nodes/Node_Name/servers/test|resources.xml#builtin_smtp) (cells/cell_name/nodes/Node_Name|resources.xml#builtin_imap) (cells/cell_name/nodes/Node_Name|resources.xml#builtin_pop3) (cells/cell_name/nodes/Node_Name|resources.xml#builtin_smtp) (cells/cell_name|resources.xml#builtin_imap) (cells/cell_name|resources.xml#builtin_pop3) (cells/cell_name|resources.xml#builtin_smtp) *** # From above we need to select the particular ones that we are interested in using. # Since you are trying to use create Node level , here I select the node scoped protocols # You need count the numbers from 0 to get the lindex ## # #Selecting NodeScopePop3 from above # wsadmin>set NodeScopePop3 [lindex [$AdminConfig list ProtocolProvider] 19] (cells/cell_name/nodes/Node_Name|resources.xml#builtin_pop3) # #Selecting NodeScopeSmtp from above # wsadmin>set NodeScopeSmtp [lindex [$AdminConfig list ProtocolProvider] 20] (cells/cell_name/nodes/Node_Name|resources.xml#builtin_smtp) ## # #Creating Mail Session using above ProtocolProvider # set name [list name MS1] set jndi [list jndiName mail/MS1] set mailTransportHost [list mailTransportHost server_A.ibm.com] set mailStoreProtocol [list mailStoreProtocol $NodeScopePop3] set mailTransportProtocol [list mailTransportProtocol $NodeScopeSmtp] set msAttrs [list $name $jndi $mailTransportHost $mailStoreProtocol $mailTransportProtocol] $AdminConfig create MailSession $newmp $msAttrs $AdminConfig save
C:\websphere\ND\profiles\Dmgr01\bin>wsadmin -lang jython WASX7209I: Connected to process "dmgr" on node CellManager01 using SOAP connector; The type of p rocess is: DeploymentManager WASX7031I: For help, enter: "print Help.help()" wsadmin>cell_name="cell_name" wsadmin>MailProviderName="Built-in Mail Provider" # Getting Config ID of Known Mail Provider wsadmin>MailProviderID = AdminConfig.getid('/Cell:'+cell_name+'/MailProvider:'+MailProvid erName+ /') wsadmin>print MailProviderID "Built-in Mail Provider(cells/cell_name|resources.xml#builtin_mailprovider)" # Listing All protocols in Known MailProvider wsadmin> wsadmin>ProtocolProviderList = AdminConfig.list('ProtocolProvider',MailProviderID) wsadmin> wsadmin>print ProtocolProviderList (cells/cell_name|resources.xml#builtin_imap) (cells/cell_name|resources.xml#builtin_pop3) (cells/cell_name|resources.xml#builtin_smtp) # Storing ProtocolProviderList in array wsadmin> wsadmin>arrayProviderList = ProtocolProviderList.split(lineSeparator) wsadmin> # Getting one from array # wsadmin>print arrayProviderList[0] (cells/cell_name|resources.xml#builtin_imap) wsadmin> wsadmin>print arrayProviderList[1] (cells/cell_name|resources.xml#builtin_pop3) wsadmin> wsadmin>print arrayProviderList[2] (cells/cell_name|resources.xml#builtin_smtp) wsadmin> FYI: Either you can print like above or you can save the value in a variable for any further process like following arrayProviderList = ProtocolProviderList.split(lineSeparator) First = arrayProviderList[0] Second = arrayProviderList[1] Third = arrayProviderList[2] . For a customer using a jacl script, here is the way to do this. #Mail Provider set node [$AdminConfig getid /Node:Node_Name/] set name [list name MP1] set mpAttrs [list $name] set newmp [$AdminConfig create MailProvider $node $mpAttrs] $AdminConfig save # Get the available ProtocolProvider from existing list wsadmin>$AdminConfig list ProtocolProvider (cells/cell_name/clusters/TestCluster|resources.xml#builtin_imap ) (cells/cell_name/clusters/TestCluster|resources.xml#builtin_pop3 ) (cells/cell_name/clusters/TestCluster|resources.xml#builtin_smtp ) (cells/cell_name/nodes/CellManager01|resources.xml#builtin_imap) (cells/cell_name/nodes/CellManager01|resources.xml#builtin_pop3) (cells/cell_name/nodes/CellManager01|resources.xml#builtin_smtp) (cells/cell_name/nodes/Node_Name/servers/TestClusterMem1|resources .xml#builtin_imap) (cells/cell_name/nodes/Node_Name/servers/TestClusterMem1|resources .xml#builtin_pop3) (cells/cell_name/nodes/Node_Name/servers/TestClusterMem1|resources .xml#builtin_smtp) (cells/cell_name/nodes/Node_Name/servers/TestClusterMember2|resources .xml#builtin_imap) (cells/cell_name/nodes/Node_Name/servers/TestClusterMember2|resources .xml#builtin_pop3) (cells/cell_name/nodes/Node_Name/servers/TestClusterMember2|resources .xml#builtin_smtp) (cells/cell_name/nodes/Node_Name/servers/server1|resources .xml#builtin_imap) (cells/cell_name/nodes/Node_Name/servers/server1|resources .xml#builtin_pop3) (cells/cell_name/nodes/Node_Name/servers/server1|resources .xml#builtin_smtp) (cells/cell_name/nodes/Node_Name/servers/test|resources .xml#builtin_imap) (cells/cell_name/nodes/Node_Name/servers/test|resources .xml#builtin_pop3) (cells/cell_name/nodes/Node_Name/servers/test|resources .xml#builtin_smtp) (cells/cell_name/nodes/Node_Name|resources.xml#builtin_imap) (cells/cell_name/nodes/Node_Name|resources.xml#builtin_pop3) (cells/cell_name/nodes/Node_Name|resources.xml#builtin_smtp) (cells/cell_name|resources.xml#builtin_imap) (cells/cell_name|resources.xml#builtin_pop3) (cells/cell_name|resources.xml#builtin_smtp) *** # From above we need to select the particular ones that we are interested in using. # Since you are trying to use create Node level , here I select the node scoped protocols # You need count the numbers from 0 to get the lindex ## # #Selecting NodeScopePop3 from above # wsadmin>set NodeScopePop3 [lindex [$AdminConfig list ProtocolProvider] 19] (cells/cell_name/nodes/Node_Name|resources.xml#builtin_pop3) # #Selecting NodeScopeSmtp from above # wsadmin>set NodeScopeSmtp [lindex [$AdminConfig list ProtocolProvider] 20] (cells/cell_name/nodes/Node_Name|resources.xml#builtin_smtp) ## # #Creating Mail Session using above ProtocolProvider # set name [list name MS1] set jndi [list jndiName mail/MS1] set mailTransportHost [list mailTransportHost Server_A.ibm.com] set mailStoreProtocol [list mailStoreProtocol $NodeScopePop3] set mailTransportProtocol [list mailTransportProtocol $NodeScopeSmtp] set msAttrs [list $name $jndi $mailTransportHost $mailStoreProtocol $mailTransportProtocol] $AdminConfig create MailSession $newmp $msAttrs $AdminConfig save
In this information ...Related tasks
Related reference
| IBM Redbooks, demos, education, and more(Index) Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience. This feature requires Internet access. Most of the following links will take you to information that is not part of the formal product documentation and is provided "as is." Some of these links go to non-IBM Web sites and are provided for your convenience only and do not in any manner serve as an endorsement by IBM of those Web sites, the material thereon, or the owner thereof. |