For sending e-mail messages from Testlab, I want to change the server host, server port, or sender. How's that done?


When you do the initial install with the scripts provided, you have an option to define the SMTP host, SMTP port, and the sender (from address) for the e-mail messages sent by the Testlab application. These values will be stored in the configuration of the Payara application server.


To change these values at a later stage, you should modify the so-called JavaMail resource configuration Payara. You can use Payara's (Glassfish's) asadmin -command to do this.


To list existing JavaMail resource from the server, you can run the following command:


# cd [YOUR Payara server root here]/glassfish/bin
# ./asadmin list-javamail-resources
mail/TestLabMail
Command list-javamail-resources executed successfully.


If you have set up the server with the installation scripts, by default, you should have a javamail-resource named "mail/TestLabMail" present.


To update this JavaMail resource with new values, you can run the following commands:


First, delete the existing configuration:


# ./asadmin delete-javamail-resource mail/TestLabMail
Mail resource mail/TestLabMail deleted.
Command delete-javamail-resource executed successfully.


Second, re-create the resource with new values (all values on a single line):


# ./asadmin create-javamail-resource --mailhost "your.smtp.server.host" --mailuser testlab --fromaddress "something@your.mail.domain" --property mail.smtp.port=25  mail/TestLabMail
Mail Resource mail/TestLabMail created.
Command create-javamail-resource executed successfully.

Note: Make sure the resource name is exactly "mail/TestLabMail" (make sure the upper and lower characters match).