[dovecot-cvs] dovecot-lda/src common.h, 1.4, 1.5 deliver.c, 1.51, 1.52 smtpclient.c, 1.3, 1.4

cras at dovecot.org cras at dovecot.org
Fri May 12 21:24:44 EEST 2006


Update of /var/lib/cvs/dovecot-lda/src
In directory talvi:/tmp/cvs-serv23844

Modified Files:
	common.h deliver.c smtpclient.c 
Log Message:
Added sendmail_path and hostname settings.



Index: common.h
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/common.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- common.h	8 Feb 2006 11:39:29 -0000	1.4
+++ common.h	12 May 2006 18:24:40 -0000	1.5
@@ -7,6 +7,7 @@
 struct sieve_settings {
 	const char *hostname;
 	const char *postmaster_address;
+	const char *sendmail_path;
 };
 
 extern struct sieve_settings *sieve_set;

Index: deliver.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/deliver.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- deliver.c	12 May 2006 18:19:46 -0000	1.51
+++ deliver.c	12 May 2006 18:24:40 -0000	1.52
@@ -608,12 +608,17 @@
 	}
 
 	sieve_set = i_new(struct sieve_settings, 1);
-	sieve_set->hostname = my_hostname; /* FIXME: configurable */
+	sieve_set->hostname = getenv("HOSTNAME");
+	if (sieve_set->hostname == NULL)
+		sieve_set->hostname = my_hostname;
 	sieve_set->postmaster_address = getenv("POSTMASTER_ADDRESS");
 	if (sieve_set->postmaster_address == NULL) {
 		i_fatal_status(EX_CONFIG,
 			       "postmaster_address setting not given");
 	}
+	sieve_set->sendmail_path = getenv("SENDMAIL_PATH");
+	if (sieve_set->sendmail_path == NULL)
+		sieve_set->sendmail_path = "/usr/lib/sendmail";
 
 	dict_client_register();
         mail_storage_init();

Index: smtpclient.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/smtpclient.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- smtpclient.c	13 Jan 2006 15:15:52 -0000	1.3
+++ smtpclient.c	12 May 2006 18:24:40 -0000	1.4
@@ -67,18 +67,12 @@
 	close(fds[1]);
 	/* make the pipe be stdin */
 	dup2(fds[0], 0);
-	execv("/usr/lib/sendmail", (char **) argv);
-
-	/* if we're here we suck */
-	printf("451 lmtpd: didn't exec() sendmail?!?\r\n");
-	i_fatal("couldn't exec() sendmail");
+	(void)execv(sieve_set->sendmail_path, (char **)argv);
+	i_fatal("couldn't exec() sendmail: %m");
     }
 
-    if (p < 0) {
-	/* failure */
-	*sm = NULL;
-	return p;
-    }
+    if (p == -1)
+	i_fatal("fork() failed: %m");
 
     /* parent */
     close(fds[0]);



More information about the dovecot-cvs mailing list