TempFileMode

Permissions for temporary files All versions

The TempFileMode option tells sendmail what mode (file permissions) to give its temporary files and its freeze file.[422] This TempFileMode option also sets the file permissions for delivery to files that do not already exist (and must therefore be created). Prior to V8.12, this option also set permission for queued files (see the QueueFileMode option, QueueFileMode on page 1071).

The forms of the TempFileMode option are as follows:

O TempFileMode=modeconfiguration file (V8.7 and later)
-OTempFileMode=modecommand line (V8.7 and later)
define(`confTEMP_FILE_MODE',`mode')   ← mc configuration (V8.7 and later)
OFmodeconfiguration file (old mode)
-oFmodecommand line (old mode)

The mode is of type octal. The default is 0600 (if the real-user-id is the same as the effective-user-id), and 0644 otherwise. If the mode has the group-writable bit set (as in 0664), the umask(2) is set to 0002 (disallow world-writable permissions) just prior to the open(2) or creat(2), and restored to its prior value just after. Be careful to not omit just the mode argument—if you do, the permissions become 0000, and sendmail might not be able to read or write its own files.

The TempFileMode option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

[422] * V8 sendmail no longer supports freeze files.

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.