CentOS/RHEL 9
Before proceeding, ensure that Java is installed and configured on your system. See the Java installation guide for instructions.
Download the server module package by following the Download instructions.
Commands
Here are the commands needed to install and start the application services. They can be invoked one by one in the terminal. If you would like to have description of each command, please refer to the Description section below.
tar zxvf msh-pm-milter-<VERSION>.tgz
sudo mv msh-pm-milter /opt
sudo useradd --system --no-create-home --shell /usr/sbin/nologin --home /opt/msh-pm-milter msh
sudo bash /opt/msh-pm-milter/lib/fixperms.sh
sudo systemctl link /opt/msh-pm-milter/lib/msh-pm-milter.service
sudo systemctl link /opt/msh-pm-milter/lib/msh-pm-settings.service
sudo systemctl daemon-reload
sudo systemctl enable msh-pm-settings.service
sudo systemctl enable msh-pm-milter.service
sudo systemctl start msh-pm-settings.service
sudo systemctl start msh-pm-milter.service
Description
Extract the contents of msh-pm-milter-<VERSION>.tgz package.
tar zxvf msh-pm-milter-<VERSION>.tgz
Move msh-pm-milter directory to the /opt system directory.
sudo mv msh-pm-milter /opt
Add msh system user.
- --system - creates a system account (no password, no interactive login)
- --no-create-home - won’t auto-create /home/msh, since we want /opt/msh-pm-milter
- --shell /usr/sbin/nologin - prevents login
- --home /opt/msh-pm-milter - sets /opt/msh-pm-milter as its "home"
- msh - username.
sudo useradd --system --no-create-home --shell /usr/sbin/nologin --home /opt/msh-pm-milter msh
Run fixperms.sh script which secures the application installation by:
- Ensuring proper ownership (msh user/group)
- Restricting directory access (750)
- Restricting file access (640, making them non-executable by default)
- Explicitly making only the necessary scripts executable (750)
sudo bash /opt/msh-pm-milter/lib/fixperms.sh
Create a symbolic link for msh-pm-milter.service and msh-pm-settings.service unit files, allowing the system to recognize and manage the services.
sudo systemctl link /opt/msh-pm-milter/lib/msh-pm-milter.service
sudo systemctl link /opt/msh-pm-milter/lib/msh-pm-settings.service
If SELinux is enforcing (default on RHEL/CentOS 9), the service files may not have the correct SELinux context and systemd may refuse to load them. Run the following commands to restore the correct context:
sudo restorecon -v /opt/msh-pm-milter/lib/msh-pm-milter.service
sudo restorecon -v /opt/msh-pm-milter/lib/msh-pm-settings.service
sudo chcon -t bin_t /opt/msh-pm-milter/bin/msh-pm-milter
sudo chcon -t bin_t /opt/msh-pm-milter/bin/msh-pm-settings
Reload systemd to apply changes from newly linked service files.
sudo systemctl daemon-reload
Enable services to start automatically on system boot.
sudo systemctl enable msh-pm-settings.service
sudo systemctl enable msh-pm-milter.service
Manually start services for immediate activation.
sudo systemctl start msh-pm-settings.service
sudo systemctl start msh-pm-milter.service
Verify
Check the current status of services to verify they're running correctly (press q to exit).
systemctl status msh-pm-settings.service
systemctl status msh-pm-milter.service
Example of running msh-pm-milter service.
● msh-pm-milter.service - MSH Postfix Milter (milter)
Loaded: loaded (/etc/systemd/system/msh-pm-milter.service; enabled; preset: enabled)
Active: active (running) since Thu 2025-10-16 13:37:49 CDT; 1min 20s ago
Invocation: ce2053dc217d4c2b96be25f96ffa2aea
Main PID: 2604 (msh-pm-milter)
Tasks: 14 (limit: 9302)
Memory: 87.2M (peak: 87.5M)
CPU: 1.845s
CGroup: /system.slice/msh-pm-milter.service
├─2604 /bin/bash /opt/msh-pm-milter/bin/msh-pm-milter
└─2642 /usr/bin/java -Xms128M -Xmx1024M -Dfile.encoding=UTF8 -jar /opt/msh-pm-milter/bin/jar/msh-pm-milter.jar -installdir=/op>
What's next
- Postfix configuration - Configure your Postfix to communicate with the application
- Troubleshooting starting services - Check diagnostic steps to find out why services don't run