[comp.mail.sendmail] dead.letter mode

dhesi@bsu-cs.UUCP (Rahul Dhesi) (11/13/88)

Using sendmail on a 4.3BSD system, I find that dead.letter is created
with mode 0666 allowing read and write access by all.  I would like to
change this to 0600 so only the owner has access to it.  Can't find any
code for this in sendmail;  where should I look and what's the easiest
way to change it?  (Ideal would be something to put in sendmail.cf so
we don't need to recompile sendmail.)

I did try saying "-oF0600" when invoking sendmail, which sets the mode
of temporary files to 0600.  It didn't affect the mode of dead.letter.

(Once dead.letter is created in the user's directory and its mode
changed to 0600, it remains so, but this is not the best solution
because eventually dead.letter will grow and get deleted by the user.)
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee}!bsu-cs!dhesi

aat@mace.cc.purdue.edu (Jeff Smith) (11/13/88)

In article <4711@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes:
>code for this in sendmail;  where should I look and what's the easiest

in mailfile() in deliver.c, change stb.st_mode to whatever you want.
I don't think there's a way to do this in the cf file.  There's no
provision for it in the code, at least.

Jeff Smith, CC.Purdue.EDU Postmaster

jep@fantasci.UUCP (Joseph E Poplawski) (11/19/88)

In article <4711@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes:
>
>(Once dead.letter is created in the user's directory and its mode
>changed to 0600, it remains so, but this is not the best solution
>because eventually dead.letter will grow and get deleted by the user.)

Well, I can't help you with your primary question but from this last paragraph,
you could suggest to your users what I do here on my system.  Create a file
called dead.letter in each users home directory, then change the permissions to
whatever you or they desire.  Then from cron every week, you can have the file
nulled out by 'cat /dev/null >$HOME/dead.letter' or you can have the file sent
to the user via mail first then null it out.  This will keep the file there on
a constant basis with the permissions you want.  It works real well here with
the exception that I have it null'ed once a day.

Hope this helps...

-Jo

-------------------------------------------------------------------------------
|  Joseph E Poplawski  (Jo)                   US Mail:  1621 Jackson Street   |
|                                                       Cinnaminson NJ 08077  |
|  UUCP:..!rutgers!rochester!moscom!telesci!fantasci!jep                      |
|       ..!princeton!telesci!fantasci!jep                                     |
|       ..!pyrnj!telesci!fantasci!jep           Phone:  +1 609 786-8099 home  |
-------------------------------------------------------------------------------
|                     He who dies with the most toys wins!                    |
-------------------------------------------------------------------------------
|         Copyright (C) 1988  Joseph E Poplawski  All rights reserved.        |
-------------------------------------------------------------------------------

allbery@ncoast.UUCP (Brandon S. Allbery) (11/20/88)

As quoted from <4711@bsu-cs.UUCP> by dhesi@bsu-cs.UUCP (Rahul Dhesi):
+---------------
| Using sendmail on a 4.3BSD system, I find that dead.letter is created
| with mode 0666 allowing read and write access by all.  I would like to
| change this to 0600 so only the owner has access to it.  Can't find any
| code for this in sendmail;  where should I look and what's the easiest
| way to change it?  (Ideal would be something to put in sendmail.cf so
| we don't need to recompile sendmail.)
+---------------

You didn't find the code in sendmail because it's in binmail.

++Brandon
-- 
Brandon S. Allbery, comp.sources.misc moderator and one admin of ncoast PA UN*X
uunet!hal.cwru.edu!ncoast!allbery  <PREFERRED!>	    ncoast!allbery@hal.cwru.edu
allberyb@skybridge.sdi.cwru.edu	      <ALSO>		   allbery@uunet.uu.net
comp.sources.misc is moving off ncoast -- please do NOT send submissions direct
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>.