Which domain and host in main.cf

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Which domain and host in main.cf

Henry
When reading through main.cf and configuring postfix I am unsure of
which domain, origin and hostname values to use.

For example say our public domain is mydomain.com and we have a
certificate for mail.mydomain.com and our MX points to
mail.mydomain.com

Our mail server called hermes runs our our lan who'se domain is mydomain.local

In main.cf is:
myorigin hermes.mydomain.local or mail.mydomain.com
myhostname hermes or mai
dydoman mydomain.local or mydomain.com

Thanks in advance...
Reply | Threaded
Open this post in threaded view
|

Re: Which domain and host in main.cf

Dominic Raferd
On 15 February 2017 at 10:51, Henry <[hidden email]> wrote:

> When reading through main.cf and configuring postfix I am unsure of
> which domain, origin and hostname values to use.
>
> For example say our public domain is mydomain.com and we have a
> certificate for mail.mydomain.com and our MX points to
> mail.mydomain.com
>
> Our mail server called hermes runs our our lan who'se domain is mydomain.local
>
> In main.cf is:
> myorigin hermes.mydomain.local or mail.mydomain.com
> myhostname hermes or mai
> dydoman mydomain.local or mydomain.com
>

I have a certificate for mydomain.tld (not for mail1.mydomain.tld) and
use as follows:
mydomain = mydomain.tld
myorigin = $mydomain
myhostname: hard coded to valid external fqdn for this machine - not
necessarily the reverse fqdn e.g. mail1.mydomain.tld
smtpd_banner: hard coded to the reverse fqdn for this machine as given
by, for instance: dig +short -x $(dig +short myip.opendns.com
@resolver1.opendns.com)

It doesn't matter that the certificate is not for the fqdn or reverse
fqdn of your server, but I think it is good that the server's
announced name is its real reverse fqdn, some senders might check
this.
Reply | Threaded
Open this post in threaded view
|

Re: Which domain and host in main.cf

Wietse Venema
In reply to this post by Henry
Henry:
> When reading through main.cf and configuring postfix I am unsure of
> which domain, origin and hostname values to use.

myhostname is the unique name that the MTA will use in a) server
greetings, b) EHLO commands, and c) in delivery status notifications.
Because of b) it is important that the name matches the IP address.

        Wietse

> For example say our public domain is mydomain.com and we have a
> certificate for mail.mydomain.com and our MX points to
> mail.mydomain.com
>
> Our mail server called hermes runs our our lan who'se domain is mydomain.local
>
> In main.cf is:
> myorigin hermes.mydomain.local or mail.mydomain.com
> myhostname hermes or mai
> dydoman mydomain.local or mydomain.com
>
> Thanks in advance...
>
Reply | Threaded
Open this post in threaded view
|

Re: Which domain and host in main.cf

Viktor Dukhovni
In reply to this post by Henry

> On Feb 15, 2017, at 5:51 AM, Henry <[hidden email]> wrote:
>
> For example say our public domain is mydomain.com and we have a
> certificate for mail.mydomain.com and our MX points to
> mail.mydomain.com

So far fairly typical.

> Our mail server called hermes runs our our lan whose domain is mydomain.local
>
> In main.cf is:
> myorigin hermes.mydomain.local or mail.mydomain.com

The "myorigin" parameter is used to add @domain qualifiers to
bare sender names, and so should be a domain you accept email
for (as opposed to a host other hosts connects to).  So typically,
these days, most sites have "myorigin = $mydomain" set to the
primary email domain for which the MTA accepts mail.

> myhostname hermes or mail

The myhostname parameter should be fully-qualified domain name
that matches the PTR record of the machine's primary external
IP address.  Otherwise, at least one of the MX hostnames of
the primary email domain.

> mydoman mydomain.local or mydomain.com

Same as myorigin, a public valid email domainname.

--
        Viktor.