** CONF.C -- Sendmail Configuration Tables.
** Defines the configuration of this installation.
** V6 -- running on a version 6 system. This determines
** whether to define certain routines between
** the two systems. If you are running a funny
** system, e.g., V6 with long tty names, this
** should be checked carefully.
** Configuration Variables:
** HdrInfo -- a table describing well-known header fields.
** Each entry has the field name and some flags,
** which are described in sendmail.h.
** I have tried to put almost all the reasonable
** configuration information into the configuration
** file read at runtime. My intent is that anything
** here is a function of the version of UNIX you
** are running, or is really static -- for example
** the headers are a superset of widely used
** protocols. If you find yourself playing with
** this file too much, you may be making a mistake!
static char SccsId
[] = "@(#)conf.c 3.25 %G%";
# include <whoami.h> /* definitions of machine id's at berkeley */
** Final (null) entry contains the flags used for any other field.
** Not all of these are actually handled specially by sendmail
** at this time. They are included as placeholders, to let
** you know that "someday" I intend to have sendmail do
struct hdrinfo HdrInfo
[] =
"date", H_CHECK
, M_NEEDDATE
,
"from", H_CHECK
, M_NEEDFROM
,
"original-from", H_ACHECK
, 0, /* internal */
"full-name", H_ACHECK
, M_FULLNAME
,
"bcc", H_ADDR
|H_ACHECK
, 0,
"message-id", H_CHECK
, M_MSGID
,
"return-receipt-to", 0, 0,
"received-date", H_CHECK
, M_LOCAL
,
"received-from", H_CHECK
, M_LOCAL
,
** ARPANET error message numbers.
/* these are almost all unchecked */
char Arpa_Info
[] = "010"; /* arbitrary info: this is WRONG! */
char Arpa_Enter
[] = "354"; /* start mail input */
char Arpa_Mmsg
[] = "250"; /* mail successful (MAIL cmd) */
char Arpa_Fmsg
[] = "250"; /* mail successful (MLFL cmd) */
char Arpa_Syserr
[] = "450"; /* some (transient) system error */
char Arpa_Usrerr
[] = "550"; /* some (fatal) user error */
char Arpa_Info
[] = "050"; /* arbitrary info */
char Arpa_Enter
[] = "350"; /* start mail input */
char Arpa_Mmsg
[] = "256"; /* mail successful (MAIL cmd) */
char Arpa_Fmsg
[] = "250"; /* mail successful (MLFL cmd) */
char Arpa_Syserr
[] = "455"; /* some (transient) system error */
char Arpa_Usrerr
[] = "450"; /* some (fatal) user error */
** TTYNAME -- return name of terminal.
** fd -- file descriptor to check.
** pointer to full path of tty.
static char pathn
[] = "/dev/ttyx";
/* compute the pathname of the controlling tty */
if ((tn
= ttyn(fd
)) == NULL
)
** FDOPEN -- Open a stdio file given an open file descriptor.
** This is included here because it is standard in v7, but we
** Open /dev/null to create a descriptor.
** Close that descriptor.
** Copy the existing fd into the descriptor.
** fd -- the open file descriptor.
** type -- "r", "w", or whatever.
** The file descriptor it creates.
** The mode of fd must match "type".
f
= fopen("/dev/null", type
);
** INDEX -- Return pointer to character in string
** s -- a string to scan.
** c -- a character to look for.
** If c is in s, returns the address of the first
** NULL if c is not in s.
** TTYPATH -- Get the path of the user's tty
** Returns the pathname of the user's tty. Returns NULL if
** the user is not logged in or if s/he has write permission
** pathname of the user's tty.
** NULL if not logged in or write permission denied.
** Return value is in a local buffer.
/* compute the pathname of the controlling tty */
if ((pathn
= ttyname(2)) == NULL
&& (pathn
= ttyname(1)) == NULL
&& (pathn
= ttyname(0)) == NULL
)
/* see if we have write permission */
if (stat(pathn
, &stbuf
) < 0 || !bitset(02, stbuf
.st_mode
))
/* see if the user is logged in */
** CHECKCOMPAT -- check for From and To person compatible.
** This routine can be supplied on a per-installation basis
** to determine whether a person is allowed to send a message.
** This allows restriction of certain types of internet
** forwarding or registration of users.
** If the hosts are found to be incompatible, an error
** message should be given using "usrerr" and FALSE should
** to -- the person being sent to.
** none (unless you include the usrerr stuff)