Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

en-/disable domain in mydestination #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kossmac
Copy link

@kossmac kossmac commented Mar 8, 2017

If I setup a server with hostname subdomain.example.com example.com is configured in postfix' mydestination so that every mail addressed to [email protected] is sent to local postfix.

@aboe76
Copy link
Member

aboe76 commented Mar 8, 2017

@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

@kossmac
Copy link
Author

kossmac commented Mar 8, 2017

yes, you're right, but i do have to write redundant pillar data to every system i manage

@EvaSDK
Copy link
Contributor

EvaSDK commented Mar 9, 2017

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.

@alxwr
Copy link
Member

alxwr commented Nov 7, 2018

@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!

@alxwr alxwr closed this Nov 7, 2018
@cp-richard
Copy link
Contributor

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.

@alxwr alxwr reopened this Apr 10, 2019
@alxwr
Copy link
Member

alxwr commented Apr 10, 2019

@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?

@cp-richard
Copy link
Contributor

Our team would be happy with @alxwr 's recommendation of just following the postfix default. Do we need a new PR for this ?

@alxwr
Copy link
Member

alxwr commented May 9, 2019

@kti-richard I'd do it myself, but haven't got the time to do it. Please submit a PR! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants