version 1.1, 1995/10/18 08:45:39 |
version 1.2, 1996/06/11 12:53:50 |
|
|
|
/* $OpenBSD$ */ |
|
/* $NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $ */ |
|
|
/* |
/* |
* Copyright (c) 1980, 1993 |
* Copyright (c) 1980, 1993 |
* The Regents of the University of California. All rights reserved. |
* The Regents of the University of California. All rights reserved. |
|
|
*/ |
*/ |
|
|
#ifndef lint |
#ifndef lint |
static char sccsid[] = "from: @(#)send.c 8.1 (Berkeley) 6/6/93"; |
#if 0 |
static char rcsid[] = "$Id$"; |
static char sccsid[] = "@(#)send.c 8.1 (Berkeley) 6/6/93"; |
|
#else |
|
static char rcsid[] = "$OpenBSD$"; |
|
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
#include "rcv.h" |
#include "rcv.h" |
|
|
long count; |
long count; |
register FILE *ibuf; |
register FILE *ibuf; |
char line[LINESIZE]; |
char line[LINESIZE]; |
int ishead, infld, ignoring, dostat, firstline; |
int ishead, infld, ignoring = 0, dostat, firstline; |
register char *cp, *cp2; |
register char *cp, *cp2; |
register int c; |
register int c = 0; |
int length; |
int length; |
int prefixlen; |
int prefixlen = 0; |
|
|
/* |
/* |
* Compute the prefix string, without trailing whitespace |
* Compute the prefix string, without trailing whitespace |
|
|
* the mail routine below. |
* the mail routine below. |
*/ |
*/ |
int |
int |
sendmail(str) |
sendmail(v) |
char *str; |
void *v; |
{ |
{ |
|
char *str = v; |
struct header head; |
struct header head; |
|
|
head.h_to = extract(str, GTO); |
head.h_to = extract(str, GTO); |
|
|
goto out; |
goto out; |
} |
} |
if (pid == 0) { |
if (pid == 0) { |
prepare_child(sigmask(SIGHUP)|sigmask(SIGINT)|sigmask(SIGQUIT)| |
sigset_t nset; |
sigmask(SIGTSTP)|sigmask(SIGTTIN)|sigmask(SIGTTOU), |
sigemptyset(&nset); |
fileno(mtf), -1); |
sigaddset(&nset, SIGHUP); |
|
sigaddset(&nset, SIGINT); |
|
sigaddset(&nset, SIGQUIT); |
|
sigaddset(&nset, SIGTSTP); |
|
sigaddset(&nset, SIGTTIN); |
|
sigaddset(&nset, SIGTTOU); |
|
prepare_child(&nset, fileno(mtf), -1); |
if ((cp = value("sendmail")) != NOSTR) |
if ((cp = value("sendmail")) != NOSTR) |
cp = expand(cp); |
cp = expand(cp); |
else |
else |
|
|
register FILE *fo; |
register FILE *fo; |
char buf[BUFSIZ]; |
char buf[BUFSIZ]; |
register i; |
register i; |
time_t now, time(); |
time_t now; |
char *ctime(); |
|
|
|
if ((fo = Fopen(name, "a")) == NULL) { |
if ((fo = Fopen(name, "a")) == NULL) { |
perror(name); |
perror(name); |