str_sanitize(reason, 512));
}
- smtp_client = smtp_client_open(ctx, return_addr, NULL, &f);
+ smtp_client = smtp_client_open(ctx->set, return_addr, NULL, &f);
msgid = mail_deliver_get_new_message_id(ctx);
boundary = t_strdup_printf("%s/%s", my_pid, ctx->set->hostname);
forwardto, return_path);
}
- smtp_client = smtp_client_open(ctx, forwardto, return_path, &f);
+ smtp_client = smtp_client_open(ctx->set, forwardto, return_path, &f);
input = i_stream_create_header_filter(input, HEADER_FILTER_EXCLUDE |
HEADER_FILTER_NO_CR, hide_headers,
}
static void ATTR_NORETURN
-smtp_client_run_sendmail(struct mail_deliver_context *ctx,
+smtp_client_run_sendmail(const struct lda_settings *set,
const char *destination,
const char *return_path, int fd)
{
/* 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(ctx->set->sendmail_path);
+ sendmail_path = t_strdup(set->sendmail_path);
argv[0] = sendmail_path;
argv[1] = "-i"; /* ignore dots */
i_fatal("execv(%s) failed: %m", sendmail_path);
}
-struct smtp_client *smtp_client_open(struct mail_deliver_context *ctx,
- const char *destination,
- const char *return_path, FILE **file_r)
+struct smtp_client *
+smtp_client_open(const struct lda_settings *set, const char *destination,
+ const char *return_path, FILE **file_r)
{
struct smtp_client *client;
int fd[2];
if (pid == 0) {
/* child */
(void)close(fd[1]);
- smtp_client_run_sendmail(ctx, destination, return_path, fd[0]);
+ smtp_client_run_sendmail(set, destination, return_path, fd[0]);
}
(void)close(fd[0]);
#include <stdio.h>
-struct smtp_client *smtp_client_open(struct mail_deliver_context *ctx,
- const char *destination,
- const char *return_path, FILE **file_r);
+struct smtp_client *
+smtp_client_open(const struct lda_settings *set, const char *destination,
+ const char *return_path, FILE **file_r);
/* Returns sysexits-compatible return value */
int smtp_client_close(struct smtp_client *client);