[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mailrm, mailbox and /dev/null

> Uhmmm, seems that with 2.99.50-s4, ta/mailbox refuses to send mail to
> /dev/null, so I can't cancel messages anymore with mailrm...

	And what is the error message ?
		"Mail to file disallowed w/o proper privileges"

	That behaviour comes from having recipient privilege of "nobody",
	which is a pariah user that is not allowed to do certain things,
	like write to any file.

	Within the mailbox.c there is one instance of "TO_FILE:" tag.
	I added following explicite code on it:

	case TO_FILE:		/* append to file */

	  /* Solaris has "interesting" /dev/null -- it is a symlink
	     to the actual device.. So lets just use that magic
	     name and create a FAST "write" to  /dev/null..  */
	  if (strcmp(usernam,"/dev/null") == 0) {
			 "2.2.0 (delivery successfull)",
			 "x-local; 250 (Delivered successfully)");
	    DIAGNOSTIC(rp, usernam, EX_OK, "Ok", 0);

	This is actually copied (with small edit) from about 170 lines
	further down, and this will now likely obsolete that latter

	This explicite test for "/dev/null" target is done before
	analysis of user privilege, and thus "allow" writing to /dev/null.

> alfredo

/Matti Aarnio