Closed raphink closed 3 years ago
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): Opening augeas with root /, lens path , flags 64
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): Augeas version 1.12.0 is installed
Warning: Augeas[Postfix transport - maildev.test](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error = parse_failed
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error/pos = 30
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error/line = 1
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error/char = 30
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/postfix_transport.aug:55.10-.47:
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error/message = Iterated lens matched less than it should
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'set' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']", "maildev.test"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'set' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']/transport", "relay"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'rm' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']/nexthop"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'set' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']/host", "[localhost]"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'set' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']/port", "1025"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): Closed the augeas connection
Error: /Stage[main]/Profile::Postfix/Postfix::Transport[maildev.test]/Augeas[Postfix transport - maildev.test]: Could not evaluate: Save failed, see debug output for details
Thanks for the output. Can you also paste the error that Augeas should be displaying right after that log?
there ist no augeas error output
Error: /Stage[main]/Profile::Postfix/Postfix::Transport[maildev.test]/Augeas[Postfix transport - maildev.test]: Could not evaluate: Save failed, see debug output for details
Debug: Postfix::Transport[maildev.test]: Resource is being skipped, unscheduling all events
Debug: Postfix::Hash[/etc/postfix/transport]: Resource is being skipped, unscheduling all events
Debug: Postfix::Map[/etc/postfix/transport]: Resource is being skipped, unscheduling all events
Ah right. Your problem is not with the Puppet code, it is that your file cannot be parsed by Augeas:
Warning: Augeas[Postfix transport - maildev.test](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error = parse_failed
Could you paste the content of your file?
i have deleted the file '/etc/postfix/transport' and started puppet again, now i get the error message
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): Opening augeas with root /, lens path , flags 64
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): Augeas version 1.12.0 is installed
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'set' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']", "maildev.test"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'set' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']/transport", "relay"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'rm' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']/nexthop"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'set' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']/host", "[example.com]"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): sending command 'set' with params ["/files/etc/postfix/transport/pattern[. = 'maildev.test']/port", "1025"]
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): Put failed on one or more files, output from /augeas//error:
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error = put_failed
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error/path = /files/etc/postfix/transport/files/etc/postfix/transport/pattern
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/postfix_transport.aug:50.15-52.23:
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): /augeas/files/etc/postfix/transport/error/message = Failed to match tree under /files/etc/postfix/transport/pattern
{ "transport" = "relay" }
{ "host" = "[example.com]" }
{ "port" = "1025" }
with pattern
{ /transport/ = /([.0-9A-Z_a-z-]+)?/ }
{ /nexthop/ = /(\\[[.0-9A-Z_a-z-]+\\]|[A-Za-z](.*[^\t\n ])?)?/ }
| { /host/ = /\\[[.0-9A-Z_a-z-]+\\]|[.0-9A-Z_a-z-]+/ }
{ /port/ = /[0-9]+/ }
Debug: Augeas[Postfix transport - maildev.test](provider=augeas): Closed the augeas connection
Error: /Stage[main]/Profile::Postfix/Postfix::Transport[maildev.test]/Augeas[Postfix transport - maildev.test]: Could not evaluate: Save failed, see debug output for details
I see the issue. Can you try again please?
That works, great!
cat /etc/postfix/transport
maildev.test [example.com]:1025
Great. I need to fix a few edge cases and clean up the code.
If that's still working @aba-rechsteiner, it should be ready actually. Can you check again with the last commit please?
ou no I have missed that, the transport type is missing
"transport" = "relay"
maildev.test [example.com]:1025
I don't have that syntax in the Augeas lens.
I have:
the.backed-up.domain.tld relay:[their.mail.host.tld]
* smtp:outbound-relay.my.domain
user.foo@example.com smtp:bar.example:2025
user@example.com [12.34.56.78]:587
but the pattern transport:[host]:1234
syntax is not supported. Are you sure this is valid?
hmm.. yes you could be right
I'll merge this pr for now as it supports the smtp syntax as parsed by Augeas.
Feel free to open a new issue if you find out the syntax you want is valid.
Fix #241