Template:Email Settings

From Commander4j

email.xml

<?xml version="1.0" encoding="UTF-8"?>
<emailSettings>    
    
    <configuration>
        <property name="mail.smtp.auth" value="true"/>
        <property name="mail.smtp.starttls.enable" value="true"/>
        <property name="mail.smtp.host" value="smtp.live.com"/>
        <property name="mail.smtp.socketFactory.port" value="25"/>
        <property name="mail.smtp.user" value="email@outlook.com"/>
        <property name="mail.smtp.password" value="password"/>
        <property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory"/>
        <property name="mail.smtp.auth" value="true"/>
        <property name="mail.smtp.port" value="25"/>
        <property name="mail.smtp.from" value="email@outlook.com"/>
        <property name="mail.debug" value="true"/>
    </configuration>

    <distributionList id="Monitor" enabled="Y" maxFrequencyMins="0">
        <toAddressList>example@email.com</toAddressList>
    </distributionList>

</emailSettings>

Encrypted settings

You can encrypt the settings held in the xml files above using a utility included.

Lets say you want to encrypt the password used for SFTP.

Open a command prompt and type the following

EncryptData

The program will load and prompt you for the string that you want to encrypt.

Password Utility
Input data to encrypt :mysensitivepassword

The program will respond

Encrypted password saved to password.txt

You can then edit/view the contents of the password.txt file and amend the settings in the xml as follows

<value id="password" encrypted="no">mysensitivepassword</value>
<value id="password" encrypted="yes">ElxoCavGZP+i11w3+UhVqqggiJDPPAzxd7s+X2ZddxA=</value>

IMPORTANT - you need to amend the encrypted="no" setting and change it to encrypted="yes" so that the application knows.