Merge ~cjwatson/charm-postfix-relay:optional-myhostname into charm-postfix-relay:master

Proposed by Colin Watson
Status: Merged
Approved by: Eric Chen
Approved revision: 8f371ca57c46e6c779da9f111a34e190267795ce
Merged at revision: 75a9c22abd684ff1f1f7dd01d4735ab6d9472fcd
Proposed branch: ~cjwatson/charm-postfix-relay:optional-myhostname
Merge into: charm-postfix-relay:master
Prerequisite: ~cjwatson/charm-postfix-relay:fix-domain-rewrite-map
Diff against target: 32 lines (+5/-3)
2 files modified
src/config.yaml (+3/-3)
src/templates/main.cf (+2/-0)
Reviewer Review Type Date Requested Status
Eric Chen Approve
🤖 prod-jenkaas-bootstack (community) continuous-integration Approve
Robert Gildein Approve
Tianqi Xiao (community) Needs Information
Review via email: mp+431427@code.launchpad.net

Commit message

Default myhostname to the system's FQDN

Description of the change

There isn't really a strong reason to require units to have an externally-resolvable hostname, especially for a subordinate charm. It's quite common for internet email to originate at a host that isn't even externally-routable never mind having an externally-resolvable hostname, and this is fine as long as it's relaying to something whose hostname can be resolved by the next hop in the chain.

A better default is to just let Postfix use the system's fully-qualified domain name from `gethostname`, which is its default. That way, this charm can be deployed on units that aren't exposed to the internet, and they can just be configured to relay to something that does have an externally-resolvable hostname.

(The prerequisite branch is simply due to the various CI fixes there.)

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Tianqi Xiao (txiao) wrote :

The changes LGTM. I'm putting "Needs information" for now until the CI runs successfully.

review: Needs Information
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Gildein (rgildein) wrote :

LGTM

review: Approve
Revision history for this message
Eric Chen (eric-chen) wrote :

mark it as WIP until the jenkins bot pass.

Revision history for this message
Robert Gildein (rgildein) wrote :

This can be rebased on current master and CI will work fine.

Revision history for this message
Colin Watson (cjwatson) wrote :

Rebased, thanks.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
Eric Chen (eric-chen) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 75a9c22abd684ff1f1f7dd01d4735ab6d9472fcd

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/config.yaml b/src/config.yaml
2index ba05447..a28cf40 100644
3--- a/src/config.yaml
4+++ b/src/config.yaml
5@@ -14,10 +14,10 @@ options:
6 user+host@newdomain.
7 type: string
8 myhostname:
9- default: postfix-relay.example.com
10+ default: ''
11 description:
12- The external hostname by which this mail relay is known. This
13- value must be changed for the charm to be useful.
14+ The external hostname by which this mail relay is known. If not
15+ set, Postfix will default to using the system's FQDN.
16 type: string
17 mynetworks:
18 default: 127.0.0.0/8
19diff --git a/src/templates/main.cf b/src/templates/main.cf
20index 32a8314..a1df893 100644
21--- a/src/templates/main.cf
22+++ b/src/templates/main.cf
23@@ -23,7 +23,9 @@ smtp_sasl_security_options =
24 {%- endif %}
25
26 disable_vrfy_command = {{ disable_vrfy_command }}
27+{%- if config.myhostname %}
28 myhostname = {{ config.myhostname }}
29+{%- endif %}
30 mynetworks = {{ config.mynetworks }}
31 mydestination = $myhostname, localhost.$mydomain, localhost
32 relayhost = {{ config.relayhost }}

Subscribers

People subscribed via source and target branches

to all changes: