[pmg-devel] [PATCH pmg-api] fix postfix template for before-queue filtering

Stoiko Ivanov s.ivanov at proxmox.com
Mon Jan 27 15:40:13 CET 2020


Introducing before-queue support in e0cbdf9fc98178f97223922f305cc19d6d29262d
missed adapting the relevant settings in the template for 'main.cf'.

Since the settings were overridden in the smtpd instances the error only
shows for locally generated mail (e.g. from cronjobs):

```
warning: connect to transport private/scan: Connection refused
```

Instead of globally setting 'smtpd_proxy_filter' (and associated options) in
'main.cf', as is done for 'content_filter' (for afterqueue filtering), this
patch removes the global 'content_filter' setting. This is done since
'smtp_proxy_filter' only applies to smtp sessions [0] and all incoming smtpd
processes get the setting in 'master.cf.in'.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>

[0] see http://www.postfix.org/SMTPD_PROXY_README.html - the proxy speaks
smtp, and it's answers are sent to the sending server.
---
Reported in the forum by one of our early adopters:
https://forum.proxmox.com/threads/local-sending-pmg-to-internal-fails-with-mail-transport-unavailable.63456/

Thanks!

 src/templates/main.cf.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/templates/main.cf.in b/src/templates/main.cf.in
index aa52c08..1526709 100644
--- a/src/templates/main.cf.in
+++ b/src/templates/main.cf.in
@@ -49,7 +49,9 @@ relay_transport = [% pmg.mail.relayprotocol %]:[% pmg.mail.relay %]:[% pmg.mail.
 default_transport = smtp:[% pmg.mail.smarthost %]:[% pmg.mail.smarthostport %]
 [% END %]
 
+[% IF ! pmg.mail.before_queue_filtering -%]
 content_filter=scan:127.0.0.1:10024
+[%- END %]
 
 mail_name = Proxmox
 
-- 
2.20.1




More information about the pmg-devel mailing list