diff -u ../blackmail-0.27/blackmail.c ./blackmail.c
--- ../blackmail-0.27/blackmail.c	Sun Aug  3 20:28:44 1997
+++ ./blackmail.c	Thu Aug  7 19:22:19 1997
@@ -3,6 +3,8 @@
 ** Mailer Dispatch Routines
 */
 
+#include <unistd.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <syslog.h>
@@ -40,6 +42,7 @@
 };
 
 
+
 void loadConfig(void)
 {
     FILE *file;
@@ -159,6 +162,62 @@
     }
 }
 
+FILE *createMailerProcess(char *command)
+{
+	int fd[2];
+	pid_t childpid;
+	
+	if (pipe(fd) < 0)
+		return NULL;
+	
+	if ((childpid = vfork()) == -1)
+	{
+		perror("fork");
+		close(fd[0]);
+		close(fd[1]);		
+		return NULL;
+	}
+	
+	if (childpid == 0)
+	{
+		/* child */
+		char *new_argv[4];
+
+		/* attach input side to stdin */
+		if (dup2(fd[0],0) < 0)
+			exit(1);
+
+		close(fd[0]);	/* close input side */
+		close(fd[1]);	/* close output side */
+
+		/* Setup shell */
+		new_argv[0] = "sh";
+		new_argv[1] = "-c";
+		new_argv[2] = command;
+		new_argv[3] = NULL;
+
+		/* Create new process */
+		execve("/bin/sh",(char **) new_argv,environ);
+
+		/* Die if we get here */
+		perror("execve");
+		exit(1);
+	}
+	else
+	{
+		FILE *file;
+		char *buf;
+
+		/* parent */
+		close(fd[0]);	/* close input side */
+		fcntl(fd[1],F_SETFD,FD_CLOEXEC);
+
+		file = fdopen(fd[1],"w");
+		return file;
+	} 	
+	return NULL;
+}
+
 void openMailer(void)
 {
     /*
@@ -166,7 +225,8 @@
     ** somewhat, since the mailer sends all replies via stderr, and stderr
     ** is not trapped by popen.  But, you knew this already.  :)
     */
-    mailer = popen(MAILFILE, "w");
+/*      mailer = popen(MAILFILE, "w");*/
+  	mailer = createMailerProcess(MAILFILE);
 }
 
 /*
diff -u ../blackmail-0.27/blackmail.h ./blackmail.h
--- ../blackmail-0.27/blackmail.h	Sun Aug  3 20:45:53 1997
+++ ./blackmail.h	Thu Aug  7 21:12:22 1997
@@ -3,8 +3,8 @@
 ** Header file
 */
 
-#define	MAILFILE	"/usr/bin/rsmtp -bs"
-
+/* #define	MAILFILE	"/usr/sbin/sendmail -bs" */
+#define MAILFILE "/var/qmail/bin/qmail-smtpd"
 /*
  * If this is set, this will automatically override the internal lookup
  * routines to find your local host and domain.  If you do not define
@@ -13,7 +13,7 @@
  * fails, use the "-t" option to ask BlackMail to report your "true"
  * host and domain information.
  */
-#define	LOCHOST		"northwest.com"
+#define	LOCHOST		"your_mail.host"
 
 /*
  * This is the default timeout.  CHANGE THIS if you experience problems.
Common subdirectories: ../blackmail-0.27/filter and ./filter
Common subdirectories: ../blackmail-0.27/man and ./man
Common subdirectories: ../blackmail-0.27/modules and ./modules
Only in .: patch.diff
Common subdirectories: ../blackmail-0.27/templates and ./templates

