---
- hosts: centos8_init
user: ioniere
become: yes
tasks:
- name: dovecot 설치
yum:
name: dovecot
state: latest
- name: dovecot.conf 수정(imap, ipv4)
get_url:
url: http://data.yeonghoon.kim/centos8_dovecot/source/dovecot.conf
dest: /etc/dovecot/dovecot.conf
force: yes
- name: ssl 끄기
lineinfile:
path: /etc/dovecot/conf.d/10-ssl.conf
regexp: '^ssl = required$'
line: "ssl = no"
- name: mail_location 설정
lineinfile:
path: /etc/dovecot/conf.d/10-mail.conf
regexp: '^#mail_location = $'
line: "mail_location = mbox:~/mail:INBOX=/var/mail/%u"
- name: 메일 사용 가능한 그룹 설정
lineinfile:
path: /etc/dovecot/conf.d/10-mail.conf
regexp: '^#mail_privileged_group =$'
line: "mail_privileged_group = mail"
- name: plaintext 인증 허용
lineinfile:
path: /etc/dovecot/conf.d/10-auth.conf
regexp: '^#disable_plaintext_auth = yes$'
line: "disable_plaintext_auth = no"
- name: dovecot 구동 및 부팅 시 구동되도록 설정
service:
name: dovecot
state: started
enabled: yes
host, user,은 상황에 맞게 수정 후 사용
방화벽 설정은 별도로 진행(143)
메일을 사용할 계정은 mail 그룹에 포함되어 있어야 함.