How to encrypt the password of the email account use for scheduling in Jasper Reports?

book

Article ID: 125622

calendar_today

Updated On:

Products

SUPPORT AUTOMATION- SERVER CA Service Desk Manager - Unified Self Service KNOWLEDGE TOOLS CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction



How to encrypt the password of the email account use for scheduling in Jasper Reports?

Environment

Jasper Reports 6.2.0 or above

Resolution

Follow these steps to enable quartz.mail.sender.password encryption:

Navigate to Jasper installation directory inside \buildomatic\sample_conf folder and rename the appropriate file in accordance with your database to default_master.properties.
For example, rename the sqlserver_master.properties file to default_master.properties if you are using Microsoft SQL Server as your database.
In the file search for the scheduler properties they should be commented

# quartz.mail.sender.host=mail.example.com
# quartz.mail.sender.port=25
# quartz.mail.sender.protocol=smtp
# quartz.mail.sender.username=admin
# quartz.mail.sender.password=password
# [email protected]
# quartz.web.deployment.uri=http://localhost:8080/jasperserver-pro

Uncomment them and set the correct values including the password in plain text

Then look for the Encryption settings lines bellow

# encrypt=true
# build.key.algo=AES
# build.key.size=128
# enc.transformation=AES/CBC/PKCS5Padding
# enc.block.size=16
# propsToEncrypt=dbPassword

Also uncomment them and change only the following line
From
propsToEncrypt=dbPassword
to
propsToEncrypt=quartz.mail.sender.password

Once this is complete save the file in ..\CA Business Intelligence\buildomatic

Open a command prompt in the same location of the file and ran the command bellow:

js-ant.bat gen-config

This command updates generates the encrypted password and updates the password property in the default_master.properties

The result of the command should be BUILD SUCCESSFUL

Check the file default_master.properties and you will notice that the password is now encrypted, similar to

ENC-5600b0623a09d558048be1aabe07dfa8758794312d0cbbdfec6a4488df687d73-

Copy the password to the ..\CA Business Intelligence\apache-tomcat\webapps\jasperserver-pro\WEB-INF\js.quartz.propertiesĀ in the field report.scheduler.mail.sender.password=

Restart the CABI service and test a scheduled report.