]> diplodocus.org Git - mdeliver/commitdiff
(run_processor): Now only takes a single argument, the filename of the
authorepg <>
Fri, 13 Sep 2002 01:43:09 +0000 (01:43 +0000)
committerepg <>
Fri, 13 Sep 2002 01:43:09 +0000 (01:43 +0000)
new message.  The process to run is now hard-coded to be a dot-file in
the user's home directory.

(main): Now unconditionally call run_processor.

mdeliver.c

index 6b4debd..68b8691 100644 (file)
@@ -251,7 +251,7 @@ deliver(char *maildir, char *newfn)
 
 /* Run a program to process the new message. */
 static void
 
 /* Run a program to process the new message. */
 static void
-run_processor(char *argv[], char *newfn)
+run_processor(char *newfn)
 {
     pid_t pid;
     FILE *errfile;
 {
     pid_t pid;
     FILE *errfile;
@@ -262,9 +262,11 @@ run_processor(char *argv[], char *newfn)
     if ((pid = fork()) > 0) {
         return;
     } else if (pid == 0) {
     if ((pid = fork()) > 0) {
         return;
     } else if (pid == 0) {
-        argv[0] = argv[1];
-        argv[1] = newfn;
-        execv(argv[0], argv);
+        execl(".mdeliver-processor", ".mdeliver-processor", newfn, NULL);
+        if (errno == ENOENT) {
+            /* Not having a processor is not an error. */
+            return;
+        }
         fail = "exec";
     } else {
         fail = "fork";
         fail = "exec";
     } else {
         fail = "fork";
@@ -304,9 +306,7 @@ main(int argc, char *argv[])
 
     deliver("Maildir", newfn);
 
 
     deliver("Maildir", newfn);
 
-    if (argv[1]) {
-        run_processor(argv, newfn);
-    }
+    run_processor(newfn);
 
     /* Always return 0 because deliver exits if it fails, and if it
      * succeeds we cannot return a failure code to the MTA. */
 
     /* Always return 0 because deliver exits if it fails, and if it
      * succeeds we cannot return a failure code to the MTA. */