Subject: re: 4.05 wierdness

From: Ian Hall-Beyer <[email-masked]>
Date: Tue, 29 Sep 1998 11:01:31 -0600 (MDT)

well, I set the permissions on my mail directory to 1777, and it's still
whining at me.

Note to the developers: This was fine in 4.00-4.04, what did you do to
4.05 to break it?

-Ian

---

From: Tawfik Daoud <[email-masked]>
Date: Tue, 29 Sep 1998 19:35:54 +0000 (WET)

> well, I set the permissions on my mail directory to 1777, and it's still

I guess you did change the permissions in your directory
(/home/login_name/mail). That is not the case, you (or the system
administrator) should change the permission in the directory where all the
users INBOX files are stored, most probably at /var/spool/mail
-Tawfik
_______________________________________
Tawfik H. Daoud
Cyber Mania - Internet Service Provider
68, Avenue Mohamed V,
93000 Tetouan, Morocco
Telephone: +212.9.704987
Fax: +212.9.965883
E-mail: [email-masked]
http://www.cybermania.net.ma

---

From: Ian Hall-Beyer <[email-masked]>
Date: Tue, 29 Sep 1998 18:35:28 -0600 (MDT)

> users INBOX files are stored, most probably at /var/spool/mail

let me get this straight. they want me to set a SYSTEM-WIDE mail folder
world-writable and readable?.

I'm not sure what these guys are smoking, but it must be good and I want
some. That is a security hole big enough to drive a semi through.

-Ian

---

From: Terry Gray <[email-masked]>
Date: Tue, 29 Sep 1998 21:13:11 -0700 (Pacific Daylight Time)

No, you don't have it straight.  PLEASE read the release notes.  The
spool *directory* should be 1777, mail folders should be 600.

-teg

---

From: Tawfik Daoud <[email-masked]>
Date: Wed, 30 Sep 1998 11:38:54 +0000 (WET)

> some. That is a security hole big enough to drive a semi through.

I have already told you in a previous mail that setting the
/var/spool/mail directory to 1777 does not mean that all files included
within that directory (INBOX files) inherit the same mode 1777. Still
users can create a lock file and read their own mail file, but not other
mail files.
-Tawfik
_______________________________________
Tawfik H. Daoud
Cyber Mania - Internet Service Provider
68, Avenue Mohamed V,
93000 Tetouan, Morocco
Telephone: +212.9.704987
Fax: +212.9.965883
E-mail: [email-masked]
http://www.cybermania.net.ma

---

From: Tim DiLauro <[email-masked]>
Date: Wed, 30 Sep 1998 09:38:04 -0400 (EDT)

> some. That is a security hole big enough to drive a semi through.

Ian:

Clearly you are not understanding something here.

The idea is to set the mail spool directory so that any user can create a
new file in it.  This is needed so that Pine can write its lock file.  And
mode 1777 does not mean world writeable, although it might look that way.
Mode 1777 means that any user can create/rename/delete (basically do
directory operations for) a file that is owned by that user.  You can't do
these things to other people's files.

Individuals mailboxes should have the protections that they need to work
with your mail system -- ideally they are mode 600 (read/write by the
owner only).

I hope this clears things up for you.

<pulpit>
By the way: I think the bit about "what these guys are smoking" is
uncalled for.  Just because you don't understand something doesn't mean
you should be lashing out.  Close your mouth/keyboard and listen to the
good advice of people who have been doing this for a long time.
</pulpit>

-timmo

-- 
-------------------------------------------------------------------
Tim DiLauro                          Milton S. Eisenhower Library
Library Systems Jack                 Johns Hopkins University
(410) 516-5263                       3400 N. Charles Street
[email-masked]                        Baltimore, MD  21218
-------------------------------------------------------------------

---

From: Mike Brudenell <[email-masked]>
Date: Wed, 30 Sep 1998 17:54:40 +0100

Hmmm.....

> Clearly you are not understanding something here.

I actually think that something has been missed off the previous
discussions...

> these things to other people's files.

This last sentence is true IF AND ONLY IF someone's mailbox exists.

Consider a mode 1777 /var/spool/mail and username abc1.

If abc1 has a /var/spool/mail/abc1 file owned by themself and protected 600
then things are hynky dory.  As people have pointed out Pine (etc) can
create lock files in the /var/spool/mail directory and be happy.

The problem arises if abc1 does NOT have a /var/spool/mail/abc1.  Then any
other user can create such a file themselves (and it will be owned by
them).  Suppose naughty user xyz1 did this.  That is:

	/var/spool/mail/abc1 exists, is mode 600,  but is owned by xyz1.

At worst mail for abc1 will continue to be delivered into
/var/spool/mail/abc1.  However abc1 has no access to it, and xyz1 can
instead happily read it.

At best your final mail delivery software will refuse to write the incoming
mail into the /var/spool/mail/abc1 because it detects it is not owned by
the correct username.  The result is xyz1 has caused a denial of (mail)
service for abc1.

I seem to recall that previous advice given on this list be Mark Crispin
(the Great Guru in these matters) gives a TWO-FOLD requirement for
invulnerability (possibly more: memory is hazy).  Viz:

	1.  /var/spool/mail is 1777 (as already stated in previous threads)

	2.  Every user has a file present, and set up with correct owner and
	    mode, in /var/spool/mail

[2] has a hidden corollary: the file must not get deleted (otherwise you
are back in the dubious situation I describe above.  Thus some mail clients
(eg, "mail"?) which delete a spool file when it becomes empty should be
discouraged or removed from user access.

You should also consider, of course, whether you want a 1777
/var/spool/mail directory with direct user access (eg, on user-accessible
disk).  Usually /var/spool/mail doesn't have quotas enabled on it, which
would in effect mean that any use could places file/directories in it and
have an unlimited storage space akin to /tmp but without risk of files
being automatically deleted (unless you check for them!).

The way around the latter would be to have the mail spool disk as a local
mount on a mail server computer running an IMAP server.  You then:
	*   Don't let users login to this system;
	*   Don't mount the mail spool disk elsewhere (eg, over NFS);
	*   Only give access to mail via IMAP.

> with your mail system -- ideally they are mode 600 (read/write by the

Agreed.

As I say, I think the problem is that the preceding flurry of articles have
only been considering [1], with one party being aware of the consequential
problems and the other party (presumably) unaware or unconcerned ... hence
the name-calling etc.

Cheers,

Mike B-)
--
The Computing Service, University of York, Heslington, York, Yo10 5DD, UK
Tel:+44-1904-433811   Fax:+44-1904-433740    http://www.york.ac.uk/~pmb1/
*******  Unsolicited commercial/bulk e-mail is NOT welcome here!  *******

---

From: "Colin J. Raven" <[email-masked]>
Date: Wed, 30 Sep 1998 09:55:31 -0700

Actually, IMHO I got a mild chuckle from that, *in addition* to learning
something that I didn't know before.
Isn't *that* the point?
Ummm...maybe I have it all wrong, but what was written didn't sound like
(look like) a flame.
This list has known flaming...serious cases of it in fact, and that post
didn't fit the category.
As always, just my $0.02 worth
Regards,
-Colin
---
Colin J. Raven
Operations Manager, HDS Lab, Inc.
Costa Mesa, CA  |  Harrison, NY
"Maam, I didn't hurl on your couch on purpose, it was the Tequila and
Guinness that did it" [circa Aug 1996]
(Fred Pasternack 1952-1998, UNIX Guru, Perl hacker, and Industrial Strength
party animal)

---

From: Carmen Dennis <[email-masked]>
Date: Wed, 30 Sep 1998 14:26:20 -0400

Does anybody know of a way, using PINE, to only accept messages within a
certain size limit OR how to filter out messages from a specified
recipient.

Thanks,
Carmen Dennis

---

From: Ian Hall-Beyer <[email-masked]>
Date: Wed, 30 Sep 1998 18:18:11 -0600 (MDT)

> certain size limit OR how to filter out messages from a specified

AFAIK, Pine does not do this natively. This is the domain of mail
processors such as procmail. I can't remember the URL off the top of my
head, but there is a good FAQ on setting up filters using procmail.

-Ian

---

From: Michael Thomas Cope <[email-masked]>
Date: Wed, 30 Sep 1998 20:11:28 -0700 (PDT)

> certain size limit OR how to filter out messages from a specified
Pine does not do filtering. 
http://www.washington.edu/pine/faq/
number 4.12

I would suggest using procmail available from
ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/

For some good infomation see  
http://www.ii.com/internet/robots/procmail/

We use procmail at Harvey Mudd for home directory delivery of mail (which
eliminates the 1777 question and allows us to give users a quota on one
fewer filesystem).  The procmail install docs detail how to do this.
It can also be run individually from a .forward file.  
-Mike
-- 
Michael Cope: Harvey Mudd College '00; Armand Hammer UWC '96
E-mail: [email-masked]