WAS v8.5 > Script the application serving environment (wsadmin) > Scripting for Mail, URLs, and other Java EE resources > Configure mail, URLs, and resource environment entries with wsadmin scripting

Configure new mail providers using wsadmin.sh

We can use scripting and wsadmin to configure new mail providers.

Before starting this task, wsadmin must be running. See the topic Starting the wsadmin scripting client article for more information. Configure a new mail provider:

  1. Identify the parent ID:

    • Jacl:

        set node [$AdminConfig getid /Cell:mycell/Node:mynode/]
    • Jython:

      node = AdminConfig.getid('/Cell:mycell/Node:mynode/')
      print node 

    Example output:

      mynode(cells/mycell/nodes/mynode|node.xml#Node_1)
  2. Get required attributes:

    • Jacl:

        $AdminConfig required MailProvider
    • Jython:

        print AdminConfig.required('MailProvider')

    Example output:

    Attribute       Type
    name       String

  3. Set up required attributes:

    • Jacl:

      set name [list name MP1]
      set mpAttrs [list $name]
    • Jython:

      name = ['name', 'MP1']
      mpAttrs = [name]

  4. Create the mail provider:

    • Jacl:

        set newmp [$AdminConfig create MailProvider $node $mpAttrs]
    • Jython:

      newmp = AdminConfig.create('MailProvider', node, mpAttrs)
      print newmp

    Example output:

      MP1(cells/mycell/nodes/mynode|resources.xml#MailProvider_1)

  5. Save the configuration changes. See the topic Saving configuration changes with wsadmin for more information.


Related


Use the wsadmin scripting AdminConfig object for scripted administration
Save configuration changes with wsadmin
Start the wsadmin scripting client using wsadmin.sh


Reference:

Commands for the AdminConfig object using wsadmin.sh


+

Search Tips   |   Advanced Search