summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2013-07-09 12:14:32 +0200
committerPeter Wu <lekensteyn@gmail.com>2013-07-09 12:14:32 +0200
commit3edbde6581b7905a721139ed682f2d4e6a30239f (patch)
treef5bdf980102143e268d37f2ff4cd820e2304fc7e
parent3f72b80acb9c8b4220ab2775547333fad06755b5 (diff)
downloadfemtomail-3edbde6581b7905a721139ed682f2d4e6a30239f.tar.gz
sendmail compat: Exit in modes other than `-bm`
-rw-r--r--README.md3
-rw-r--r--femtomail.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/README.md b/README.md
index 15afe13..f58c2a2 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,8 @@ The workflow of femtomail:
femtomail can replace the sendmail binary, but note that delivery is only
possible for a single user. When invoked as `newaliases` or `mailq`, the program
exits with a zero status code. Most [options of sendmail][3] are ignored except
-for the `-fname` and `address` arguments.
+for the `-fname` and `address` arguments. Only the `-bm` mode (read from stdin and
+deliver the usual way) is supported, femtomail will exit in other modes.
Installation
diff --git a/femtomail.c b/femtomail.c
index 916bf23..1cbc4e7 100644
--- a/femtomail.c
+++ b/femtomail.c
@@ -211,6 +211,12 @@ main(int argc, char **argv) {
case 'f':
from_address = xstrdup(optarg);
break;
+ case 'b':
+ if (*optarg != 'm') {
+ /* ignore modes other than "read mail from stdin" */
+ return (EXIT_SUCCESS);
+ }
+ break;
case '?': /* unrecognized argument */
return (EXIT_FAILURE);
default: