title: Please help configure JBoss 7 “mail-session” via jboss-cli
body: <p>I need to create smtp Mail connector via <code>jboss-cli</code> command line. So far I've managed to create <code>&lt;mail-session&gt;</code> and <code>&lt;smtp-server&gt;</code> nodes in configuration xml:</p>
  
  <pre><code>/subsystem=mail/mail-session="java:/mail/myMail":add(jndi-name="java:/mail/myMail", from="noreply@acme.com")
  /subsystem=mail/mail-session="java:/mail/myMail"/server=smtp:add
  </code></pre>
  
  <p>All the above resulted in the following part in configuration file:</p>
  
  <pre><code>&lt;!-- default JBoss session with auth data --&gt;
  &lt;mail-session jndi-name="java:jboss/mail/Default"&gt;
    &lt;smtp-server ssl="true" outbound-socket-binding-ref="mail-smtp"&gt;
      &lt;login name="user" password="pass"/&gt;
    &lt;/smtp-server&gt;
  &lt;/mail-session&gt;
  &lt;!-- Created mail session --&gt;
  &lt;mail-session jndi-name="java:/mail/myMail" from="noreply@acme.com"&gt;
    &lt;smtp-server outbound-socket-binding-ref="mail-smtp"&gt;
       &lt;!-- no login node --&gt;
    &lt;/smtp-server&gt;
  &lt;/mail-session&gt;
  </code></pre>
  
  <p>After playing with GUI Admin console I found that <code>&lt;smtp-server&gt;</code> node should contain <code>&lt;login name="login" password="pass"&gt;</code> child node, but I have no idea how to do it, JBoss Admin guide has no clues on the subject. If anyone can help with this I would really appreciate it.</p>