25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

85 lines
3.2 KiB

  1. ---
  2. - name: define Postfix virtual mailbox domain mapping
  3. template: src=mysql-virtual-mailbox-domains.cf.j2 dest=/etc/postfix/mysql-virtual-mailbox-domains.cf
  4. notify: restart postfix
  5. - name: tell Postfix to use the virtual mailbox domain mapping
  6. command: postconf virtual_mailbox_domains=mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
  7. - name: define Postfix virtual mailbox mapping
  8. template: src=mysql-virtual-mailbox-maps.cf.j2 dest=/etc/postfix/mysql-virtual-mailbox-maps.cf
  9. notify: restart postfix
  10. - name: tell Postfix to use the virtual mailbox mapping
  11. command: postconf virtual_mailbox_maps=mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
  12. - name: define Postfix virtual alias mapping
  13. template: src=mysql-virtual-alias-maps.cf.j2 dest=/etc/postfix/mysql-virtual-alias-maps.cf
  14. notify: restart postfix
  15. - name: tell Postfix to use the virtual alias mapping
  16. command: postconf virtual_alias_maps=mysql:/etc/postfix/mysql-virtual-alias-maps.cf
  17. - name: define Postfix email-to-email mapping (required for catchall domains)
  18. template: src=mysql-email2email.cf.j2 dest=/etc/postfix/mysql-email2email.cf
  19. notify: restart postfix
  20. - name: tell Postfix to use the email-to-email mapping
  21. command: postconf virtual_alias_maps=mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf
  22. - name: Restricting access to database mapping files that contain a password
  23. file: path=/etc/postfix/mysql-{{item}}.cf mode=0640
  24. with_items:
  25. - virtual-mailbox-domains
  26. - virtual-mailbox-maps
  27. - virtual-alias-maps
  28. - name: Make Postfix use LMTP to send emails to Dovecot
  29. command: postconf virtual_transport=lmtp:unix:private/dovecot-lmtp
  30. - name: Restricting delivery to Dovecot to one email at a time
  31. command: postconf dovecot_destination_recipient_limit=1
  32. - name: Setting SMTP authentication type to dovecot
  33. command: postconf smtpd_sasl_type=dovecot
  34. - name: Setting SMTP authentication path/socket
  35. command: postconf smtpd_sasl_path=private/auth
  36. - name: Enabling SMTP authentication
  37. command: postconf smtpd_sasl_auth_enable=yes
  38. - name: Setting SMTP encryption security level
  39. command: postconf smtpd_tls_security_level=may
  40. - name: Setting SMTP encryption security level
  41. command: postconf smtpd_tls_security_level=may
  42. - name: Enforce SMTP encryption
  43. command: postconf smtpd_tls_auth_only=yes
  44. - name: Set TLS encryption certificate
  45. command: postconf smtpd_tls_cert_file=/etc/ssl/certs/mailserver.pem
  46. - name: Set TLS encryption key
  47. command: postconf smtpd_tls_key_file=/etc/ssl/private/mailserver.pem
  48. # - name: Enabling Spamassassin milter
  49. # command: postconf smtpd_milters=unix:/spamass/spamass.sock
  50. # - name: Configuring Spamassassin milter
  51. # command: postconf milter_connect_macros="i j {daemon_name} v {if_name} _"
  52. # - name: Setting spamd options
  53. # copy: src=etc-default-spamassassin dest=/etc/default/spamassassin
  54. # notify: restart spamassassin
  55. # - name: Adding user spamass-milter to debian-spamd group
  56. # user: name=spamass-milter groups=debian-spamd
  57. # notify: restart spamassassin
  58. # - name: Enabling spamd at startup
  59. # command: systemctl enable spamassassin
  60. - name: Allow emails up to 40 MB large
  61. command: postconf message_size_limit=41943040
  62. - name: Make Postfix listen on all interfaces
  63. command: postconf inet_interfaces=all