We want to relay mails from the container to localhost (the LXC host mail system)

This commit is contained in:
Tristan PILAT 2019-09-19 16:26:54 +02:00
parent 177ae83795
commit d625d840a9
2 changed files with 18 additions and 4 deletions

View File

@ -88,10 +88,10 @@
when: name != 'php73'
- name: Configure opensmtpd
replace:
name: "/var/lib/lxc/{{name}}/rootfs/etc/smtpd.conf"
regexp: "^listen.*"
replace: "#listen on localhost"
template:
src: smtpd.conf.j2
dest: "/var/lib/lxc/{{name}}/rootfs/etc/smtpd.conf"
mode: "0644"
notify: "Restart opensmtpd"
when: name == 'php73'

View File

@ -0,0 +1,14 @@
# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.
# To accept external mail, replace with: listen on all
#listen on localhost
# If you edit the file, you have to run "smtpctl update table aliases"
table aliases file:/etc/aliases
# Uncomment the following to accept external mail for domain "example.org"
#accept from any for domain "example.org" alias <aliases> deliver to mbox
accept for local alias <aliases> deliver to mbox
accept for any relay via "smtp://127.0.0.1"