arreglando bugs

This commit is contained in:
Mauro Torrez 2019-08-25 21:54:19 -03:00
parent 55cdfb163d
commit ac9db2cd89
4 changed files with 70 additions and 1 deletions

18
tasks/invoke_postconf.yml Normal file
View File

@ -0,0 +1,18 @@
---
# Invoke postconf with given arguments
# Useful for calling via include_role in other roles, using tasks_from
- name: "Postconf invocation"
postconf:
state: "{{ postfix_custom.state | default('present') }}"
parameter: "{{ postfix_custom.parameter | default('') }}"
value: "{{ postfix_custom.value | default('') }}"
service: "{{ postfix_custom.service | default('') }}"
type: "{{ postfix_custom.type | default('') }}"
command: "{{ postfix_custom.command | default('') }}"
private: "{{ postfix_custom.private | default('') }}"
unprivileged: "{{ postfix_custom.unprivileged | default('') }}"
chroot: "{{ postfix_custom.chroot | default('') }}"
wakeup: "{{ postfix_custom.wakeup | default('') }}"
process_limit: "{{ postfix_custom.process_limit | default('') }}"
notify: reload postfix

View File

@ -4,7 +4,7 @@
src: ldap_table.cf.j2
dest: /etc/postfix/{{ domain }}_ldap_{{ item }}.cf"
when:
- postfix_domain_config[domain][item+'_lookup'].provider|default(postfix_lookup_provider) == 'ldap'
- postfix_mail_domains[domain][item+'_lookup'].provider|default(postfix_lookup_provider) == 'ldap'
loop:
- user
- alias

View File

@ -0,0 +1,41 @@
# Lookup
domain = {{ domain }}
server_host = {{ postfix_ldap_server }}
server_port = {{ postfix_ldap_port }}
version = {{ postfix_ldap_version }}
scope = {{ postfix_ldap_scope }}
bind = {{ postfix_ldap_bind }}
bind_dn = {{ postfix_ldap_bind_dn }}
bind_pw = {{ postfix_ldap_bind_pw }}
start_tls = {{ postfix_ldap_start_tls }}
tls_ca_cert_file = {{ postfix_ldap_tls_ca_cert_file }}
tls_ca_cert_dir = {{ postfix_ldap_tls_ca_cert_dir }}
search_base = ou=People,{{ domain.split('.') | map('regex_replace','^','dc=') | join(',') }}
query_filter = (&(objectClass=inetOrgPerson)(uid=%u))
result_attribute = uid
result_format = {{ vmail_home }}/mail/{{ domain }}/%s/
# para sqlite
# dbpath = {{ vmail_home }}/{{ domain }}_users.sqlite
# query = {{ postfix_sqlite_user_query }}
# queda por configurar estos params
# 'timeout',
# 'special_result_attribute',
# 'terminal_result_attribute',
# 'leaf_result_attribute',
# 'recursion_limit',
# 'expansion_limit',
# 'size_limit',
# 'dereference',
# 'chase_referrals',
# 'debuglevel',
# 'sasl_mechs',
# 'sasl_realm',
# 'sasl_authz_id',
# 'sasl_minssf',
# 'tls_cert',
# 'tls_key',
# 'tls_require_cert',
# 'tls_random_file',
# 'tls_cipher_suite',

View File

@ -0,0 +1,10 @@
{% for param in [
'dbpath',
'query',
'result_format',
'domain',
'expansion_limit'
] | intersect( dc[domain][item['type']+'_lookup'].keys() ) %}
%}
{{ param }} = {{ dc[domain][item['type']+'_lookup'][param] }}
{% endfor %}