Univention Bugzilla – Bug 30350
myhostname in main.cf could be configurable via ucr
Last modified: 2017-08-08 07:09:46 CEST
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.
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.
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...
(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
smtp_helo_name only works with incoming connections, not outgoing..
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
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.
can you integrate this ucr?
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.
*** Bug 22023 has been marked as a duplicate of this bug. ***
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.
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.