SCCS-vsn: libexec/mail.local/mail.local.c 4.23
-static char sccsid[] = "@(#)mail.local.c 4.22 (Berkeley) %G%";
+static char sccsid[] = "@(#)mail.local.c 4.23 (Berkeley) %G%";
#endif
#include <sys/types.h>
#endif
#include <sys/types.h>
continue;
}
for (p = resp+1; (p = getarg(lfil, p)) != NULL; )
continue;
}
for (p = resp+1; (p = getarg(lfil, p)) != NULL; )
- if (!sendrmt(j, lfil, "/bin/mail"))
+ if (!sendmail(j, lfil, my_name))
flg++;
if (flg)
print = 0;
flg++;
if (flg)
print = 0;
default:
panic("Bad letter type %d to copylet.", type);
}
default:
panic("Bad letter type %d to copylet.", type);
}
{
FILE *rmf, *popen();
register char *p;
char rsys[64], cmd[64];
{
FILE *rmf, *popen();
register char *p;
char rsys[64], cmd[64];
- local = 0;
- if (index(name, '^')) {
+#ifdef notdef
+ if (any('^', name)) {
while (p = index(name, '^'))
*p = '!';
if (strncmp(name, "researc", 7)) {
while (p = index(name, '^'))
*p = '!';
if (strncmp(name, "researc", 7)) {
- if (*name=='!')
- name++;
- for(p=rsys; *name!='!'; *p++ = *name++)
- if (*name=='\0') {
- local++;
- break;
- }
+#endif
+ for (p=rsys; *name!='!'; *p++ = *name++)
+ if (*name=='\0')
+ return(0); /* local address, no '!' */
- if ((!local && *name=='\0') || (local && *rsys=='\0')) {
printf("null name\n");
return(0);
}
printf("null name\n");
return(0);
}
return(!sts);
}
setuid(getuid());
return(!sts);
}
setuid(getuid());
- if (local)
- sprintf(cmd, "%s %s", rcmd, rsys);
- else {
- if (index(name+1, '!'))
- sprintf(cmd, "uux - %s!rmail \\(%s\\)", rsys, name+1);
- else
- sprintf(cmd, "uux - %s!rmail %s", rsys, name+1);
- }
+ if (any('!', name+1))
+ sprintf(cmd, "uux - %s!rmail \\(%s\\)", rsys, name+1);
+ else
+ sprintf(cmd, "uux - %s!rmail %s", rsys, name+1);
if ((rmf=popen(cmd, "w")) == NULL)
exit(1);
if ((rmf=popen(cmd, "w")) == NULL)
exit(1);
- copylet(n, rmf, local ? !strcmp(rcmd, "/bin/mail") ? FORWARD : ORDINARY : REMOTE);
+ copylet(n, rmf, REMOTE);
exit(pclose(rmf) != 0);
}
exit(pclose(rmf) != 0);
}
- if (any(name, "!^"))
- return (sendrmt(n, name, 0));
+ if (*name=='!')
+ name++;
+ if (any('!', name))
+ return (sendrmt(n, name));
if ((pw = getpwnam(name)) == NULL) {
printf("mail: can't send to %s\n", name);
return(0);
if ((pw = getpwnam(name)) == NULL) {
printf("mail: can't send to %s\n", name);
return(0);