SCCS-vsn: libexec/mail.local/mail.local.c 4.2
#include <whoami.h>
#include <sysexits.h>
#include <whoami.h>
#include <sysexits.h>
-static char SccsId[] = "@(#)mail.local.c 4.1 %G%";
+static char SccsId[] = "@(#)mail.local.c 4.2 %G%";
#define DELIVERMAIL "/etc/delivermail"
#define DELIVERMAIL "/etc/delivermail"
register mask;
struct passwd *pw, *getpwnam();
struct stat statb;
register mask;
struct passwd *pw, *getpwnam();
struct stat statb;
+ char buf[128];
+ int f;
# ifndef DELIVERMAIL
stripfx(LOCNAM1, &name);
# ifndef DELIVERMAIL
stripfx(LOCNAM1, &name);
}
lock(file);
chown(file, pw->pw_uid, pw->pw_gid);
}
lock(file);
chown(file, pw->pw_uid, pw->pw_gid);
+ {
+ f = open("/dev/mail", 1);
+ sprintf(buf, "%s@%d\n", name, ftell(malf));
+ }
copylet(n, malf, ORDINARY);
copylet(n, malf, ORDINARY);
+ if (f >= 0) {
+ write(f, buf, strlen(buf)+1);
+ close(f);
+ }
fclose(malf);
unlock();
return(1);
fclose(malf);
unlock();
return(1);