[dovecot-cvs] dovecot/src/deliver smtp-client.c,1.4,1.5
tss at dovecot.org
tss at dovecot.org
Sun May 13 17:07:25 EEST 2007
Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv14670
Modified Files:
smtp-client.c
Log Message:
If sendmail_path was set in config file, it was cleared just before trying
to execute it.
Index: smtp-client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/deliver/smtp-client.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- smtp-client.c 6 Mar 2007 16:57:35 -0000 1.4
+++ smtp-client.c 13 May 2007 14:07:23 -0000 1.5
@@ -28,9 +28,13 @@
smtp_client_run_sendmail(const char *destination,
const char *return_path, int fd)
{
- const char *argv[7];
+ const char *argv[7], *sendmail_path;
- argv[0] = deliver_set->sendmail_path;
+ /* deliver_set's contents may point to environment variables.
+ deliver_env_clean() cleans them up, so they have to be copied. */
+ sendmail_path = t_strdup(deliver_set->sendmail_path);
+
+ argv[0] = sendmail_path;
argv[1] = "-i"; /* ignore dots */
argv[2] = "-f";
argv[3] = return_path != NULL && *return_path != '\0' ?
@@ -44,8 +48,8 @@
deliver_env_clean();
- (void)execv(deliver_set->sendmail_path, (char **)argv);
- i_fatal("execv(%s) failed: %m", deliver_set->sendmail_path);
+ (void)execv(sendmail_path, (char **)argv);
+ i_fatal("execv(%s) failed: %m", sendmail_path);
}
struct smtp_client *smtp_client_open(const char *destination,
More information about the dovecot-cvs
mailing list