]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
smtp_client_open() API changed to take lda_settings instead of mail_deliver_context.
authorTimo Sirainen <tss@iki.fi>
Mon, 17 Aug 2009 17:05:32 +0000 (13:05 -0400)
committerTimo Sirainen <tss@iki.fi>
Mon, 17 Aug 2009 17:05:32 +0000 (13:05 -0400)
--HG--
branch : HEAD

src/lib-lda/mail-send.c
src/lib-lda/smtp-client.c
src/lib-lda/smtp-client.h

index 4d97428b2bb10fea3fded89d6dce318f36308975..9e3eb2aeb99f12f4303d965073f55a39f9c1a2f1 100644 (file)
@@ -79,7 +79,7 @@ int mail_send_rejection(struct mail_deliver_context *ctx, const char *recipient,
                   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);
@@ -184,7 +184,7 @@ int mail_send_forward(struct mail_deliver_context *ctx, const char *forwardto)
                   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,
index aed7ba1e7b49bfe41d28c3bf22da5639a04bed3f..3882c44a18bafa9b88b71e00eb1d5fcf1031ac31 100644 (file)
@@ -28,7 +28,7 @@ static struct smtp_client *smtp_client_devnull(FILE **file_r)
 }
 
 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)
 {
@@ -36,7 +36,7 @@ smtp_client_run_sendmail(struct mail_deliver_context *ctx,
 
        /* 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 */
@@ -56,9 +56,9 @@ smtp_client_run_sendmail(struct mail_deliver_context *ctx,
        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];
@@ -77,7 +77,7 @@ struct smtp_client *smtp_client_open(struct mail_deliver_context *ctx,
        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]);
 
index 24b14b2f5ea4d073152b06f75196d45c7a702aea..a5bb0072402c420a2a36cff0bb7838ba1531531d 100644 (file)
@@ -3,9 +3,9 @@
 
 #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);