Create a systemd unit and scripts in order to automatize a lxc mailserver container launch
Summary:
The mail server is isolated into a lxc container. We want this mail server to be operational at startup
This requires two tasks:
- start the container mailserver through lxc-start
- add to iptables rules for NAT forwarding
We also provide a stop script to clean iptables.
Resolves T466.
Test Plan:
To evaluate the container status, we used 3 ways:
- try a telnet connection from an external server to see if the SMTP server (see below)
- lxc-top
- iptables -L | grep 10.0.3.8 (the IP of the mailserver container)
It has also been tested in Dwellers through systemd and works.
$ telnet -4 dwellers.nasqueron.org 25 Trying 212.129.32.223... Connected to dwellers.nasqueron.org. Escape character is '^]'. 220 mail.nasqueron.org ESMTP Postfix (Debian/GNU)
Reviewers: dereckson
Subscribers: Kaliiixx, dereckson
Projects: Operations sprint 0, Servers, Mail
Maniphest Tasks: T466
Differential Revision: http://devcentral.nasqueron.org/D102