Skip to content

Commit 9281c79

Browse files
ixsathienem
authored andcommitted
Fix table type for proxy tables
http://www.postfix.org/DATABASE_README.html#types specifies the lookup table types postfix understands. Most are defined as type:/path/to/table which is currently supported by the postfix formula. This does break though as soon as the proxy table type is used which is a prefix to a normal table definition to indicate caching is requested. This PR changes the code to discard the proxy prefix to ensure that the usual logic applies again.
1 parent d2896ea commit 9281c79

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

postfix/files/main.cf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ policy-spf_time_limit = {{ policyd_spf.get('time_limit', '3600s') }}
120120

121121
{%- for mapping, data in salt['pillar.get']('postfix:mapping', {}).items() %}
122122
{%- set file_path = salt['pillar.get']('postfix:config:' ~ mapping) %}
123-
{%- if ':' in file_path %}
123+
{%- if file_path.startswith('proxy:') %}
124+
{#- Discard the proxy:-prefix #}
125+
{%- set _, file_type, file_path = file_path.split(':') %}
126+
{%- elif ':' in file_path %}
124127
{%- set file_type, file_path = file_path.split(':') %}
125128
{%- else %}
126129
{%- set file_type = default_database_type %}

postfix/init.sls

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ postfix_alias_absent_{{ user }}:
7676
{% for mapping, data in salt['pillar.get']('postfix:mapping', {}).items() %}
7777
{%- set need_postmap = False %}
7878
{%- set file_path = salt['pillar.get']('postfix:config:' ~ mapping) %}
79-
{%- if ':' in file_path %}
79+
{%- if file_path.startswith('proxy:') %}
80+
{#- Discard the proxy:-prefix #}
81+
{%- set _, file_type, file_path = file_path.split(':') %}
82+
{%- elif ':' in file_path %}
8083
{%- set file_type, file_path = file_path.split(':') %}
8184
{%- else %}
8285
{%- set file_type = default_database_type %}

0 commit comments

Comments
 (0)