[comp.mail.sendmail] $=m class

msir@sulu.cc.rochester.edu (Mark Sirota) (09/27/90)

According to the SunOS 4.1 System & Network Administration manual, page 746,
the $=m class is a special class set to the domain name of this host.

Well, pardon me if I'm wrong, but isn't the domain name a singular value?
Shouldn't it therefore be a macro, not a class?  How is this class created,
exactly, and exactly what does it hold?  (I don't have sources.)  Is there a
debugging value that shows the definition of all macros and/or classes?

While I'm at it, I have a second question regarding hostnames.  The $w macro
is set to the hostname of this site.  For some sendmails, this is always the
short name, even if the hostname as reported by gethostbyname() contains the
domain.  For other sendmails, the entire hostname is stored.  This is an
annoying discrepancy between various sendmails...

In any case, the $=w class is supposed to be a special class set to all of
the names this host is known by.  Where does this information come from, and
for newer sendmails for which class tokens can contain dots, does this
include the domain name or not?  The same question abotu a debugging value
applies as above...

Thanks in advance.
--
Mark Sirota - University of Rochester Computing Center, Rochester NY
 Internet: msir@cc.rochester.edu
 Bitnet:   msir@uordbv.bitnet
 UUCP:     {decvax,harvard,ames,rutgers}!rochester!ur-cc!msir

rickert@mp.cs.niu.edu (Neil Rickert) (09/27/90)

In article <9629@ur-cc.UUCP> Mark Sirota <msir@cc.rochester.edu> writes:
>According to the SunOS 4.1 System & Network Administration manual, page 746,
>the $=m class is a special class set to the domain name of this host.
>
>Well, pardon me if I'm wrong, but isn't the domain name a singular value?
>Shouldn't it therefore be a macro, not a class?  How is this class created,

  Since this seems to work on Sun's, I guess it is ok for it to be a class.
Presumably Sun has installed some special purpose code in their versions of
sendmail to handle this.  Normally a class can only match a single token,
so this must be specially handled.  In other words it does not work like a
normal class.

>While I'm at it, I have a second question regarding hostnames.  The $w macro
>is set to the hostname of this site.  For some sendmails, this is always the
>short name, even if the hostname as reported by gethostbyname() contains the
>domain.  For other sendmails, the entire hostname is stored.  This is an
>annoying discrepancy between various sendmails...

  Older versions of sendmail set this to the hostname as reported by
gethostname() - not gethostbyname().  Versions which are designed to read
MX records from a name server set it to gethostbyname(gethostname()) - please
excuse the wrong argument types - so that it will be fully qualified.
When there are MX records, sendmail needs to be able to tell whether the
MX record is to the local host, so there is a comparison with the value
of $w, and this will only work correctly if $w is fully qualified.

  IMHO they should have done the comparison with $j, which would have
caused less trouble.  But presumably the programmers at Berkeley decided
that $w is more reliable since it is defined internally and $j is not.  I
think this was a mistake since the defined meaning of $j is more precise
than the defined meaning of $w.  (On the other hand an awful lot of systems
have $j wrongly defined - but then the same systems probably have $w wrongly
defined too).

>In any case, the $=w class is supposed to be a special class set to all of
>the names this host is known by.  Where does this information come from, and
>for newer sendmails for which class tokens can contain dots, does this
>include the domain name or not?  The same question abotu a debugging value
>applies as above...

 This is defined in code.  I haven't tested it, but it probably doesn't work
properly with MX versions where the hostname contains periods.  Get the
IDA versions of sendmail which allow $=x matches to work with multi-token
comparisons.  The '$=w' definitely works there.  However to match all names
of the host you will still need some 'Cw' lines in sendmail.cf.  They have
not yet fully implemented the RPM instruction (Read the Programmer's Mind).
-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115.                                  +1-815-753-6940

I.G.Batten@fulcrum.bt.co.uk (Ian G Batten) (09/27/90)

rickert@mp.cs.niu.edu (Neil Rickert) writes:
> sendmail to handle this.  Normally a class can only match a single token,
> so this must be specially handled.  In other words it does not work like a

Yes, it's in Sun's sendmail, but it came from IDA.  I use this feature
in my IDA sendmail config because I generate user%foo.bar@foo.bar at one
point in re-writing mail from local uucp feeds.  This works for Sun 4.0
and IDA, but not for other sendmails.  [[ And I know the side-effect of
this rule, and it's OK... ]]

CZcollins.uucp cobuild.uucp careful.uucp stade.uucp delluk.uucp
CZredact.uucp nan.uucp nan.co.uk rtp.uucp tigress.uucp cnix.uucp
R$-%$=Z@$=Z		$1@$2			quick fix

ian

dce@smsc.sony.com (David Elliott) (09/27/90)

In article <1990Sep26.220824.19155@mp.cs.niu.edu>, rickert@mp.cs.niu.edu (Neil Rickert) writes:
|> In article <9629@ur-cc.UUCP> Mark Sirota <msir@cc.rochester.edu> writes:
|> >According to the SunOS 4.1 System & Network Administration manual, page 746,
|> >the $=m class is a special class set to the domain name of this host.
|> >
|> >Well, pardon me if I'm wrong, but isn't the domain name a singular value?
|> >Shouldn't it therefore be a macro, not a class?  How is this class created,
|> 
|>   Since this seems to work on Sun's, I guess it is ok for it to be a class.
|> Presumably Sun has installed some special purpose code in their versions of
|> sendmail to handle this.  Normally a class can only match a single token,
|> so this must be specially handled.  In other words it does not work like a
|> normal class.

Actually, sendmail sets both $w and $=w.  This allows you to add
other mail domains that you are known by to the w class.

In the past, this has caused numerous problems with people who set
their YP domain to something other than their mail domain.  What
happened was that both class and variable w would be set to your
YP domain.  If, as the instructions instructed you, you set variable
w to your real mail domain, it didn't change class w, and this
caused problems in ruleset 6, which used class w.

I heard that Sun had changed something to fix this, but I don't recall
whether it was ruleset 6 or the way $w and $=w are handled.

--
...David Elliott
...dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
...(408)944-4073
...Krusty says: Give a hoot, read a book!

rickert@mp.cs.niu.edu (Neil Rickert) (09/27/90)

In article <1990Sep27.154352.14639@smsc.sony.com> dce@smsc.sony.com (David Elliott) writes:
>
>Actually, sendmail sets both $w and $=w.  This allows you to add
>other mail domains that you are known by to the w class.
>
>In the past, this has caused numerous problems with people who set
>their YP domain to something other than their mail domain.  What

  This is easily solved.  Just pick a different, currently unused
letter of the alphabet such as D.  Then change all occurences of
$w to $D, all occurrences of $=w to $=D, all occurences of $~w to $~D.

Make sure to include the correct DD and CD definitions.  Then it
doesn't matter what sendmail predefines $w as.

-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115.                                  +1-815-753-6940

dce@smsc.sony.com (David Elliott) (09/28/90)

In article <1990Sep27.165120.8941@mp.cs.niu.edu>, rickert@mp.cs.niu.edu (Neil Rickert) writes:
|> In article <1990Sep27.154352.14639@smsc.sony.com> dce@smsc.sony.com (David Elliott) writes:
|> >
|> >Actually, sendmail sets both $w and $=w.  This allows you to add
|> >other mail domains that you are known by to the w class.
|> >
|> >In the past, this has caused numerous problems with people who set
|> >their YP domain to something other than their mail domain.  What
|> 
|>   This is easily solved.  Just pick a different, currently unused
|> letter of the alphabet such as D.  Then change all occurences of
|> $w to $D, all occurrences of $=w to $=D, all occurences of $~w to $~D.

It's actually easier than that.  I just changed ruleset 6 to use $w
instead of $=w.

I posted the change to the net and sent it to Sun, and they informed me
that this was all better in 4.1.

-- 
...David Elliott
...dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
...(408)944-4073
...Krusty says: Give a hoot, read a book!