Configuring mail
The application sometimes sends emails to users, for example when the users have been subscribed to a document or folder.
Change mail configuration
Section titled “Change mail configuration”Get your mail account data (the same as you would use to configure a standard mail client, like Outlook or Thunderbird).
Edit the file $TOMCAT_HOME/openkm.properties:
vim /home/openkm/tomcat-8.5.69/openkm.propertiesAfter editing, the openkm.properties file should look something like this:
spring.mail.host=localhostspring.mail.port=25spring.mail.username=spring.mail.password=spring.mail.from=noreply@openkm.comspring.mail.properties.mail.smtp.auth=falsespring.mail.properties.mail.smtp.starttls.enable=falseGmail example
Section titled “Gmail example”spring.mail.host=smtp.gmail.comspring.mail.port=587spring.mail.username=<username>spring.mail.password=<password>spring.mail.properties.mail.smtp.auth=truespring.mail.properties.mail.smtp.starttls.enable=truespring.mail.properties.mail.smtp.ssl.trust=smtp.gmail.comspring.mail.properties.mail.debug=trueOffice 365
Section titled “Office 365”spring.mail.host=smtp.office365.comspring.mail.username=<username>spring.mail.password=<password>spring.mail.properties.mail.smtp.auth=truespring.mail.properties.mail.smtp.starttls.enable=truespring.mail.properties.mail.smtp.ssl.trust=smtp.office365.comspring.mail.properties.mail.debug=trueEmail server with old SSL configuration
Section titled “Email server with old SSL configuration”spring.mail.host=mail.myserver.comspring.mail.port=465spring.mail.username=<username>spring.mail.password=<password>spring.mail.properties.mail.smtp.auth=truespring.mail.properties.mail.smtp.ssl.enable=truespring.mail.properties.mail.debug=trueAdditional information
Section titled “Additional information”Testing configuration
Section titled “Testing configuration”Sometimes configuring mail can be complex and error-prone because there are many configuration parameters and many different mail servers. To ease this configuration, we have developed a utility called OKMMailChecker which helps you to test the mail configuration without the need to restart OpenKM, which takes time and makes it unavailable for users during these tests.
This utility can be downloaded from https://download.openkm.com and should be placed in the OpenKM directory where the openkm.properties file is located. Indeed, this utility will read the mail configuration from this file. This utility has several parameters which will be used to send the test mail:
- -f, –from: From used to send the test mail (required)
- -t, –to: To used to send the test mail (required)
- -a, –attachment: An optional file to be sent as an attachment
You can execute the utility this way:
$ java -jar OKMMailChecker.jar -f origin@openkm.com -t destination@openkm.com -a SampleFile.txt