How to change postfix host?

Discussion in 'Installation/Configuration' started by kanour, Jun 30, 2019.

  1. kanour

    kanour Member

    Hi.
    I installed ispconfig as ns1.mydomain.tld.
    Currently emails are send from ns1.mydomain.tld (postfix has myhostname = ns1.mydomain.tld in config)
    How can change the host from ns1.mydomain.tld to mail.mydomain.tld only for the postfix? Do I have to manually edit /etc/postfix/main.cf, /etc/mailname or is there any specific setting in ISPConfig?

    Also what MX record do you use for the virtual hosts? Do you use mail.virtualdomain.tld or do you use the ISPConfig server mail.mydomain.tld?

    Thank you Jiri
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You did not bother to mention what Operating System that host has, so advice may not be accurate. But edit /etc/postfix/main.cf, find line
    Code:
    myhostname = something
    and alter that something to be mail.mydomain.tld.
    I Use the mail server FQDN. In your case mail.mydomain.tld.
     
  3. kanour

    kanour Member

    Hi.
    I run in on Debian. Okay, so we can just change it in postfix and it will not be overwritten by ISPConfig. Thank you.
    Regarding the other domains:
    ISPconfig Server: NS ns1.mydomain.tld, MX mail.mydomain.tld
    Virtual domain: NS ns1.mydomain.tld, MX mail.virtualdomain.tld OR mail.mydomain.tld

    They both will work because the IP address is the same, but as Postfix is sending the emails from mail.mydomain.tld, I thought that MX pointing to mail.mydomain.tld is better option for the virtual domain. Or it does not matter at all?
    Thx Jiri
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    It has to be that way.
    Use mail.mydomain.tld for all your domains that use e-mail as MX. Trying to use mail.virtualtomain.tld lead to complications and current version of Postfix needs separate IP-address for each MX.
     

Share This Page