-.\" $OpenBSD: mail.1,v 1.52 2008/07/16 14:56:11 martynas Exp $
+.\" $OpenBSD: mail.1,v 1.53 2008/07/16 15:11:16 martynas Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.Sh SYNOPSIS
.Nm mail
.Bk -words
-.Op Fl Iinv
+.Op Fl EIinv
.Op Fl b Ar list
.Op Fl c Ar list
.Op Fl s Ar subject
.Op Fl Ar sendmail-options ...
.Ek
.Nm mail
-.Op Fl IiNnv
+.Op Fl EIiNnv
.Fl f
.Op Ar file
.Nm mail
-.Op Fl IiNnv
+.Op Fl EIiNnv
.Op Fl u Ar user
.Sh DESCRIPTION
.Nm mail
of users.
.Ar list
should be a comma separated list of names.
+.It Fl E
+Don't send messages with an empty body.
.It Fl f Op Ar file
Read in the contents of your mailbox
(or the specified
to just the
.Dq To:
field.
+.It Ar skipempty
+Don't send messages with an empty body.
.It Ar verbose
Setting the option
.Ar verbose
-/* $OpenBSD: main.c,v 1.20 2007/08/06 19:16:06 sobrado Exp $ */
+/* $OpenBSD: main.c,v 1.21 2008/07/16 15:11:16 martynas Exp $ */
/* $NetBSD: main.c,v 1.7 1997/05/13 06:15:57 mikel Exp $ */
/*
#if 0
static const char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/20/95";
#else
-static const char rcsid[] = "$OpenBSD: main.c,v 1.20 2007/08/06 19:16:06 sobrado Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.21 2008/07/16 15:11:16 martynas Exp $";
#endif
#endif /* not lint */
bcc = NULL;
smopts = NULL;
subject = NULL;
- while ((i = getopt(argc, argv, "INT:b:c:dfins:u:v")) != -1) {
+ while ((i = getopt(argc, argv, "EINT:b:c:dfins:u:v")) != -1) {
switch (i) {
case 'T':
/*
*/
bcc = cat(bcc, nalloc(optarg, GBCC));
break;
+ case 'E':
+ /*
+ * Don't send messages with an empty body.
+ */
+ assign("skipempty", "");
+ break;
default:
usage();
/*NOTREACHED*/
usage(void)
{
- fprintf(stderr, "usage: %s [-Iinv] [-b list] [-c list] "
+ fprintf(stderr, "usage: %s [-EIinv] [-b list] [-c list] "
"[-s subject] to-addr ...\n", __progname);
fprintf(stderr, " %*s [-sendmail-options ...]\n",
(int)strlen(__progname), "");
- fprintf(stderr, " %s [-IiNnv] -f [name]\n", __progname);
- fprintf(stderr, " %s [-IiNnv] [-u user]\n", __progname);
+ fprintf(stderr, " %s [-EIiNnv] -f [name]\n", __progname);
+ fprintf(stderr, " %s [-EIiNnv] [-u user]\n", __progname);
exit(1);
}
-/* $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 $ */
/*
#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 */
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