Tuesday, June 17, 2014

Postfix Disclaimers – JRE installation – JAVA_HOME

MSH Disclaimer & Signatures is a milter which integrate with most popular mail servers, like Postfix, Sendmail and Zimbra. It's a first class disclaimer solution. Application is using JRE environment, so before installing program you need to configure Java and JAVA_HOME variable.

Download and install Java on Linux server

Go to Oracle website and download newest JRE installation setup which suite your Linux distribution.

Note: To install Java in system-wide location you must login as the root user.

Extract JRE package:

tar zxvf jre-XXX-linux-YYY.tar.gz

Move unpacked JRE directory to /usr/lib/jvm/:

mv jreXXX /usr/lib/jvm/

You can delete .tar.gz file if you want to save disk space. It's not needed anymore.

Configure JAVA_HOME environment variable

To properly install MSH Disclaimer & Signatures application JAVA_HOME environment variable needs to be correctly set.

If you want to set JAVA_HOME only to current session you could invoke:

export JAVA_HOME=/usr/lib/jvm/jreXXX

But it will not persist if you reboot system.

To make available JAVA_HOME after reboot you need to set variable in .bash_profile file, it's located in each user directory. Create it if not exists. For system-wide and all users modify /etc/environment file,  thanks to it you'll not need to modify each user.

Add this definition to /etc/environment or .bash_profile file:


Note: XXX variable in jreXXX means your JRE version, ie. Jre1.9.0_4

To check if JAVA_HOME variable is set, run command:


You should output earlier defined path to JRE.

Installation disclaimers and signatures

Now when Java is installed and set-up, you can run application install script.

./msh-ds-milter --install

Find out more about MSH Disclaimer & Signatures...