** 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.
** StdTimezone -- name of local timezone in standard time
** DstTimezone -- name of local timezone in daylight savings
** 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.33 %G%";
** 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
,
"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 */
** Location of system files/databases/etc.
char *AliasFile
= "/usr/lib/aliases"; /* alias file */
char *ConfFile
= "/usr/lib/sendmail.cf"; /* runtime configuration */
char *StatFile
= "/usr/eric/mailstats"; /* statistics summary */
int DefUid
= 1; /* the uid to execute mailers as */
int DefGid
= 1; /* ditto for gid */
** V6 system configuration.
char *StdTimezone
= "PST"; /* std time timezone */
char *DstTimezone
= "PDT"; /* daylight time timezone */
** 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.
** UMASK -- fake the umask system call.
** Since V6 always acts like the umask is zero, we will just
** assume the same thing.
** GETRUID -- get real user id.
return (getuid() & 0377);
** GETRGID -- get real group id.
return (getgid() & 0377);
** GETEUID -- get effective user id.
return ((getuid() >> 8) & 0377);
** GETEGID -- get effective group id.
return ((getgid() >> 8) & 0377);
** GETRUID -- get real user id (V7)
** GETRGID -- get real group id (V7).
** 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
** 'NoReturn' can be set to suppress the return-to-sender
** function; this should be done on huge messages.
** to -- the person being sent to.
** none (unless you include the usrerr stuff)
if (to
->q_mailer
!= MN_LOCAL
&& MsgSize
> 100000)
usrerr("Message exceeds 100000 bytes");
s
= stab("arpa", ST_MAILER
, ST_FIND
);
if (s
!= NULL
&& From
.q_mailer
!= MN_LOCAL
&& to
->q_mailer
== s
->s_mailer
->m_mno
)
usrerr("No ARPA mail through this machine: see your system administration");