home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / mail / delivery / deliver.tz / deliver / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-07  |  10.7 KB  |  367 lines

  1. /* $Header: config.h,v 2.10 90/05/03 10:28:48 chip Exp $
  2.  *
  3.  * Deliver configuration.
  4.  *
  5.  * $Log:    config.h,v $
  6.  * Revision 2.10  90/05/03  10:28:48  chip
  7.  * Add UUCP configuration.
  8.  * 
  9.  * Revision 2.9  90/03/06  12:21:08  chip
  10.  * Move logging into log.c and address parsing into addr.c.
  11.  * New: error delivery file for messages that fail.
  12.  * Major rearrangement of delivery file code.
  13.  * 
  14.  * Revision 2.8  90/02/23  14:16:39  chip
  15.  * Support "#!" in delivery files.
  16.  * Support "user|program" and "user?error" from delivery files.
  17.  * Improve debugging and error message formatting.
  18.  * Rearrange code for clarity.
  19.  * 
  20.  * Revision 2.7  90/02/06  11:56:37  chip
  21.  * Enforce MBX_MODE regardless of UMASK.
  22.  * Enforce ordered logging with a log lockfile.
  23.  * Revise log format.
  24.  * 
  25.  * Revision 2.6  89/12/14  17:42:25  network
  26.  * Rework setvbuf() configuration to avoid errors.
  27.  * 
  28.  * Revision 2.5  89/11/10  12:23:49  network
  29.  * Handle recursion.
  30.  * 
  31.  * Revision 2.4  89/11/01  10:33:36  network
  32.  * Add UMASK, LOG, ERRLOG.
  33.  * 
  34.  * Revision 2.3  89/09/29  18:16:52  network
  35.  * Save message when delivery file produces no output,
  36.  * unless delivery file output the "DROP" string.
  37.  * Don't recopy temp files for sys and post-user delfiles.
  38.  * 
  39.  * Revision 2.2  89/06/09  13:07:38  network
  40.  * Adapt to BSD quirks.
  41.  * 
  42.  * Revision 2.1  89/06/09  12:25:11  network
  43.  * Update RCS revisions.
  44.  * 
  45.  * Revision 1.11  89/06/09  12:23:38  network
  46.  * Baseline for 2.0 release.
  47.  * 
  48.  */
  49.  
  50. /*----------------------------------------------------------------------
  51.  * SCO Xenix System V compilers define M_SYSV, which implies USG.
  52.  */
  53.  
  54. #ifdef M_SYSV
  55. #ifndef USG
  56. #define USG
  57. #endif
  58. #endif
  59.  
  60. /*----------------------------------------------------------------------
  61.  * Trusted users.
  62.  * Deliver permits "trusted" users to specify delivery filenames
  63.  * without renouncing setuid privileges.  Essentially, these users
  64.  * are given the root password.  Beware!
  65.  */
  66.  
  67. #define TRUSTED_USERS   "root"
  68.  
  69. /*----------------------------------------------------------------------
  70.  * Signal function type.
  71.  * Signal catching routines have this return value.
  72.  * (For System V Release 3.0 or later, use "void".)
  73.  */
  74.  
  75. #ifdef USG
  76. # define SIGTYPE void
  77. #else
  78. # define SIGTYPE int
  79. #endif
  80.  
  81. /*----------------------------------------------------------------------
  82.  * Argument order for setvbuf():
  83.  *     SETVBUF_BUF_TYPE     (.., buf, type, ..)         (Correct)
  84.  *     SETVBUF_TYPE_BUF     (.., type, buf, ..)         (Broken)
  85.  *
  86.  * Broken systems that need SETVBUF_TYPE_BUF include:
  87.  *     SCO Xenix development system 2.2
  88.  *     SysVR3.0 (Probably)
  89.  *     SysVR3.1 (Maybe)
  90.  *
  91.  * If neither is defined, then setvbuf() will not be called.
  92.  * >>> Be sure to get this one right, or the program will dump core. <<<
  93.  */
  94.  
  95. #define SETVBUF_BUF_TYPE
  96. /* #define SETVBUF_TYPE_BUF */
  97.  
  98. /*----------------------------------------------------------------------
  99.  * Signal function declaration.
  100.  * Define this if your <signal.h> doesn't declare signal() correctly.
  101.  */
  102.  
  103. /* #define DECLARE_SIGNAL */
  104.  
  105. /*----------------------------------------------------------------------
  106.  * Signal flag type.
  107.  * Variables of this type may be set by signal catching routines.
  108.  */
  109.  
  110. #if __STDC__
  111. #define SIGFLAG sig_atomic_t
  112. #else
  113. #define SIGFLAG short   /* or "volatile short" for aggressive optimizers */
  114. #endif
  115.  
  116. #undef SIGFLAG
  117. #define SIGFLAG short
  118.  
  119. /*----------------------------------------------------------------------
  120.  * Various kinds of mailbox locking.
  121.  * You may define one or both of ML_DOTLOCK and ML_DOTMLK.
  122.  * You may define no more than one of ML_FCNTL, ML_LOCKF and ML_LOCKING.
  123.  *
  124.  * File creation locking:
  125.  *     ML_DOTLOCK   create <mailbox>.lock       (most systems except BSD4.3)
  126.  *     ML_DOTMLK    create /tmp/<basename>.mlk  (Xenix)
  127.  *
  128.  * Kernel record locking:
  129.  *     ML_FCNTL     lock with fcntl(F_SETLKW)   (SVID systems only)
  130.  *     ML_LOCKF     lock with lockf(F_LOCK)     (SVID systems only)
  131.  *     ML_LOCKING   lock with locking(LK_LOCK)  (Xenix systems only)
  132.  */
  133.  
  134. #ifdef M_XENIX
  135. #define ML_DOTMLK
  136. #define ML_LOCKING
  137. #else
  138. #define ML_DOTLOCK
  139. #endif
  140.  
  141. /*----------------------------------------------------------------------
  142.  * Maximum filename length.
  143.  * Note that this is for _filenames_, not _pathnames_.
  144.  * For AT&T file systems, the usual value is 14.
  145.  * For Berzerkley file systems, use something big like 255.
  146.  */
  147.  
  148. #ifdef BSD
  149. #define MAX_NAMESIZE    255
  150. #else
  151. #define MAX_NAMESIZE    14
  152. #endif
  153.  
  154. /*----------------------------------------------------------------------
  155.  * How to get the host name.
  156.  * Define one.
  157.  *
  158.  * HOSTFILE             file containing name    (Xenix)
  159.  * UNAME                uname()                 (System V)
  160.  * GETHOSTNAME          gethostname()           (BSD)
  161.  * HOSTNAME             host name string        (V7)
  162.  */
  163.  
  164. #ifdef M_XENIX
  165. #define HOSTFILE   "/etc/systemid"
  166. #else
  167. #ifdef USG
  168. #define UNAME
  169. #else
  170. #ifdef BSD
  171. #define GETHOSTNAME
  172. #else
  173. #define HOSTNAME   "mxd120"
  174. #endif
  175. #endif
  176. #endif
  177.  
  178. /*----------------------------------------------------------------------
  179.  * Is <varargs.h> or <stdarg.h> available?
  180.  */
  181.  
  182. #if __STDC__
  183. #define HAS_STDARG
  184. #else
  185. #ifdef USG
  186. #define HAS_VARARGS
  187. #else
  188. #ifdef BSD
  189. #define HAS_VARARGS
  190. #endif
  191. #endif
  192. #endif
  193.  
  194. /*----------------------------------------------------------------------
  195.  * Are vprintf() and friends available?
  196.  */
  197.  
  198. #ifdef USG
  199. #define HAS_VPRINTF
  200. #endif
  201.  
  202. /*----------------------------------------------------------------------
  203.  * Is putenv() available?
  204.  */
  205.  
  206. #ifdef USG
  207. #define HAS_PUTENV
  208. #endif
  209.  
  210. /*----------------------------------------------------------------------
  211.  * Is getopt() available?
  212.  */
  213.  
  214. #ifdef USG
  215. #define HAS_GETOPT
  216. #endif
  217.  
  218. /*----------------------------------------------------------------------
  219.  * UUCP configuration.
  220.  *
  221.  * UUCP_NAMESIZE        Maximum size of a UUCP system name.
  222.  * UUX_OPTS             Options for uux; "-r" means queue but don't call.
  223.  * UUX_ARGCOUNT         Maximum count of arguments for uux.
  224.  * UUX_ARGSIZE          Maximum total size of arguments for uux.
  225.  */
  226.  
  227. #define UUCP_NAMESIZE 16
  228. #define UUX_OPTS      "-r"
  229. #define UUX_ARGCOUNT  16
  230. #define UUX_ARGSIZE   512
  231.  
  232. /*----------------------------------------------------------------------
  233.  * Default shell for executing delivery files and pipes.
  234.  * (Now that Deliver recognizes the "#!" hack, this value is less
  235.  * important than it used to be.)
  236.  * Note that the default shell must support the "-c" option.
  237.  */
  238.  
  239. #define SHELL   "/bin/sh"
  240.  
  241. /*----------------------------------------------------------------------
  242.  * Safe directories for child processes' PATH variables.
  243.  * Note that including "." is a security hole.
  244.  * For the superuser, "/etc:" is automatically prepended.
  245.  */
  246.  
  247. #ifdef BSD
  248. #define SAFEPATH  "/bin:/usr/ucb:/usr/bin"
  249. #else
  250. #define SAFEPATH  "/bin:/usr/bin"
  251. #endif
  252.  
  253. /*----------------------------------------------------------------------
  254.  * File creation mask.
  255.  * Bits turned on here are turned off in newly created files.
  256.  * This mask is the default when executing delivery files,
  257.  * but mailboxes have their own mode value (MBX_MODE).
  258.  */
  259.  
  260. #define UMASK   022
  261.  
  262. /*----------------------------------------------------------------------
  263.  * Recursion limit.
  264.  * If Deliver detects recursion deeper than this value,
  265.  * it will assume infinite recursion and abort.
  266.  */
  267.  
  268. #define REC_LIMIT  8
  269.  
  270. /*----------------------------------------------------------------------
  271.  * Characters that may not appear in addresses.
  272.  * (This string should include all metacharacters for your chosen shell.)
  273.  */
  274.  
  275. #define SANITIZE   "$*?=\\`'\"|^&;{}()<> \t\n"
  276.  
  277. /*----------------------------------------------------------------------
  278.  * Standard mailbox location.
  279.  *
  280.  * Define either MBX_NAME or MBOX_DIR.
  281.  * If MBX_NAME is defined, then the default mailbox is a file with
  282.  * that name in the user's home directory.
  283.  * If MBX_DIR is defined, then the default mailbox is a file in that
  284.  * directory with the same name as the user.
  285.  *
  286.  * Define MBX_GROUP if all mailboxes must be owned by a specific group.
  287.  * (System V requires this feature.)  If MBX_GROUP is not defined,
  288.  * mailboxes will have their groups set to the recipients' default group.
  289.  *
  290.  * Define MBX_MODE to the file access modes for new mailboxes.
  291.  * (System V requires group write permissions, i.e. 0020.)
  292.  *
  293.  * Define MBX_UNDEL to the mailbox for undelivered mail.
  294.  */
  295.  
  296. #if defined(USG) && !defined(M_XENIX)
  297. /* #define MBX_NAME   "mbox" */
  298. #define MBX_DIR     "/usr/mail"
  299. #define MBX_MODE    0660
  300. #define MBX_GROUP   "mail"
  301. #else
  302. /* #define MBX_NAME   "mbox" */
  303. #define MBX_DIR     "/usr/spool/mail"
  304. #define MBX_MODE    0600
  305. #endif
  306.  
  307. #undef MBX_DIR
  308. #undef MBX_MODE
  309. #undef MBX_GROUP
  310. #define MBX_DIR     "/usr/mail"
  311. #define MBX_MODE    0660
  312. #define MBX_GROUP   "mail"
  313.  
  314. #define MBX_UNDEL     "Undel.mail"
  315.  
  316. /*----------------------------------------------------------------------
  317.  * Delivery file directives.
  318.  * When delivery files output these strings as "user names", they
  319.  * are considered instructions.
  320.  */
  321.  
  322. #define DFILE_DROP    "DROP"            /* Drop this message    */
  323.  
  324. /*----------------------------------------------------------------------
  325.  * Names of delivery files.
  326.  *
  327.  * SYS_DELIVER          system-wide delivery file
  328.  * POST_DELIVER         post-user delivery file
  329.  * ERR_DELIVER          error delivery file
  330.  * USER_DELIVER         user delivery file (in user's home directory)
  331.  */
  332.  
  333. #define SYS_DELIVER     "/usr/local/lib/deliver.sys"
  334. #define POST_DELIVER    "/usr/local/lib/deliver.post"
  335. #define ERR_DELIVER     "/usr/local/lib/deliver.err"
  336. #define USER_DELIVER    ".deliver"
  337.  
  338. /*----------------------------------------------------------------------
  339.  * Log file names.
  340.  * Errors and warnings are output to stderr and to this file.
  341.  * To disable logging, don't define LOG.
  342.  * To disable error logging, don't define ERRLOG.
  343.  * Define LOGLOCK to be the temp file controlling access to log files.
  344.  */
  345.  
  346. #define LOG             "/usr/adm/deliver.log"
  347. #define ERRLOG          "/usr/adm/deliver.errlog"
  348. #define LOGLOCK         "/tmp/dl.loglock"
  349.  
  350. /*----------------------------------------------------------------------
  351.  * Environment variables passed to child processes.
  352.  */
  353.  
  354. #define ENV_DPID        "DELPID"        /* Deliver process id           */
  355. #define ENV_DLEVEL      "DELLEVEL"      /* Level of recursion           */
  356. #define ENV_DFLAGS      "DELFLAGS"      /* Flags: [-[Avdt]]             */
  357.  
  358. #define ENV_SYSDEL      "SYSDELFILE"    /* System delivery file         */
  359. #define ENV_POSTDEL     "POSTDELFILE"   /* Post-user delivery file      */
  360. #define ENV_ERRDEL      "ERRDELFILE"    /* Error delivery file          */
  361. #define ENV_USERDEL     "USERDELFILE"   /* User delivery file           */
  362.  
  363. #define ENV_HOSTNAME    "HOSTNAME"      /* Name of this host            */
  364. #define ENV_SENDER      "SENDER"        /* Message sender               */
  365. #define ENV_HEADER      "HEADER"        /* Message header file          */
  366. #define ENV_BODY        "BODY"          /* Message body file            */
  367.