Therefore could remove `everyone' and `noshell' from mts.conf.
If one really needs to write mail to everyone on the system (not just
all regular users, which probably are in a group `user'), then he
shurely can invest a bit more effort to do so. Likely, the simple condition
to uids > 200 and not the shell `noshell' would anyways be to limited.
Better use awk or the like and do it by hand.
#define PASSWD "/etc/passwd" /* passwd(5) */
#define GROUP "/etc/group" /* group(5) */
-#define EVERYONE 200 /* lowest uid for everyone */
struct aka {
char *ak_name; /* name to match against */
#define AK_ERROR 2 /* error parsing file */
#define AK_LIMIT 3 /* memory limit exceeded */
#define AK_NOGROUP 4 /* no such group */
-
-/* should live here, not in mts.c */
-
-extern int Everyone;
-extern char *NoShell;
** Global MailDelivery File
*/
extern char *maildelivery;
-
-/*
-** Aliasing Facility (doesn't belong here)
-*/
-extern int Everyone;
-extern char *NoShell;
.I address\-list
for the alias.
.PP
-If the
-.I address\-group
-is simply `*', then the file
-.I /etc/passwd
-is consulted and all login names with a userid
-greater than some magic number (usually 200) are added to the
-.I address\-list
-for the alias.
-.PP
In match, a trailing \*(lq*\*(rq on an alias will match just about anything
appropriate. (See example below.)
.PP
UNIX\-committee: <unix.aliases
staff: =staff
wheels: +wheel
-everyone: *
news.*: news
.fi
.RE
.I /etc/passwd
is equivalent to the \*(lqwheel\*(rq group.
.PP
-Finally, \*(lqeveryone\*(rq is defined as all users with a user\-id
-in
-.I /etc/passwd
-greater than 200, and all aliases of the form
+Finally, all aliases of the form
\*(lqnews.<anything>\*(rq are defined to be \*(lqnews\*(rq.
.PP
The key thing to understand about aliasing in
.SH CONTEXT
None
+.SH HISTORY
+An address group named `*', meaning everyone on the system, had been
+supported in nmh. It is not anymore in mmh.
+
.SH BUGS
Although the forward-referencing semantics of
.B mh\-alias
See
.BR slocal (1)
for the details.
-.RE
-.PP
-.BR everyone :
-200
-.RS 5
-The highest user-id which should NOT receive mail addressed to
-\*(lqeveryone\*(rq.
-.RE
-.PP
-.BR noshell :
-.RS 5
-If set, then each user-id greater than \*(lqeveryone\*(rq that has a
-login shell equivalent to the given value (e.g., \*(lq/bin/csh\*(rq)
-indicates that mail for \*(lqeveryone\*(rq should not be sent to them.
-This is useful for handling admin, dummy, and guest logins.
.SS "File Locking"
A few words on locking:
.B nmh
*/
char *maildelivery = NMHETCDIR"/maildelivery";
-
-/*
-** Aliasing Facility (doesn't belong here)
-*/
-int Everyone = NOTOK;
-static char *everyone = "-1";
-char *NoShell = "";
-
/*
** Customize the MTS settings for nmh by adjusting
** the file mts.conf in the nmh etc directory.
static struct bind binds[] = {
{ "masquerade", &masquerade },
{ "maildelivery", &maildelivery },
- { "everyone", &everyone },
- { "noshell", &NoShell },
{ NULL, NULL }
};
fclose(fp);
}
- Everyone = atoi(everyone);
-
if (strstr(masquerade, "draft_from") != NULL)
draft_from_masquerading = TRUE;
static int addfile(struct aka *, char *);
static int addgroup(struct aka *, char *);
static int addmember(struct aka *, char *);
-static int addall(struct aka *);
static char *getalias(char *);
static void add_aka(struct aka *, char *);
static struct aka *akalloc(char *);
while ((c = *string++))
if (*aliasent == '*')
return 1;
+ else if ((c | 040) != (*aliasent | 040))
+ return 0;
else
- if ((c | 040) != (*aliasent | 040))
- return 0;
- else
- aliasent++;
+ aliasent++;
return (*aliasent == 0 || *aliasent == '*');
}
}
break;
- case '*': /* Everyone */
- addall(ak);
- break;
-
default: /* list */
while ((cp = getalias(pp)))
add_aka(ak, cp);
}
-static int
-addall(struct aka *ak)
-{
- int noshell = NoShell == NULL || *NoShell == 0;
- register struct home *hm;
-
-#ifndef DBMPWD
- if (homehead == NULL)
-#endif /* DBMPWD */
- init_pw();
- if (Everyone < 0)
- Everyone = EVERYONE;
-
- for (hm = homehead; hm; hm = hm->h_next)
- if (hm->h_uid > Everyone && (noshell ||
- strcmp(hm->h_shell, NoShell)!=0))
- add_aka(ak, hm->h_name);
-
- return homehead != NULL;
-}
-
-
static char *
getalias(char *addrs)
{