Mail server connection is originally configured in the file win32.config
(or unix.config
in Linux installations) with the property mail.configuration. If these settings need to be changed after installation, it is best to do the changes both to the win32.config
and the context.xml
file that is found in the application/config/tomcat
directory. If setup script is run again after installation, the values from win32.config
will override the mail settings in context.xml
and running update scripts will copy the context.xml
file from the config directory to the actual installation where the application server is running.
The following table explains the different mail settings:
Property Name | Description |
---|---|
| The return email address of the current user. |
| The default user name to use when connecting to the mail server. |
| Password for the SMTP server, if required. |
| The address of the SMTP server to be used. |
| The port of the SMTP server to be used. Defaults to 25. |
| If true, attempts to authenticate the user using the AUTH command. Defaults to false. |
| If true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Defaults to false. |
Here is an example of how the mail configuration in win32.config
could look like:
mail.configuration=mail.smtp.host\="localhost" mail.from\="eidm2@@localhost" mail.user\=""
Notice that in win32.config
file @ character needs to be escaped with another @ character and = character with a \. These escapes are not needed when editing the context.xml
file.
When encrypted communication is needed, use the mail.smtp.starttls.enable
with value true. Here is an example of win32.config
when connecting with encryption:
mail.configuration=mail.smtp.host\="localhost" mail.smtp.port\="465" mail.from\="eidm2@@localhost" mail.user\="user" mail.password\="XXXXXXXX" mail.smtp.auth\="true" mail.smtp.starttls.enable\="true"
The issuer of the mail server SSL certificate must be trusted by the java environment by adding it to the java truststore.
Adding Mail Server Certificate to Java Truststore
The usage of SSL is required when making the SMTP connection from CustomerID to a secure mail server. You must add the certificate of the issuer to the CustomerID trust store.
In Windows the Java certificate storage is by default in the following file:
%JRE_HOME%\lib\security\cacerts
The SMTP server issuer certificate can be added to the Java certificate store using the keytool
command. Here are example commands for Windows and Linux installations:
cd %JRE_HOME%\lib\security set keytool="%JRE_HOME%\bin\keytool" %keytool% -importcert -keystore cacerts -trustcacerts -alias <any alias e.g. mailserverca> -file <insert issuer certificate filename here> -storepass changeit
cd $JRE_HOME/lib/security keytool -importcert -keystore cacerts -trustcacerts -alias <any alias e.g. mailserverca> -file <insert issuer certificate filename here> -storepass changeit
Check the validity time of the issuer certificate and record in your system maintenance calendar a task to check this well before it expires and ensure it is updated as required.