Bug 30350 - myhostname in main.cf could be configurable via ucr
myhostname in main.cf could be configurable via ucr
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Mail
UCS 3.1
Other Linux
: P5 enhancement (vote)
: ---
Assigned To: Mail maintainers
:
: 22023 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-08 10:58 CET by Tim Petersen
Modified: 2017-08-08 07:09 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.011
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Petersen univentionstaff 2013-02-08 10:58:18 CET
As requested in forum, myhostname in main.cf from postfix conf is generated by UCR variables hostname and domainname:

"myhostname = @%@hostname@%@.@%@domainname@%@"

This could also be made configurable by an own ucr variable if someone does want another value there.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2013-02-08 11:07:16 CET
In which scenario is it neccessary to change myhostname to a different value?
For DMZ setups the UCR variable mail/smtp/helo/name may be set to match with external DNS names.
Comment 2 Thomas Manninger 2013-02-14 14:43:28 CET
But, when i set "myhostname" to the local fqdn, and my server connets to another smtp, the smtp server is using myhostname, and not the official fqdn, and then, i get problems with spam...
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2013-02-14 15:22:54 CET
(In reply to comment #2)
> But, when i set "myhostname" to the local fqdn, and my server connets to
> another smtp, the smtp server is using myhostname, and not the official fqdn,
> and then, i get problems with spam...

This is why we added the UCR variable mail/smtp/helo/name which sets the
postfix option "smtp_helo_name":

---[man 5 postconf]---
smtp_helo_name (default: $myhostname)
     The hostname to send in the SMTP EHLO or HELO command.

     The default value is the machine hostname.  Specify a hostname or 
     [ip.add.re.ss].
[…]
---

→ ucr set mail/smtp/helo/name="my.official.fqdn.example.com"
→ /etc/init.d/postfix reload
Comment 4 Thomas Manninger 2013-02-14 15:42:18 CET
smtp_helo_name only works with incoming connections, not outgoing..
Comment 5 Thomas Manninger 2013-02-14 15:45:07 CET
main.cf:
# some basic mail system settings
myhostname = dom0.tom.local
# mydomain is unset - The default is to use $myhostname minus the first component.
myorigin = dom0.tom.local
smtp_helo_name = hostname.domain.at


/etc/init.d/postfix restart

root@dom0:~# telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 dom0.tom.local ESMTP Postfix
Comment 6 Thomas Manninger 2013-02-14 15:50:00 CET
oh i see, by outgoing connections, it works correkt:

Feb 14 15:03:19 dom0 postfix/smtp[12404]: < mx00.gmx.net[213.165.67.114]:25: 220 gmx.net (mxgmx009) Nemesis ESMTP Service ready
Feb 14 15:03:19 dom0 postfix/smtp[12404]: > mx00.gmx.net[213.165.67.114]:25: EHLO hostname.domain.at
Feb 14 15:03:19 dom0 postfix/smtp[12404]: < mx00.gmx.net[213.165.67.114]:25: 250-gmx.net Hello hostname.domain.at [85.125.22.200]
Feb 14 15:03:19 dom0 postfix/smtp[12404]: < mx00.gmx.net[213.165.67.114]:25: 250 SIZE 157286400


but by incoming connections, the smtp clients see the local fqdn.
Comment 7 Thomas Manninger 2013-02-28 16:06:37 CET
can you integrate this ucr?
Comment 8 Dirk Ahrnke 2013-09-12 12:11:38 CEST
It might by questionable that changing $myhostname is a good idea to resolve the problems discussed here.
According to http://www.postfix.org/postconf.5.html#myhostname it is used by other configuration parameters and a change may lead to other problems.

As mentioned in #c1 "mail/smtp/helo/name" can be used to adjust the name for outbound connections.

Regarding #c6: Inbound clients will see the smtpd_banner. A change of the default behaviour is in a general way is requested in Bug 32444.
Comment 9 Sönke Schwardt-Krummrich univentionstaff 2016-10-20 11:10:26 CEST
*** Bug 22023 has been marked as a duplicate of this bug. ***
Comment 10 Stefan Gohmann univentionstaff 2017-06-16 20:39:01 CEST
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.

If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Comment 11 Stefan Gohmann univentionstaff 2017-08-08 07:09:46 CEST
This issue has been filed against UCS 3.1.

UCS 3.1 is out of maintenance and many UCS components have vastly changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen this issue. In this case please provide detailed information on how this issue is affecting you.