Skip to content

Commit

Permalink
Merge branch '3-add-option-to-configure-submission-port' into 'main'
Browse files Browse the repository at this point in the history
Resolve "add option to configure submission port"

Closes #3

See merge request ansible/ansible-role-mailcow!6
  • Loading branch information
l-with committed May 5, 2022
2 parents 4ca7f7b + f38028e commit 6380e6b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Note that this also requires installation of the python libraries `docker` and `
| https | `mailcow_acme` | `out-of-the-box` | the way the Let's Encrypt certificate ist obtained: <br/> `out-the-box`: The "acme-mailcow" container will try to obtain a LE certificate. <br/> `certbot`: The certbot cronjob will manage Let's Encrypt certificates |
| https | `mailcow_acme_staging` | `no` | if ACME staging should be used (s. https://mailcow.github.io/mailcow-dockerized-docs/firststeps-ssl/#test-against-staging-acme-directory) |
| https | `mailcow_additional_san` | `imap.*,smtp.*,autodiscover.*,autoconfig.*` | the additional domains (SSL Certificate Subject Alternative Names) |
| configuration | `mailcow_submission_port` | `587` | the SUBMISSION_PORT in mailcow.conf |
| configuration | `mailcow_greylisting` | `true` | if greylisting should be active |
| configuration | `mailcow_mynetworks` | `` | list of subnetwork masks to add to `mynetworks` in postfix <br /> if subnetwork masks are provided at the beginning `127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 [fe80::]/10` is added (local) |
| backup | `mailcow_configure_backup` | `false` | if backup of the mailcow should be configured for unattended backup |
Expand Down
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ mailcow_docker_compose_state: present
mailcow_acme: 'out-of-the-box'
mailcow_acme_staging: false

mailcow_submission_port: 587

mailcow_delete_default_admin_script: /root/ansible_mailcow_delete_default_admin.sh
mailcow_set_admin_script: /root/ansible_mailcow_set_admin.sh
mailcow_set_rspamd_ui_password_script: /root/ansible_set_rspamd_ui_password.sh
Expand Down
21 changes: 21 additions & 0 deletions tasks/mailcow_conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@
API_KEY={{ mailcow_api_key }}
when: mailcow_api_key is defined

- name: Ensure SUBMISSION_PORT in mailcow.conf
ansible.builtin.lineinfile:
path: "{{ mailcow_install_path }}/mailcow.conf"
backup: true
regexp: SUBMISSION_PORT=
line: "SUBMISSION_PORT={{ mailcow_submission_port }}"

- name: Ensure SUBMISSION_PORT in docker-compose.yml for php-fpm-mailcow
ansible.builtin.lineinfile:
path: "{{ mailcow_install_path }}/docker-compose.yml"
backup: yes
regexp: '- SUBMISSION_PORT=\${SUBMISSION_PORT:-\d+}'
line: " - SUBMISSION_PORT=${SUBMISSION_PORT:-{{ mailcow_submission_port }}}"

- name: Ensure SUBMISSION_PORT in docker-compose.yml for postfix-mailcow
ansible.builtin.lineinfile:
path: "{{ mailcow_install_path }}/docker-compose.yml"
backup: yes
regexp: '- "\${SUBMISSION_PORT:-\d+}:\d+"'
line: " - \"${SUBMISSION_PORT:-{{ mailcow_submission_port }}}:{{ mailcow_submission_port }}\""

- name: Ensure API key read.only
ansible.builtin.blockinfile:
path: "{{ mailcow_install_path }}/mailcow.conf"
Expand Down

0 comments on commit 6380e6b

Please sign in to comment.