Skip to content

Tls for postfix pr 2.x #1493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/roles/debian/apache.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,18 @@ apache:
handling: selfsigned
# Sample LetsEncrypt config, because include_role will not merge defaults these all need providing:
# handling: letsencrypt
# http_01_port: 5000
# http_01_port: 80
# autorenew: true
# email: sysadm@codeenigma.com
# services: []
# services:
# - apache2
# web_server: standalone
# certbot_register_command: "/usr/bin/certbot certonly --agree-tos --preferred-challenges http -n"
# certbot_renew_command: "/usr/bin/certbot certonly --agree-tos --force-renew"
# reload_command: restart
# reload:
# - apache
# - apache2
# on_calendar: "Mon *-*-* 04:00:00"
is_default: true
basic_auth:
auth_enabled: false
Expand Down
11 changes: 10 additions & 1 deletion docs/roles/debian/postfix.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Postfix
Installs and configures Postfix for sending mail. Mail sending is disabled by default.
Installs and configures Postfix for sending mail. Mail sending is disabled by default using transport maps.

Full TLS SMTP support is optional by enabling SSL.

<!--TOC-->
<!--ENDTOC-->
Expand Down Expand Up @@ -36,6 +38,13 @@ postfix:
aliases: []
#- user: root
# alias: admin@example.com
# Basic optional SSL handling - does not currently use the SSL role, as it is likely being handled elsewhere
ssl:
enabled: false
smtp_tls_cert_file: "" # full path to certificate, e.g. /etc/letsencrypt/live/acme.com/fullchain.pem
smtp_tls_key_file: "" # full path to key, e.g. /etc/letsencrypt/live/acme.com/privkey.pem
smtp_tls_CApath: /etc/ssl/certs
smtp_tls_CAfile: /etc/ssl/certs/ca-certificates.crt

```

Expand Down
8 changes: 5 additions & 3 deletions roles/debian/apache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,18 @@ apache:
handling: selfsigned
# Sample LetsEncrypt config, because include_role will not merge defaults these all need providing:
# handling: letsencrypt
# http_01_port: 5000
# http_01_port: 80
# autorenew: true
# email: sysadm@codeenigma.com
# services: []
# services:
# - apache2
# web_server: standalone
# certbot_register_command: "/usr/bin/certbot certonly --agree-tos --preferred-challenges http -n"
# certbot_renew_command: "/usr/bin/certbot certonly --agree-tos --force-renew"
# reload_command: restart
# reload:
# - apache
# - apache2
# on_calendar: "Mon *-*-* 04:00:00"
is_default: true
basic_auth:
auth_enabled: false
Expand Down
8 changes: 5 additions & 3 deletions roles/debian/apache/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,18 @@ apache:
handling: selfsigned
# Sample LetsEncrypt config, because include_role will not merge defaults these all need providing:
# handling: letsencrypt
# http_01_port: 5000
# http_01_port: 80
# autorenew: true
# email: sysadm@codeenigma.com
# services: []
# services:
# - apache2
# web_server: standalone
# certbot_register_command: "/usr/bin/certbot certonly --agree-tos --preferred-challenges http -n"
# certbot_renew_command: "/usr/bin/certbot certonly --agree-tos --force-renew"
# reload_command: restart
# reload:
# - apache
# - apache2
# on_calendar: "Mon *-*-* 04:00:00"
is_default: true
basic_auth:
auth_enabled: false
Expand Down
11 changes: 10 additions & 1 deletion roles/debian/postfix/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Postfix
Installs and configures Postfix for sending mail. Mail sending is disabled by default.
Installs and configures Postfix for sending mail. Mail sending is disabled by default using transport maps.

Full TLS SMTP support is optional by enabling SSL.

<!--TOC-->
<!--ENDTOC-->
Expand Down Expand Up @@ -36,6 +38,13 @@ postfix:
aliases: []
#- user: root
# alias: admin@example.com
# Basic optional SSL handling - does not currently use the SSL role, as it is likely being handled elsewhere
ssl:
enabled: false
smtp_tls_cert_file: "" # full path to certificate, e.g. /etc/letsencrypt/live/acme.com/fullchain.pem
smtp_tls_key_file: "" # full path to key, e.g. /etc/letsencrypt/live/acme.com/privkey.pem
smtp_tls_CApath: /etc/ssl/certs
smtp_tls_CAfile: /etc/ssl/certs/ca-certificates.crt

```

Expand Down
7 changes: 7 additions & 0 deletions roles/debian/postfix/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ postfix:
aliases: []
#- user: root
# alias: admin@example.com
# Basic optional SSL handling - does not currently use the SSL role, as it is likely being handled elsewhere
ssl:
enabled: false
smtp_tls_cert_file: "" # full path to certificate, e.g. /etc/letsencrypt/live/acme.com/fullchain.pem
smtp_tls_key_file: "" # full path to key, e.g. /etc/letsencrypt/live/acme.com/privkey.pem
smtp_tls_CApath: /etc/ssl/certs
smtp_tls_CAfile: /etc/ssl/certs/ca-certificates.crt
13 changes: 12 additions & 1 deletion roles/debian/postfix/templates/main.cf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,20 @@ non_smtpd_milters = inet:localhost:8891
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
{% endif %}
{% if postfix.use_ses or postfix.ssl.enabled %}
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_CApath = {{ postix.ssl.smtp_tls_CApath }}
smtp_tls_CAfile = {{ postix.ssl.smtp_tls_CAfile }}
{% endif %}
{% if postfix.ssl.enabled %}
smtp_tls_cert_file = {{ postix.ssl.smtp_tls_cert_file }}
smtp_tls_key_file = {{ postix.ssl.smtp_tls_key_file }}
smtpd_tls_cert_file = {{ postix.ssl.smtp_tls_cert_file }}
smtpd_tls_key_file = {{ postix.ssl.smtp_tls_key_file }}
smtpd_tls_CApath = {{ postix.ssl.smtp_tls_CApath }}
smtpd_tls_CAfile = {{ postix.ssl.smtp_tls_CAfile }}
{% endif %}
{% if (is_local is defined) and is_local %}
# Force all mail to ce-dev user.
Expand Down