diff --git a/defaults/main.yml b/defaults/main.yml index 1559388..b5b3d38 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -20,10 +20,10 @@ postfix_mydestination: - localhost postfix_relayhost: -postfix_relayhost_port: +postfix_relayhost_port: 25 postfix_relaytls: true -postfix_sasl_auth_enable: true -postfix_sasl_user: +postfix_sasl_auth_enable: false +postfix_sasl_user: false postfix_sasl_password: postfix_sasl_security_options: noanonymous diff --git a/tasks/main.yml b/tasks/main.yml index 894da31..69ddeb3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -37,12 +37,12 @@ - name: configure sasl username/password become: true template: - src: sasl_passwd.j2 - dest: /etc/postfix/sasl_passwd - owner: root - group: root - mode: 0600 - when: postfix_relayhost != false + src: sasl_passwd.j2 + dest: /etc/postfix/sasl_passwd + owner: root + group: root + mode: 0600 + when: postfix_sasl_user != false notify: - postmap sasl_passwd - restart postfix diff --git a/templates/main.cf.j2 b/templates/main.cf.j2 index 33e2b4c..582a6b0 100644 --- a/templates/main.cf.j2 +++ b/templates/main.cf.j2 @@ -1,7 +1,7 @@ # {{ ansible_managed }} disable_vrfy_command = {{ postfix_disable_vrfy_command }} -# smtpd_banner = $myhostname ESMTP $mail_name +smtpd_banner = $myhostname ESMTP biff = no # appending .domain is the MUA's job. @@ -52,6 +52,8 @@ debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 +smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination + {% if postfix_relayhost %} relayhost = [{{ postfix_relayhost }}]:{{ postfix_relayhost_port }} {% if postfix_sasl_auth_enable %} @@ -64,4 +66,4 @@ smtp_tls_security_level = encrypt smtp_tls_note_starttls_offer = yes {% endif %} {% endif %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/vars/Suse.yml b/vars/Suse.yml new file mode 100644 index 0000000..e3ecdd9 --- /dev/null +++ b/vars/Suse.yml @@ -0,0 +1,10 @@ +--- +# vars file for arillso.postfix + +postfix_packages: + - postfix + - cyrus-sasl-plain + - cyrus-sasl + - mailx + +psotfix_daemon_directory: /usr/libexec/postfix