0

I have some troubles adding a default sender to my mail subsystem in JBoss EAP 7.1.0. I'm a noob with the JBoss cli ;)

Here is my current standalone.xml:

<subsystem xmlns="urn:jboss:domain:mail:3.0">
  <mail-session name="java:jboss/mail/Default" jndi-name="java:jboss/mail/Default">
    <smtp-server outbound-socket-binding-ref="mail-smtp"/>
  </mail-session>
</subsystem>

What i want (i figured out, that the property I need is call mail.smtp.from)

<subsystem xmlns="urn:jboss:domain:mail:3.0">
  <mail-session name="java:jboss/mail/Default" jndi-name="java:jboss/mail/Default">
    <smtp-server outbound-socket-binding-ref="mail-smtp">
       <property name="mail.smtp.from" value="test@test.de"/>
    </smtp-server>
  </mail-session>
</subsystem>

I tried a lot with autocompletion in the JBoss CLI, but no success. My current try is:

/subsystem=mail/mail-session=java\:jboss\/mail\/Default/smtp-server/property=mail.smtp.from:write-attribute(name=value, value=test@test.de)

This leads to "Node path format is wrong around 'smtp-server'. Hope someone can help. Thanks in advance!

Aaron
  • 24,009
  • 2
  • 33
  • 57
sasbob
  • 40
  • 7

1 Answers1

1

I believe what you need is the following, with the from attribute held by the mail-session object :

<subsystem xmlns="urn:jboss:domain:mail:3.0">
  <mail-session name="java:jboss/mail/Default" jndi-name="java:jboss/mail/Default" from="test@test.de">
    <smtp-server outbound-socket-binding-ref="mail-smtp"/>
  </mail-session>
</subsystem>

Which you can obtain from your current configuration by running the following CLI command :

/subsystem=mail/mail-session=java\:jboss\/mail\/Default:write-attribute(name=from, value=test@test.de)
Aaron
  • 24,009
  • 2
  • 33
  • 57
  • { "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } } Thanks a lot! – sasbob Jan 08 '20 at 14:49
  • @sasbob You're welcome ! You've tried the mail session though? I'm not 100% positive that the `from` attribute of the `mail-session` will effectively impact the value of the `mail.smtp.from` property, even though it sounds like it should – Aaron Jan 08 '20 at 14:50
  • Only checked my standalone.xml yet, but let's hope the best ;) – sasbob Jan 08 '20 at 14:54