edit added bbcode formated text. converted with Markdown to BBCode converter https://alfateam123.github.io/md2bbc/ + small fixes
thanks @ZhangHuangbin
The point is your hostname must be resolvable by DNS query and pointed to IP of your server, and vice verse.
servers native ip: 1.2.3.4 dns entry mail3.example.com -> 1.2.3.4
servers elastic ip: 4.3.2.1 dns & reverse dns mail.example.com <-> 4.3.2.1
both ips are connected to the same server.
So, better NOT do it as you described.
what would be the arguments for not doing it?
what about the other files like
and the spool/cached/binary files? how they get "regenerated"?
even i currently run the installer normal without changing hostname my postfix mail.cf looks like this:
...
# hostname
myhostname = mail3.example.com
myorigin = mail3.example.com
mydomain = mail3.example.com
...
mynetworks = 127.0.0.1
# Accepted local emails
mydestination = $myhostname, localhost, localhost.localdomain
...
the output of postconf locks strange. why is mydomain localdomain if i installed it with mail3.example.com which is also in my mail.cf?
postconf -d | grep -e "^my"
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = localdomain
myhostname = mail3.localdomain
mynetworks = 127.0.0.0/8 10.0.2.0/24 192.168.10.0/24
mynetworks_style = ${{$compatibility_level} < {2} ? {subnet} : {host}}
myorigin = $myhostname
just to add the infos i found out so far to help other people comming here later:
os is debian stretch (currently on vagrant)
https://wiki.debian.org/EtcMailName
files containing
(removed non relevant ones from list below)
root@mail3:~# grep -rnw / --exclude-dir={bin,boot,dev,lib,lib64,media,mnt,proc,sbin,sys,tmp,log,vmail,lvm,vagrant,puppetlabs,puppet-enc} -e 'mail3'
/etc/amavis/conf.d/50-user:12:$myhostname = 'mail3.example.com';
/etc/mailname:1:mail3.example.com
/etc/hostname:1:mail3
/etc/postfix/main.cf:237:myhostname = mail3.example.com
/etc/postfix/main.cf:238:myorigin = mail3.example.com
/etc/postfix/main.cf:239:mydomain = mail3.example.com
Binary file /etc/postfix/aliases.db matches
/etc/hosts:2:127.0.1.1 mail3.example.com mail3
/etc/hosts:3:192.168.10.10 mail3.example.com mail3
Binary file /etc/aliases.db matches
/root/___iRedMail-0.9.9/iRedMail.tips:152: - URL: https://mail3.example.com/iredadmin/
/root/___iRedMail-0.9.9/iRedMail.tips:163: - URL: http://mail3.example.com/mail/ (will be redirected to https:// site)
/root/___iRedMail-0.9.9/iRedMail.tips:164: - URL: https://mail3.example.com/mail/ (secure connection)
/root/___iRedMail-0.9.9/runtime/pkg.install.log:960:setting myhostname: mail3.example.com
/root/___iRedMail-0.9.9/runtime/pkg.install.log:964:setting destinations: $myhostname, mail3.example.com, localhost.example.com, , localhost
Binary file /opt/iRedAPD-2.7/settings.pyc matches
/opt/iRedAPD-2.7/settings.py:40:srs_domain = "mail3.example.com"
/var/spool/postfix/etc/hosts:2:127.0.1.1 mail3.example.com mail3
/var/spool/postfix/etc/hosts:3:192.168.10.10 mail3.example.com mail3
Binary file /var/cache/man/index.db matches
/var/cache/debconf/config.dat:388:Value: $myhostname, mail3.example.com, localhost.example.com, , localhost
/var/cache/debconf/config.dat:410:Value: mail3.example.com
/run/motd.dynamic:1:Linux mail3 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64
###############################################################################
orginal markdown post starts here
thanks @ZhangHuangbin
> The point is your hostname must be resolvable by DNS query and pointed to IP of your server, and vice verse.
servers native ip: 1.2.3.4 dns entry mail3.example.com -> 1.2.3.4
servers elastic ip: 4.3.2.1 dns & reverse dns mail.example.com <-> 4.3.2.1
both ips are connected to the same server.
> So, better NOT do it as you described.
what would be the arguments for not doing it? (if the ips and the reverse dns entries are correctly setup)
> yes.
what about the other files like `/etc/mailname` and the spool/cached/binary files? how they get "regenerated"?
even i currently run the installer normal without changing hostname my postfix mail.cf looks like this:
```
...
# hostname
myhostname = mail3.example.com
myorigin = mail3.example.com
mydomain = mail3.example.com
...
mynetworks = 127.0.0.1
# Accepted local emails
mydestination = $myhostname, localhost, localhost.localdomain
...
```
the output of postconf locks strange. why is mydomain localdomain if i installed it with mail3.example.com which is also in my mail.cf?
```
postconf -d | grep -e "^my"
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = localdomain
myhostname = mail3.localdomain
mynetworks = 127.0.0.0/8 10.0.2.0/24 192.168.10.0/24
mynetworks_style = ${{$compatibility_level} < {2} ? {subnet} : {host}}
myorigin = $myhostname
```
just to add the infos i found out so far to help other people comming here later:
os is debian stretch (currently on vagrant)
https://wiki.debian.org/EtcMailName
files containing `mail3` (removed non relevant ones from list below)
`root@mail3:~# grep -rnw / --exclude-dir={bin,boot,dev,lib,lib64,media,mnt,proc,sbin,sys,tmp,log,vmail,lvm,vagrant,puppetlabs,puppet-enc} -e 'mail3'`
```
/etc/amavis/conf.d/50-user:12:$myhostname = 'mail3.example.com';
/etc/mailname:1:mail3.example.com
/etc/hostname:1:mail3
/etc/postfix/main.cf:237:myhostname = mail3.example.com
/etc/postfix/main.cf:238:myorigin = mail3.example.com
/etc/postfix/main.cf:239:mydomain = mail3.example.com
Binary file /etc/postfix/aliases.db matches
/etc/hosts:2:127.0.1.1 mail3.example.com mail3
/etc/hosts:3:192.168.10.10 mail3.example.com mail3
Binary file /etc/aliases.db matches
/root/___iRedMail-0.9.9/iRedMail.tips:152: - URL: https://mail3.example.com/iredadmin/
/root/___iRedMail-0.9.9/iRedMail.tips:163: - URL: http://mail3.example.com/mail/ (will be redirected to https:// site)
/root/___iRedMail-0.9.9/iRedMail.tips:164: - URL: https://mail3.example.com/mail/ (secure connection)
/root/___iRedMail-0.9.9/runtime/pkg.install.log:960:setting myhostname: mail3.example.com
/root/___iRedMail-0.9.9/runtime/pkg.install.log:964:setting destinations: $myhostname, mail3.example.com, localhost.example.com, , localhost
Binary file /opt/iRedAPD-2.7/settings.pyc matches
/opt/iRedAPD-2.7/settings.py:40:srs_domain = "mail3.example.com"
/var/spool/postfix/etc/hosts:2:127.0.1.1 mail3.example.com mail3
/var/spool/postfix/etc/hosts:3:192.168.10.10 mail3.example.com mail3
Binary file /var/cache/man/index.db matches
/var/cache/debconf/config.dat:388:Value: $myhostname, mail3.example.com, localhost.example.com, , localhost
/var/cache/debconf/config.dat:410:Value: mail3.example.com
/run/motd.dynamic:1:Linux mail3 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64
```