]> diplodocus.org Git - mdeliver/commitdiff
Make run_processor work again.
authorepg <>
Fri, 13 Sep 2002 02:16:06 +0000 (02:16 +0000)
committerepg <>
Fri, 13 Sep 2002 02:16:06 +0000 (02:16 +0000)
mdeliver.c

index 340e1e9..7e61c37 100644 (file)
@@ -251,9 +251,10 @@ deliver(char *maildir, char *newfn)
 
 /* Run a program to process the new message. */
 static void
-run_processor(char *newfn)
+run_processor(char *home, char *newfn)
 {
     pid_t pid;
+    char command[PATH_MAX];
     FILE *errfile;
     char *fail;
     int olderrno;
@@ -262,7 +263,8 @@ run_processor(char *newfn)
     if ((pid = fork()) > 0) {
         return;
     } else if (pid == 0) {
-        execl(".mdeliver-processor", ".mdeliver-processor", newfn, NULL);
+        snprintf(command, PATH_MAX, "%s/%s", home, ".mdeliver-processor");
+        execl(command, command, newfn, NULL);
         if (errno == ENOENT) {
             /* Not having a processor is not an error. */
             return;
@@ -311,7 +313,7 @@ main(int argc, char *argv[])
 
     deliver("Maildir", newfn);
 
-    run_processor(newfn);
+    run_processor(home, newfn);
 
     /* Always return 0 because deliver exits if it fails, and if it
      * succeeds we cannot return a failure code to the MTA. */