[comp.mail.sendmail] Uid in sendmail and NFS

deb@zehntel.zehntel.com (Deborah Heller) (02/21/90)

> massey@ardent (Todd Massey) writes:
>
>  Have a symbolic link via NFS to /usr/spool/mail.
>  Now when a machine running sendmail recieves a mail message and tries
>  to place the file in /usr/spool/mail with nfs mount links, it has a 
>  uid of nobody (-2), the reason behind this is that nfs does not allow
>  root to write to nfs volume with root uid.  
>  The only way i have come
>  up with so far is to get the berkeley distribution of sendmail and
>  fix this problem.  

	You don't need a sledge hammer to kill a fly.  NFS mounts, by default,
	do not allow root access across NFS boundaries.  But WAIT!  We HAVE the
	technology.  When your server exports the file system to the client(s)
	mounting /usr/spool/mail, use options to allow access=root.  If you
	have SunOS, check the manual on mount and export and exportfs.  For
	other Unix systems with NFS, you have to check for the implemented
	options.  Ultrix uses somethings like " -r=uid " in /etc/exports.

	The technology is NOW.

>  The reason i am writing, is before doing this 
>  maybe someone else has come up with a better idea.

	Yup...

>  I have tried the u & g flags in sendmail and several other things.
>  Just send me any ideas at all.
>
	Forget this stuff.  Too complicated.


	Deb

	8-)

Deborah Heller				UUCP:  ...!{decwrl,sun}!teraida!deb
Teradyne Zehntel Systems Division	Phone: (415) 932-6900
2625 Shadelands Drive
Walnut Creek, CA  94598			 Horse Lovers Are Stable People...

lodin@plains.UUCP (Joe Schmo) (02/22/90)

I have a similar problem with sendmail and the lock file.  I have
a standalone system connected via LAN to my UUCP hub.  I have /users and
/usr/man mounted via NFS from the UUCP hub.  I receive the following error
from sendmail when I try to mail to a login at that machine.  
Mail from that machine works fine.

Aynbody have any answers???

Reply here or to:


Steven W. Lodin  
Delco Electronics Corp. Kokomo, IN
lodin%aiehost.uucp@iuvax.cs.indiana.edu or swlodin@koess.gm.hac.com


Example sendmail session:
==============================================================================
From MAILER-DAEMON%aiehost.uucp%aietwk1.uucp@iuvax.cs.indiana.edu Fri Feb 16 07:54:22 1990
Received: from iuvax.cs.indiana.edu by plains.NoDak.edu; Fri, 16 Feb 90 07:54:18 -0600
Message-Id: <9002161354.AA19414@plains.NoDak.edu>
Received: from aiehost by iuvax.cs.indiana.edu with UUCP
	(5.61+/1.4jsm) id AA10392; Fri, 16 Feb 90 08:54:36 -0500
Received: from aietwk1 (aietwk1) by aiehost; Fri, 16 Feb 90 08:53:01 est
Received: from aiehost (aiegate) by aietwk1; Fri, 16 Feb 90 09:55:22 est
Date: Fri, 16 Feb 90 07:49:13 -0600
From: Mail Delivery Subsystem <MAILER-DAEMON@aiehost.uucp>
Subject: Returned mail: unknown mailer error 2
To: <lodin@plains.NoDak.edu>
Status: RO

   ----- Transcript of session follows -----
mail: /usr/mail/lodin.lock not creatable after 10 tries
554 <lodin@aietwk1>... unknown mailer error 2

   ----- Unsent message follows -----
...  rest of message

per@erix.ericsson.se (Per Hedeland) (02/24/90)

In article <3741@zehntel.UUCP> deb@zehntel.zehntel.com (Deborah Heller) writes:
>       When your server exports the file system to the client(s)
>	mounting /usr/spool/mail, use options to allow access=root.

...provided your workstation users can't become root on their workstations
(which is far from trivial to prevent), or they can all (obviously)
read/modify/delete each others mail. (Also, I believe Sun's syntax is
root=client1:client2... up to a max of 10, and netgroups don't work...)

Regards
--Per Hedeland
per@erix.ericsson.se  or
per%erix.ericsson.se@uunet.uu.net  or
...uunet!erix.ericsson.se!per

adam@metaware.metaware.com (At these prices, I can't NAME names) (02/27/90)

In article <10261@ardent.UUCP> massey@ardent (Todd Massey) writes:
>
>Heres the problem:
>  Have a symbolic link via NFS to /usr/spool/mail.
>  Now when a machine running sendmail recieves a mail message and tries
>  to place the file in /usr/spool/mail with nfs mount links, it has a 
>  uid of nobody (-2), the reason behind this is that nfs does not allow

	On the machine that exports /usr/spool/mail edit the /etc/exports
file, add the option "anon=0" to the line that has /usr/spool/mail on it.
-- 
adam margulies                                    metaware incorporated
                                                  INTERNET: adam@metaware.com
                                                  UUCP:     uunet!metaware!adam
                                                  ATT:      (408)429-META x3016

viktor@melon.Princeton.EDU (Viktor Dukhovni) (02/27/90)

>In article <10261@ardent.UUCP> massey@ardent (Todd Massey) writes:
>>
>>Heres the problem:
>>  Have a symbolic link via NFS to /usr/spool/mail.
>>  Now when a machine running sendmail recieves a mail message and tries
>>  to place the file in /usr/spool/mail with nfs mount links, it has a 
>>  uid of nobody (-2), the reason behind this is that nfs does not allow

>	On the machine that exports /usr/spool/mail edit the /etc/exports
>file, add the option "anon=0" to the line that has /usr/spool/mail on it.
>-- 
>adam margulies                                    metaware incorporated
>                                                  INTERNET: adam@metaware.com
>                                                  UUCP:     uunet!metaware!adam
>                                                  ATT:      (408)429-META x3016

	There have been enough "wrong" solutions to this problem with
no correction to warrant a response (I usually avoid posting on the assumption
that I am the 100th one to say the same old thing)

	The "right" way to share /usr/spool/mail over NFS is for the 
clients to forward the mail to the server "via" SMTP!  Use mail protocols
for mail,  and file protocols for files!  This has many advantages:

1)  You do not have problems with allowing root access or restrictions
on the number of clients.

2)  The locking should work more reliably.

3)  With a little work (a few MX records) you can stop running "sendmail -bd"
on the client all together,   the client sendmail.cf (sample enclosed)
can be barebones simple!

	The only catch is to make the server recognize mail bound for the 
clients as "local",  you must define a class containing all the clients
you serve,  and resolve all members of that class to the local mailer,
talk to the nearest sendmail "guru" !

	Here is my "trivial" client sendmail.cf file,  works on
Irises,  NeXTs,  Suns,  Mips and Decstations,  (the master sendmail.cf
is much less portable,  trips over bugs in the various versions)

---------------Cut--------------
#  The .cf version for the SMTP banner
DZMath-Client
#  The local domain
DDPrinceton.EDU
#  The master's full name
DRmath.$D
#  Our official name!
Dj$w

##### MyName - Should be aliased to a real pereson
DnPostmaster
##### UNIX header format
DlFrom $g  $d
##### Delimiter characters (NONE! Don't need to look inside addresses)
Do
##### Format of a total name
Dq<$g>
##### SMTP login message
De$j Sendmail $v/$Z ready at $b
##### substitution for space (blank) characters
OB.
##### default delivery mode (deliver in background)
Odbackground
##### temporary file mode
OF0600
##### log level
OL9
##### default network name
ON$D
##### default messages to old style
Oo
##### queue directory
OQ/usr/spool/mqueue
##### read timeout
Or20m
##### queue up everything before starting transmission
Os
##### default timeout interval
OT3d
##### time zone names (V6 only)
OtEST,EDT
##### default UID
Ou1
##### default GID
Og1
##### wizard's password (disabled)
OW*
##### load average at which we just queue messages
Ox8
##### load average at which we refuse connections
OX12

#   Message precedences
Pfirst-class=0
Pspecial-delivery=100
Pbulk=-60
Pjunk=-100

#	Trusted users
Troot

##########################################################################
#	Format of headers
##########################################################################
H?P?Return-Path: <$g>
H?M?Received: $?sfrom $s $.by $j ($v/$Z)
	id $i; $b
H?D?Resent-Date: $a
H?D?Date: $a
H?F?Resent-From: $q
H?F?From: $q
H?x?Full-Name: $x
HSubject:
H?M?Resent-Message-Id: <$t.$i@$j>
H?M?Message-Id: <$t.$i@$j>

S3
R$*<$+>$*		$2			defocus for fullnames on master

##########################################################################
#####		RULESET ZERO - Select Mailer 
##########################################################################
S0
R$*			$#ether$@$R$:$1		punt to Relay

##########################################################################
#####  Nothing to do in Rulesets 1,2,4
##########################################################################
S1
S2
S4

##########################################################################
#####  Mailer Defs (R=1,S=1 could be any blank rule)
##########################################################################
Mlocal, P=/usr/lib/sendmail, F=DFILMmsuX, S=1, R=1, A=sendmail $n
Mprog,  P=/usr/lib/sendmail, F=DFILMmsuX, S=1, R=1, A=sendmail $n
Mether, P=[IPC], F=DFMmuex, S=1, R=1, A=IPC $h
--------------Cut---------------

-- 
	Viktor Dukhovni <viktor%math@princeton.edu>	: ARPA
		<...!uunet!princeton!math!viktor>	: UUCP
	Fine Hall, Washington Rd., Princeton, NJ 08544  : US-Post
		+1-(609)-258-5792		 	: VOICE

woods@ncar.ucar.edu (Greg Woods) (03/01/90)

In article <14116@phoenix.Princeton.EDU> viktor@melon.Princeton.EDU (Viktor Dukhovni) writes:
>
>>In article <10261@ardent.UUCP> massey@ardent (Todd Massey) writes:
>>>
>>>  Have a symbolic link via NFS to /usr/spool/mail.
>
>	The "right" way to share /usr/spool/mail over NFS is for the 
>clients to forward the mail to the server "via" SMTP!

  I agree completely. This is what I do here, and I sent this
suggestion to the original questioner as well by E-mail.

--Greg