Why do I need to set the myhostname variable in the postfix config file?

StackOverflow https://stackoverflow.com/questions/21082124

  •  27-09-2022
  •  | 
  •  

Вопрос

I am trying to set up postfix on an Amazon AMI, and the various documentation says to set the myhostname variable, and I can't understand why. When I run the hostname command on the shell, something like this is printed: ip-10-137-53-20. Therefore this information is already available to postfix. So why is everyone telling me to also specify it in the config file? What purpose does it serve?

Update: Please upvote the accepted answer. It's confirmed by postfix's MULTI_INSTANCE_README which reads:

Note: usually, you need to use different "myhostname" settings when you run multiple instances on the same host. Otherwise, there will be false "mail loops back to myself" alarms when one instance tries to send mail into another instance. Typically, the null-client instance will use the system's hostname, and other instances will use their own dedicated "myhostname" settings.

Это было полезно?

Решение

Hostname having harped on about the modular nature of postfix, it is only natural that the first setting we come to is hard coded...

In the case of multiple instance of postfix, in same server we need to set the hostname in postfix config file. Because in one server we can setup more than 1 postfix instance(ie,we can send mails for multiple domains).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top