Open kossmac opened 7 years ago
@kossmac why do this?
isn't it possible to just set mydestination in pillar to achieve the same thing
postfix:
config:
mydestination: subdomain.example.com, localhost, localhost.localcomain
yes, you're right, but i do have to write redundant pillar data to every system i manage
Maybe you can make it generic with jinja like:
postfix:
config:
mydestination: {{ grains.id.split('.')[1:]|join('.') }}, localhost, localhost.localdomain
This is something I use for some email address rewriting to avoid this copy/paste as well.
@kossmac @aboe76 @EvaSDK I'm closing this due to inactivity. Please re-open if you still want to see the PR merged. Thanks for your effort!
This should be re-opened
We just noticed this issue on a system that just happened to need to send to `something@[hostdomain]
Normally systems with default postfix config are just setup to get mail out to some monitoring address for cron failures, etc, and that's usually a 3rd party address from the managed system, so we only noticed it now.
I can't think of a good reason why the 'default' handling needs to be
{{ set_parameter('mydestination', [grains['fqdn'], 'localhost', 'localhost.localdomain', grains['domain']]) }}
If the server is going to be a full SMTP Inbound system, you are probably going to have a much deeper pillar configuration. I can't think of a good reason why the 'default' unconfigured state should have the grains['domain']
in there.
The Postfix defaults (from the manual) are :
$myhostname, localhost.$mydomain, localhost
One should have to go out of their way to set a value different than the postfix default, with this formula.
@kti-richard Your are raising a good point. :-)
I'd rather drop include_domain_in_mydestination: True
and the domain at the end of mydestination
and go with the Postfix default.
If someone is using something different, she can always set mydestination
in Pillar.
@aboe76 @kossmac @EvaSDK What are your thoughts on this?
Our team would be happy with @alxwr 's recommendation of just following the postfix default. Do we need a new PR for this ?
@kti-richard I'd do it myself, but haven't got the time to do it. Please submit a PR! :-)
If I setup a server with hostname subdomain.example.com example.com is configured in postfix' mydestination so that every mail addressed to someone@example.com is sent to local postfix.