diff --git a/src/lda/main.c b/src/lda/main.c index 869271f4fa..273ef7f2eb 100644 --- a/src/lda/main.c +++ b/src/lda/main.c @@ -210,10 +210,9 @@ lda_set_rcpt_to(struct mail_deliver_context *ctx, if (ctx->rcpt_to == NULL) ctx->rcpt_to = rcpt_to; - if (ctx->rcpt_user->mail_debug) { - i_debug("Destination address: %s (source: %s)", - smtp_address_encode_path(rcpt_to), rcpt_to_source); - } + e_debug(ctx->rcpt_user->event, + "Destination address: %s (source: %s)", + smtp_address_encode_path(rcpt_to), rcpt_to_source); } static void failure_exit_callback(int *status) @@ -452,8 +451,9 @@ int main(int argc, char *argv[]) ctx.set = lda_set; ctx.smtp_set = smtp_set; - if (ctx.rcpt_user->mail_debug && *user_source != '\0') { - i_debug("userdb lookup skipped, username taken from %s", + if (*user_source != '\0') { + e_debug(ctx.rcpt_user->event, + "userdb lookup skipped, username taken from %s", user_source); } diff --git a/src/lib-lda/mail-send.c b/src/lib-lda/mail-send.c index 703a819851..af817b0235 100644 --- a/src/lib-lda/mail-send.c +++ b/src/lib-lda/mail-send.c @@ -91,11 +91,9 @@ int mail_send_rejection(struct mail_deliver_context *ctx, return -1; } - if (mailbox_get_settings(mail->box)->mail_debug) { - i_debug("Sending a rejection to <%s>: %s", - smtp_address_encode(return_addr), - str_sanitize(reason, 512)); - } + e_debug(mail->event, "Sending a rejection to <%s>: %s", + smtp_address_encode(return_addr), + str_sanitize(reason, 512)); vtable = get_var_expand_table(mail, recipient, reason);