''$j'' '''


Our official canonical name All versions

The $j macro is used to hold the fully qualified domain name of the local machine. V8 sendmail automatically defines $j to be the fully qualified canonical name of the local host.[17] However, you can still redefine $j if necessaryfor example, if sendmail cannot figure out your fully qualified canonical name, or if your machine has multiple network interfaces and sendmail chooses the name associated with the wrong interface.

[17] Prior to V8, $j had to be defined in the configuration file.

A fully qualified domain name is one that begins with the local hostname, which is followed by a dot and all the components of the local domain.

The hostname part is the name of the local machine. That name is defined at boot time in ways that vary with the version of Unix you are using.

The local domain refers to the DNS domain, not to the NIS domain. If DNS is running, the domain is defined in the /etc/resolv.conf file. For example:

domain wash.dc.gov

At many sites the local hostname is already fully qualified. To tell whether your site uses just the local hostname, run sendmail with a -d0.4 switch:

% /usr/sbin/sendmail -d0.4 -bt < /dev/null 
canonical name: wash          not fully qualified (and wrong!)
canonical name: wash.dc.gov   fully qualified (correct)

The $j macro is used in two ways by sendmail. Because $j holds the fully qualified domain name, sendmail uses that name to avoid making SMTP connections to itself. It also uses that name in all phases of SMTP conversations that require the local machine's identity. One indication of an improperly formed $j is the following SMTP error:

553 5.0.0 wash.dc.gov.dc.gov hostname configuration error

Here, $j was wrongly defined by adding the local domain to a $w that already included that domain:

# Our domain
# Our fully qualified name

One way to tell whether $j contains the correct value is to send mail to yourself. Examine the Received: headers. The name of the local host must be fully qualified where it appears in them:

Received: by wash.dc.gov    ...other text here
             must be a fully qualified domain name

$j is also used in the Message-ID: header definition.

The $j macro must never be defined in the command line. $j must appear at the beginning of the definition of the SmtpGreetingMessage option (formerly $e, SmtpGreetingMessage).

Beginning with V8.7, and in the rare event that you need to give $j a value, you can do so in your mc configuration file like this:

dnl Here at your.domain we hardwire the domain.
define(`confDOMAIN_NAME', `your.domain')

    Part I: Build and Install
    Part II: Administration
    Part III: The Configuration File
    Chapter 21. The D (Define a Macro) Configuration Command
    Chapter 24. The O (Options) Configuration Command