Postfix disclaimers - JRE installation - JAVA_HOME

MSH Disclaimer & Signatures is a milter which integrate with most popular mail servers, like Postfix 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:

JAVA_HOME=/usr/lib/jvm/jreXXX

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

To check if JAVA_HOME variable is set, run command:

echo $JAVA_HOME

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

To learn more visit MSH Disclaimer & Signatures website.

Lukasz is a software developer and owner of MSH Software company which builds email processing tools for Microsoft Exchange, Zimbra Collaboration Suite and Postfix. He specializes in server, desktop and web applications written in Java, .NET and C++.