Open go8ose opened 5 years ago
@ixs can you comment on this?
@aboe76 thanks for the headsup. This looks familiar...
I might actually have that already fixed locally. Let me have a look.
@go8ose Have a look at https://github.com/bawuenet/postfix-formula/commit/9454406f8e60df48af33416cbd70b62c87bc8e5c and see if that would work for you.
It's a quite extensive rework of the services config but finally allows to configure really everything. :-)
@ixs do I see a PR in the future? :)
@go8ose Have a look at bawuenet@9454406 and see if that would work for you.
It's a quite extensive rework of the services config but finally allows to configure really everything. :-)
Thanks @ixs, I've tried out this branch. My testing shows it works, in that a salt test run doesn't error out, and does look like it would apply the diff to master.cf that I expect. I haven't actually put this into use on a test server to confirm that postfix starts up.
Furthemore, the diff I needed to apply to my pillar was pretty minor:
diff -r a6172aa4951b pillarroot/cromp/mailhost.sls
--- a/pillarroot/cromp/mailhost.sls Sat Oct 05 10:33:07 2019 +1000
+++ b/pillarroot/cromp/mailhost.sls Sat Oct 05 11:13:56 2019 +1000
@@ -20,9 +20,11 @@
enable_submission: True
services:
# Make postfix listen on a port for emails to return from amavisd.
- localhost_10025:
+ localhost:10025:
+ enable: True
command: smtpd
type: inet
+ servicetype: internal
private: n
args:
- 'content_filter='
(Note I previously had "localhost_10025" to work around the salt exceptions being thrown, and yes, that was causing a broken master.cf file to be created).
So if this change makes it's way into a PR, that would definitely close this issue.
Thanks for the feedback. I'll see what needs to be cleaned up before we can merge that in...
Describe the bug
I get a SaltRenderError when I try to use this forumla to make postfix listen on localhost:10025.
Setup
I'm using a github fork of this repository. It's on version 077a6a6494e546f8bb34a60752112f861c1a5040.
Steps to reproduce the bug
I have a pillar that reads (in part, snipped for brevity):
(Edit 2019-10-06, fixed example pillar to show "localhost:10025" instead of "localhost_10025", as the former actually causes the SaltRenderError, the later is what I had committed to my pillar to avoid the exception being thrown)
When I run salt, I see an error.
Expected behaviour
I would expect salt to write out a /etc/postfix/master.cf file that includes an entry for "localhost:10025", which has the arguments listed above (such as content_filter, smtpd_delay_reject, etc). I would expect salt to restart postfix, and then postfix to be listening on port 10025.
Versions report
Additional context
I've done some investigation. I suspect in postfix/files/master.cf, in the "Handle custom services" section at the end, the "pillar.get" on 'postfix:master_config:services:%s' is causing a lookup of 'postfix:master_config:services:localhost:10025', which is not a key that exists in my pillar.
I don't know how to define a pillar that will result in the formula writing out a postfix service entry for "localhost:10025", and will also satisfy that pillar.get lookup.