summaryrefslogtreecommitdiff
path: root/usr.bin/mail/send.c
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2008-07-16 15:11:17 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2008-07-16 15:11:17 +0000
commit2c38c491b97bc716d7cebd790454dd87d79d68ac (patch)
tree0adfdde4e6ebf5e4043cc4dc1e53e964a8a0a7af /usr.bin/mail/send.c
parent34ea02bb9c6b61dab9766c85843a6b34824c8115 (diff)
add -E flag and 'skipempty' option to skip sending messages with
empty bodies. useful for sending mails from crontabs. from rivo nurges <rix at estpak dot ee>, with missing 'skipempty' documentation and usage update from me ok millert@
Diffstat (limited to 'usr.bin/mail/send.c')
-rw-r--r--usr.bin/mail/send.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c
index eeed4e4bff0..cfe041d8344 100644
--- a/usr.bin/mail/send.c
+++ b/usr.bin/mail/send.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: send.c,v 1.19 2008/07/16 14:53:41 martynas Exp $ */
+/* $OpenBSD: send.c,v 1.20 2008/07/16 15:11:16 martynas Exp $ */
/* $NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static const char sccsid[] = "@(#)send.c 8.1 (Berkeley) 6/6/93";
#else
-static const char rcsid[] = "$OpenBSD: send.c,v 1.19 2008/07/16 14:53:41 martynas Exp $";
+static const char rcsid[] = "$OpenBSD: send.c,v 1.20 2008/07/16 15:11:16 martynas Exp $";
#endif
#endif /* not lint */
@@ -339,6 +339,8 @@ mail1(struct header *hp, int printheaders)
if ((mtf = collect(hp, printheaders)) == NULL)
return;
if (fsize(mtf) == 0) {
+ if (value("skipempty") != NULL)
+ goto out;
if (hp->h_subject == NULL)
puts("No message, no subject; hope that's ok");
else