* uurec - receive articles via /bin/mail.
static char *SccsId
= "@(#)uurec.c 2.9 4/16/85";
* Process a news article which has been shipped via /bin/mail.
extern char *strcat(), *strcpy();
extern char *frombreak();
char buf
[BFSZ
], fbuf
[BFSZ
];
char bfr
[BFSZ
], *pbfr
= bfr
;
register FILE *pipe
= stdout
;
register int mode
, frmflg
, pathcnt
, format
;
while (fgets(buf
, BFSZ
, stdin
) != NULL
) {
printf("%o\t%s", mode
|type(buf
), buf
);
switch (mode
| type(buf
)) {
if ((isupper(buf
[1]) && index(buf
, ':')) || !strncmp(buf
, "From ", 5))
printf("format = %d\n", format
);
while (p
>= fbuf
&& *--p
!= '!')
sprintf(pbfr
, "%s/%s/%s", logdir(HOME
),
if ((pipe
= popen(pbfr
, "w")) == NULL
) {
perror("uurec: popen failed");
if (!pathcnt
&& (!strncmp(buf
+1, "From: ", 6) || !strncmp(buf
+1, "From ", 5))) {
fprintf(pipe
, "From: %s", fbuf
);
sscanf(buf
, "%s %[^\n]", fbuf
, fbuf
);
fprintf(pipe
, "%s\n", fbuf
);
while (*p
== ' ' || *p
== '?')
if (strncmp(p
, ">From ", 6) == 0)
if (strncmp(p
, "From ", 5) == 0)
* Get the system name out of a from line.
register char *buf
, *fbuf
;
/* break the line into tokens. */
for (p
=fbuf
; *p
!= EOT
|| p
[1] != '\0'; p
+= strlen(p
)+1) {
if (strcmp(p
, "forwarded") == 0)
if (strcmp(p
, "remote") == 0) {
if (strcmp(p
, "from") == 0) {