WIP: configure postfix to use SASL to auth senders
This commit is contained in:
parent
1ce9ef9640
commit
c08931882a
12 changed files with 147 additions and 39 deletions
|
|
@ -2,13 +2,57 @@
|
|||
apt:
|
||||
pkg:
|
||||
- postfix
|
||||
- postfix-ldap
|
||||
|
||||
- name: Install and setup utilities for LDAP
|
||||
when: postfix.ldap.enable
|
||||
block:
|
||||
- name: install utility packages for LDAP auth & config
|
||||
apt:
|
||||
pkg:
|
||||
- postfix-ldap
|
||||
- sasl2-bin
|
||||
|
||||
- name: Configure saslauthd
|
||||
template:
|
||||
src: saslauthd.conf.j2
|
||||
dest: /etc/saslauthd.conf
|
||||
notify:
|
||||
- restart saslauthd
|
||||
|
||||
- name: Copy saslauthd defaults
|
||||
copy:
|
||||
src: saslauthd-defaults
|
||||
dest: /etc/default/saslauthd
|
||||
notify:
|
||||
- restart saslauthd
|
||||
|
||||
- name: Copy smtpd.conf
|
||||
copy:
|
||||
src: smtpd.conf
|
||||
dest: /etc/postfix/sasl/smtpd.conf
|
||||
notify:
|
||||
- restart postfix
|
||||
|
||||
- name: Add postfix to sasl group
|
||||
user:
|
||||
name: postfix
|
||||
append: yes
|
||||
groups: sasl
|
||||
notify:
|
||||
- restart postfix
|
||||
|
||||
- name: remove exim4 package
|
||||
apt:
|
||||
name: exim4
|
||||
state: absent
|
||||
|
||||
# We need to configure postfix's virtual UID and GID map. Those are set to the vmail users UID and GID as vmail holds all mail
|
||||
# Used in templates/main.cf.j2
|
||||
- name: "get vmail user data"
|
||||
user:
|
||||
name: vmail
|
||||
register: vmail_user
|
||||
|
||||
- name: copy postfix config
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
|
|
@ -16,8 +60,8 @@
|
|||
with_items:
|
||||
- { src: "main.cf.j2", dest: "/etc/postfix/main.cf" }
|
||||
- { src: "master.cf.j2", dest: "/etc/postfix/master.cf" }
|
||||
- { src: "virtual-senders.cf.j2", dest: "/etc/postfix/virtual-senders.cf" }
|
||||
- { src: "virtual-recipients.cf.j2", dest: "/etc/postfix/virtual-recipients.cf" }
|
||||
- { src: "virtual-aliases.cf.j2", dest: "/etc/postfix/virtual-aliases.cf" }
|
||||
- { src: "virtual-mailboxes.cf.j2", dest: "/etc/postfix/virtual-mailboxes.cf" }
|
||||
notify:
|
||||
- restart postfix
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue