This makes mail(1) reject -r when not sending a message as it already does for
-s, -c, and -b.
I was going to write a patch to take -r with a mailbox but realized I could set
from interactively so nobody would want that.
-- Martin
Index: main.c
===================================================================
RCS file: /cvs/src/usr.bin/mail/main.c,v
retrieving revision 1.28
diff -u -p -r1.28 main.c
--- main.c 20 Jan 2015 16:59:07 -0000 1.28
+++ main.c 21 Jan 2015 22:57:51 -0000
@@ -185,8 +185,10 @@ main(int argc, char **argv)
/*
* Check for inconsistent arguments.
*/
- if (to == NULL && (subject != NULL || cc != NULL || bcc != NULL))
- errx(1, "You must specify direct recipients with -s, -c, or
-b");
+ if (to == NULL && (subject != NULL || cc != NULL || bcc != NULL ||
+ fromaddr != NULL))
+ errx(1, "You must specify direct recipients with -s, -c, -b, "
+ "or -r");
/*
* Block SIGINT except where we install an explicit handler for it.
*/