Running two (or more) instances of ze-filter in the same machine

You may need this if, e.g., you're running two instances of sendmail in the same machine and filtering options of the two MTA aren't the same, or if you're running sendmail on different machines, but you want to place filters on a single machine. It's possible to do this if you follow the two rules bellow :

Only resources opened in Read Only mode can be shared.

  • Launching ze-filter : you can launch ze-filter this way, in order to use one configuration file per instance :
/usr/sbin/ze-filter -c /etc/ze-filter-1/ze-filter.cf
/usr/sbin/ze-filter -c /etc/ze-filter-2/ze-filter.cf
  • As long as all files inside configuration file are opened in read-only mode, you can put everything in the same directory, if you want to share some configuration/data files. It may be interesting to share huge data files such as ze-urlbl.db or ze-bayes.db.
  • Location of all other resources needed by ze-filter can (and should) be defined at ze-filter.cf configuration file.
  • CONFDIR (defaults to /etc/ze-filter) can be shared, but you should take care of which configuration files are exclusive and define them at main configuration file.
  • WORKDIR (defaults to /var/ze-filter) can't be shared and should have different values in each main configuration file.
  • SPOOLDIR (defaults to /var/spool/ze-filter) can't be shared and should have different values in each main configuration file.
  • SOCKET - listening socket used to communicate with sendmail, can't be shared.
  • CTRL_SOCKET - listening socket used to receive commands, can't be shared.
  • PID_FILE - file where ze-filter PID file is saved, can't be shared.
  • LOG_FACILITY (defaults to local5) can be shared, but it's better to have each instance using a different syslog facility.
  • /etc/default/ze-filter - default environnement variables - this is an optional file. This file can be shared if all environnement variables are the same for all instances.
  • /etc/init.d/ze-filter - start-up script can be shared, in theory, but it's easier to use one start-up script for each instance.
If you're running, in the same machine, more than one sendmail instance, each one have to listen on a different pair IP address/port, and must use different configuration files (sendmail.cf) to be able to attach the right filter.
doc/howto/multiple_instances.txt · Last modified: 2018/02/09 16:53 by 127.0.0.1
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0