+ // if no recipients _and_ no body files specified -> enter all-included mode
+ // i.e. scan stdin for To: and Subject: lines ...
+ // ... and then use the rest of stdin as message body
+ if (!opt_recipients && !*argv) {
+ // fetch recipients and (optionally) subject
+ char *s;
+ while ((s = xmalloc_reads(INITIAL_STDIN_FILENO, NULL, NULL)) != NULL) {
+ if (0 == strncmp("To: ", s, 4)) {
+ llist_add_to_end(&opt_recipients, s+4);
+ } else if (0 == strncmp("Subject: ", s, 9)) {
+ opt_subject = s+9;
+ opts |= OPTS_s;
+ } else {
+ char first = s[0];
+ free(s);
+ if (!first)
+ break; // empty line
+ }
+ }
+ // order to read body from stdin
+ *--argv = (char *)"-";
+ }
+