Network-wide Mail Spool?

Neil Rickert rickert at mp.cs.niu.edu
Thu Nov 8 04:49:46 AEST 1990


In article <KARL.90Nov7120404 at giza.cis.ohio-state.edu> karl_kleinpaste at cis.ohio-state.edu writes:
>Any reason why one couldn't place symlinks:
>
>	cd /usr/spool/mail
>	foreach i (*)
>		mv $i ~{$i}/.newmail
>		ln -s ~{$i}/.newmail $i
>	end
>	chmod 555 /usr/spool/mail	# to prevent removal of the links.
>
>That's a serious question; I've been debating this for a while.  We'd
>like users' mail not to occupy space in a public filesystem, but
>rather take up space under the area where quotas are enforced.

 The only reason I can think of is the following code in /bin/mail (which
is usually used for final delivery to the mail spool file).  The function
safefile() is called to validate the mailbox before the incoming mail is
written to it.

 -------------------------------------------------------------
safefile(f)
	char *f;
{
	struct stat statb;

	if (lstat(f, &statb) < 0)
		return (1);
	if (statb.st_nlink != 1 || (statb.st_mode & S_IFMT) == S_IFLNK) {
		fprintf(stderr,
		    "mail: %s has more than one link or is a symbolic link\n",
		    f);
		return (0);
	}
	return (1);
}

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



More information about the Comp.unix.admin mailing list