diff options
author | mikeh <mikeh@FreeBSD.org> | 2001-12-18 20:52:09 +0000 |
---|---|---|
committer | mikeh <mikeh@FreeBSD.org> | 2001-12-18 20:52:09 +0000 |
commit | e4034fe298af9398dae0cac602d8a28ec6e51489 (patch) | |
tree | 89731abafbceb13b0e7b78a6e281339c99fbfef9 /usr.bin/mail/send.c | |
parent | 1750942f6f64d20cc8853d2d1a60a3daaeeb1110 (diff) | |
download | FreeBSD-src-e4034fe298af9398dae0cac602d8a28ec6e51489.zip FreeBSD-src-e4034fe298af9398dae0cac602d8a28ec6e51489.tar.gz |
Sync with most of NetBSD's changes, including:
*) Sync with 4.4BSD-Lite2
*) Set usecs for utimes()
*) Add 'inc' command and 'autoinc' option that check for new mail
manually and automatically, respectively
*) Use POSIX signal handling and tty semantics
*) Handle long lines correctly when paging messages
*) Add ability to explicitly search 'To:' line
*) Various manpage cleanups
*) Support overriding '~/.mailrc' with $MAILRC
*) Support 'askbcc' and 'asksub' options
*) Fix various bugs
Reviewed by: ru (mail.1)
Obtained from: NetBSD
Diffstat (limited to 'usr.bin/mail/send.c')
-rw-r--r-- | usr.bin/mail/send.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c index 42dd65e..58f029a 100644 --- a/usr.bin/mail/send.c +++ b/usr.bin/mail/send.c @@ -315,9 +315,12 @@ mail1(hp, printheaders) if ((mtf = collect(hp, printheaders)) == NULL) return; if (value("interactive") != NULL) { - if (value("askcc") != NULL) - grabh(hp, GCC); - else { + if (value("askcc") != NULL || value("askbcc") != NULL) { + if (value("askcc") != NULL) + grabh(hp, GCC); + if (value("askbcc") != NULL) + grabh(hp, GBCC); + } else { printf("EOT\n"); (void)fflush(stdout); } @@ -380,9 +383,15 @@ mail1(hp, printheaders) goto out; } if (pid == 0) { - prepare_child(sigmask(SIGHUP)|sigmask(SIGINT)|sigmask(SIGQUIT)| - sigmask(SIGTSTP)|sigmask(SIGTTIN)|sigmask(SIGTTOU), - fileno(mtf), -1); + sigset_t nset; + (void)sigemptyset(&nset); + (void)sigaddset(&nset, SIGHUP); + (void)sigaddset(&nset, SIGINT); + (void)sigaddset(&nset, SIGQUIT); + (void)sigaddset(&nset, SIGTSTP); + (void)sigaddset(&nset, SIGTTIN); + (void)sigaddset(&nset, SIGTTOU); + prepare_child(&nset, fileno(mtf), -1); if ((cp = value("sendmail")) != NULL) cp = expand(cp); else @@ -414,6 +423,9 @@ fixhead(hp, tolist) hp->h_cc = NULL; hp->h_bcc = NULL; for (np = tolist; np != NULL; np = np->n_flink) + /* Don't copy deleted addresses to the header */ + if (np->n_type & GDEL) + continue; if ((np->n_type & GMASK) == GTO) hp->h_to = cat(hp->h_to, nalloc(np->n_name, np->n_type)); |