Configure new mail sessions using scripting

 

Procedure

  1. Start wsadmin

  2. Identify the parent ID:

    • Jacl:

      set newmp [$AdminConfig getid /Cell:mycell/Node:mynode/MailProvider:MP1/]
      

    • Jython

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

    Example output:

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

  3. Get required attributes:

    • Jacl:

      $AdminConfig required MailSession
      

    • Jython

      print AdminConfig.required('MailSession')
      

    Example output:

    Attribute       Type
    name           String
    jndiName       String
    

  4. Set up required attributes:

    • Jacl:

      set name [list name MS1]
      set jndi [list jndiName mail/MS1]
      set msAttrs [list $name $jndi]
      

      Example output:

      {name MS1} {jndiName mail/MS1}
      

    • Jython

      name = ['name', 'MS1']
      jndi = ['jndiName', 'mail/MS1']
      msAttrs = [name, jndi]
      print msAttrs
      

      Example output:

      [[name, MS1], [jndiName, mail/MS1]]
      

  5. Create the mail session:

    • Jacl:

      $AdminConfig create MailSession $newmp $msAttrs
      $AdminConfig save
      

    • Jython

      print AdminConfig.create('MailSession', newmp, msAttrs)
      

    Example output:

    MS1(cells/mycell/nodes/mynode|resources.xml#MailSession_1)
    

  6. In a network deployment environment only, synchronize the node.


 

See Also


AdminConfig object for scripted administration

 

See Also


Commands for the AdminConfig object