diff --git a/src/lib-sieve/cmd-redirect.c b/src/lib-sieve/cmd-redirect.c index ddd500d53e8c48e0b02a83ec2bf9e2b40d974990..b5dc36cf12224485d55896b9df431d8f8f76ab31 100644 --- a/src/lib-sieve/cmd-redirect.c +++ b/src/lib-sieve/cmd-redirect.c @@ -280,12 +280,12 @@ static bool act_redirect_send /* Just to be sure */ if ( senv->smtp_open == NULL || senv->smtp_close == NULL ) { - sieve_result_error(aenv, "redirect action has no means to send mail."); + sieve_result_warning(aenv, "redirect action has no means to send mail."); return FALSE; } if (mail_get_stream(msgdata->mail, NULL, NULL, &input) < 0) - return -1; + return FALSE; /* Open SMTP transport */ smtp_handle = senv->smtp_open(ctx->to_address, msgdata->return_path, &f); @@ -304,7 +304,15 @@ static bool act_redirect_send i_stream_unref(&input); /* Close SMTP transport */ - return senv->smtp_close(smtp_handle); + if ( !senv->smtp_close(smtp_handle) ) { + sieve_result_error(aenv, + "failed to redirect message to <%s> " + "(refer to server log for more information)", + str_sanitize(ctx->to_address, 80)); + return FALSE; + } + + return TRUE; } static bool act_redirect_commit diff --git a/src/lib-sieve/ext-reject.c b/src/lib-sieve/ext-reject.c index 70b2c03612d91f4d152f6bd6455322650ee77b40..89ea05126ba7a6d6632b10b13f01ee143cb5cef1 100644 --- a/src/lib-sieve/ext-reject.c +++ b/src/lib-sieve/ext-reject.c @@ -318,8 +318,8 @@ static bool act_reject_send /* Just to be sure */ if ( senv->smtp_open == NULL || senv->smtp_close == NULL ) { - sieve_result_error(aenv, "reject action has no means to send mail."); - return FALSE; + sieve_result_warning(aenv, "reject action has no means to send mail."); + return TRUE; } smtp_handle = senv->smtp_open(msgdata->return_path, NULL, &f); @@ -395,7 +395,15 @@ static bool act_reject_send fprintf(f, "\r\n\r\n--%s--\r\n", boundary); - return senv->smtp_close(smtp_handle); + if ( !senv->smtp_close(smtp_handle) ) { + sieve_result_error(aenv, + "failed to send rejection message to <%s> " + "(refer to server log for more information)", + str_sanitize(msgdata->return_path, 80)); + return FALSE; + } + + return TRUE; } static bool act_reject_commit @@ -411,14 +419,14 @@ static bool act_reject_commit *keep = FALSE; return TRUE; } - + if ( act_reject_send(aenv, ctx) ) { sieve_result_log(aenv, "rejected"); *keep = FALSE; return TRUE; } - + return FALSE; } diff --git a/src/lib-sieve/plugins/vacation/cmd-vacation.c b/src/lib-sieve/plugins/vacation/cmd-vacation.c index 57c3343ce73e6452f929c6e2232768ea6b920244..12daacd561a89068e23bb3dcdfab9b76024bf716 100644 --- a/src/lib-sieve/plugins/vacation/cmd-vacation.c +++ b/src/lib-sieve/plugins/vacation/cmd-vacation.c @@ -800,8 +800,8 @@ static bool act_vacation_send /* Check smpt functions just to be sure */ if ( senv->smtp_open == NULL || senv->smtp_close == NULL ) { - sieve_result_error(aenv, "vacation action has no means to send mail."); - return FALSE; + sieve_result_warning(aenv, "vacation action has no means to send mail."); + return TRUE; } /* Open smtp session */ @@ -842,10 +842,15 @@ static bool act_vacation_send fprintf(f, "%s\r\n", ctx->reason); /* Close smtp session */ - if ( senv->smtp_close(smtp_handle) ) + if ( !senv->smtp_close(smtp_handle) ) { + sieve_result_error(aenv, + "failed to send vacation response to <%s> " + "(refer to server log for more information)", + str_sanitize(msgdata->return_path, 128)); return TRUE; + } - return FALSE; + return TRUE; } static void act_vacation_hash @@ -1011,10 +1016,6 @@ static bool act_vacation_commit return TRUE; } - /* Failure message; should be preceded by a more informative error */ - sieve_result_error(aenv, "failed to send vacation response to <%s>", - str_sanitize(msgdata->return_path, 128)); - return FALSE; } diff --git a/src/plugins/lda-sieve/lda-sieve-plugin.c b/src/plugins/lda-sieve/lda-sieve-plugin.c index 34f1f98a0bcca4f0df4f629f7532258e7bf0d2c9..b04d48b3f55f69b143ac25b1ed81ca19cda873b4 100644 --- a/src/plugins/lda-sieve/lda-sieve-plugin.c +++ b/src/plugins/lda-sieve/lda-sieve-plugin.c @@ -41,7 +41,7 @@ static bool lda_sieve_smtp_close(void *handle) { struct smtp_client *smtp_client = (struct smtp_client *) handle; - return ( smtp_client_close(smtp_client) >= 0 ); + return ( smtp_client_close(smtp_client) == 0 ); } /*