Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

101 linhas
3.9 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: Define dovecot service in master.cf
  29. command: postconf -vM dovecot/unix='dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f ${sender} -d ${recipient}'
  30. notify: restart postfix
  31. - name: Set virtual_transport to dovecot
  32. command: postconf virtual_transport=dovecot
  33. - name: Restricting delivery to Dovecot to one email at a time
  34. command: postconf dovecot_destination_recipient_limit=1
  35. - name: Setting SMTP authentication type to dovecot
  36. command: postconf smtpd_sasl_type=dovecot
  37. - name: Setting SMTP authentication path/socket
  38. command: postconf smtpd_sasl_path=private/auth
  39. - name: Enabling SMTP authentication
  40. command: postconf smtpd_sasl_auth_enable=yes
  41. - name: Setting SMTP encryption security level
  42. command: postconf smtpd_tls_security_level=may
  43. - name: Setting SMTP encryption security level
  44. command: postconf smtpd_tls_security_level=may
  45. - name: Enforce SMTP encryption
  46. command: postconf smtpd_tls_auth_only=yes
  47. - name: Set TLS encryption certificate
  48. command: postconf smtpd_tls_cert_file=/etc/ssl/certs/mailserver.pem
  49. - name: Set TLS encryption key
  50. command: postconf smtpd_tls_key_file=/etc/ssl/private/mailserver.pem
  51. - name: Enabling SMTP authentication during the SMTP protocol
  52. command: postconf smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
  53. - name: Copying patch for Debian bug 739738
  54. copy: src=spamassassin.patch dest=/tmp/spamassassin.patch
  55. - name: Patching Debian bug 739738
  56. patch: src=/tmp/spamassassin.patch strip=0 basedir=/ remote_src=True
  57. - name: Enabling Spamassassin milter
  58. command: postconf smtpd_milters=unix:/spamass/spamass.sock
  59. - name: Make Spamassassin milter problems return a temporary error
  60. command: postconf milter_default_action=tempfail
  61. - name: Configuring Spamassassin milter
  62. command: postconf milter_connect_macros="j {daemon_name} v {if_name} _"
  63. - name: Setting spamd options
  64. copy: src=etc-default-spamassassin dest=/etc/default/spamassassin
  65. notify: restart spamassassin
  66. #- name: Adding user spamass-milter to debian-spamd group
  67. # user: name=spamass-milter groups=debian-spamd
  68. # notify: restart spamassassin
  69. - name: Enabling spamd at startup
  70. command: systemctl enable spamassassin
  71. - name: Allow emails up to 40 MB large
  72. command: postconf message_size_limit=41943040
  73. - name: Make Postfix listen on all interfaces
  74. command: postconf inet_interfaces=all