sendmail domain

David L. Gehrt dlg at
Fri Dec 23 04:50:34 UTC 2005

> Alexander Dalloz wrote:
> >Am Do, den 22.12.2005 schrieb azeem ahmad um 16:23:
> >
> >  
> >
> >>i got a question n i studied for it but couldnt get satisfied
> >>the question is
> >>how sendmail server comes to know which domain it belongs to
> >>i mean if there is a server
> >>then how mail comes to know that it belongs to domain
> >>Regards
> >>Azeem
> >>    
> >>
> >
> >You have to tell Sendmail which domains have to be treated as local -
> >class {w} - or relay - class {R} - domains in a) local-host-names or b)
> >in relay-domains.
> >
> >Alexander
> >
> >
> >  
> >
> That is also what the MX record in a domain's DNS is for.
> Justin Willmert

Actually sendmail,in the absence of  any other attempt to inform it will
try to determine the short host name and domain name for system on which
it is  running.  [see  hostname (1)]. An  MX record only  identifies the
reference, and host  to which mail for a host  should be redirected.  As

hosta  [IN]	       MX	N,MXhost

When mail is directed to hosta (e.g. mailbox1 at hosta.domain1) it will get
sent to  MXhost (e.g. mailbox1 at MXhost.domain2)  assuming the preference,
N, is lower than the preferences for any other MX records owned by (for)
hosta.  The  two domains, do  main1 and domain2,  may or may not  be the

N.B.-- You should be careful about the way you specify host names in DNS
resource records, especially whether they are or are not FQDNs.

The DNS MX  resource record does not inform sendmail  of the domain name
of the host on which it is  running, hosta in the above example.  By the
time sendmail gets to looking up MX  stuff it will have come up with the
value  for the "$w"  macro.  It  has been  some time  since I  looked at
sendmail sources but IIRC the owner  of the A record is the way sendmail
would prefer to use in the absence of a more explicit setting of $w.


More information about the fedora-list mailing list