Priority email gateway

De Trustedbird Client Wiki
Révision de 8 septembre 2010 à 12:35 par Rfairise (discussion | contributions)

(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
English | Français

> Documentation > Priority email gateway

Download priority-email-gateway


Priority email gateway is a configuration system for an email gateway sending messages based on their priority.

Priorities are assigned from message headers. Several different priorities can be assigned to a message, for primary recipients (To) and for copy recipients (Cc and Bcc).

A set of rules identifies headers and chooses priorities to assign.

The system is based on Postfix MTA with Qpsmtpd SMTP server. It works on Debian-based Linux distributions (tested with Debian Etch with backports, Debian Lenny and Ubuntu 8.04).

→ Translation in progress: see French documentation for more detailed information.






Message path




The system is intended to be installed on Debian-based Linux distributions, e.g.:

  • Debian Etch (4.0) or Lenny (5.0),
  • Ubuntu server (8.4).

Postfix version should be at least 2.5 in order to have better concurrency scheduler.

For Debian Etch, Postfix should be installed from repository etch‑backports.

Installation of Postfix and Qpsmtpd

First step consists of installing Postfix, Qpsmtpd and SNMP agent.

# apt-get install postfix qpsmtpd snmpd

SNMP agent is used for supervision and is optional.

Installer could want to remove another mail server already installed to replace it with Postfix.

Choose Internet site option in order to generate a default configuration.

Default Postfix settings in /etc/postfix will be used to generate other configurations for all Postfix instances. It will be used only for initial creation of configurations.

It can now be customized with options which will be common to all instances.

Useful settings to be changed in /etc/postfix/ are, for example, myhostname which is used to specify the name of the server. Authentication and listen ports must not be setup now because they are different in every instances.

Installation of priority system

Priority system packet contains a tool to generate settings for all Postfix instances and Qpsmtpd, scripts for supervision and also startup scripts.

Download Debian package, then launch installation with the following command:

# dpkg -i priority-email-gateway_VERSION.deb

Packet will install the system and create, from default configuration in /etc/postfix, settings for all Postfix instances in /etc/postfix‑frontend, /etc/postfix0, /etc/postfix1, /etc/postfix2, ...

Qpsmtpd and Postfix instances will be started at the end.


File list

  • /etc/priority-email-gateway.conf: count and settings of priority instances.
  • /etc/postfix: base Postfix settings used only during installation in order to generate other configurations.
  • /etc/postfix-frontend: settings of frontend Postfix instance.
  • /etc/postfix0, /etc/postfix1, ...: settings of Postfix instances managing different priorities.

Postfix main configuration files are and

  • /etc/qpsmtpd/addPrivatePriorityDomain.conf: rules to identify message headers in order to assign priorities.

Tools / Scripts

  • /etc/init.d/postfix-priority: starting script for all Postfix instances.
  • /etc/init.d/qpsmtpd-priority: starting script for Qpsmtpd.
  • /usr/sbin/update-priority-email-gateway: tool used to generate or update settings for all Postfix instances and Qpsmtpd.
  • /usr/sbin/priority-email-gateway-showQueues: tool used to display message counts in all queues of all Postfix instances.

General setup

Qpsmtpd parameters


Postfix parameters


Event when sending a bounce back to message originator


Customization of Postfix frontend


Customization of Postfix priority instances


Customization of rules to identify message headers


Start/stop of priority system

Priority system service is automatically launched when the server starts. Scripts used are /etc/init.d/postfix‑priority and /etc/init.d/qpsmtpd‑priority. They control all configured Postfix instances and Qpsmtpd.

Start service:

# /etc/init.d/postfix‑priority start
# /etc/init.d/qpsmtpd‑priority start

Stop service:

# /etc/init.d/postfix‑priority stop
# /etc/init.d/qpsmtpd‑priority stop

Restart service:

# /etc/init.d/postfix‑priority restart
# /etc/init.d/qpsmtpd‑priority restart

After an configuration update with update‑priority‑email‑gateway, service is automatically restarted.