voxpupuli / puppet-postfix

Puppet postfix module
Apache License 2.0
70 stars 173 forks source link

postfix::transport ignores destination if nexthop includes [] #384

Open auebergang opened 7 months ago

auebergang commented 7 months ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Using the example

postfix::transport { 'gmail.com'
  destination => smtp,
  nexthop     => '[smtp.google.com]:25'
}

What are you seeing

produces an invalid transport map config in /etc/postfix/transport

gmail.com [smtp.google.com]:25

with postfix logging error messages like,

postfix/qmgr[1847]: warning: connect to transport private/[smtp.google.com]: No such file or directory

What behaviour did you expect instead

This should be (in /etc/postfix/transport)

gmail.com smtp:[smtp.google.com]:25

Output log

Any additional information you'd like to impart

Being able to set any destination would be great. It's currently ignored here if nexthop includes [] but I don't think [] is exclusive to smtp, it just disables MX DNS lookups

See the examples for RESULT FORMAT at transport(5)

e.g.

postfix::transport {
  'a.com':
    destination => relay,
    nexthop     => '[smarthost.a.com]:25';
  'b.com':
    destination => smtp,
    nexthop     => '[10.0.0.1]:25';
}