From: Tom Kistner Date: Tue, 15 Dec 2009 08:23:15 +0000 (+0000) Subject: Improve log output when DKIM signing operation fails. X-Git-Tag: exim-4_72_RC1~15 X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/dcdf4e3e2e614d612f7d4d884c856c7b67caf5e3 Improve log output when DKIM signing operation fails. --- diff --git a/src/src/dkim.c b/src/src/dkim.c index e41dd132c..e303776c2 100644 --- a/src/src/dkim.c +++ b/src/src/dkim.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/dkim.c,v 1.10 2009/11/16 19:50:36 nm4 Exp $ */ +/* $Cambridge: exim/src/src/dkim.c,v 1.11 2009/12/15 08:23:15 tom Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -391,6 +391,7 @@ uschar *dkim_exim_sign(int dkim_fd, uschar *rc = NULL; pdkim_signature *signature; int pdkim_canon; + int pdkim_rc; int sread; char buf[4096]; int save_errno = 0; @@ -511,8 +512,11 @@ uschar *dkim_exim_sign(int dkim_fd, goto CLEANUP; } - if (pdkim_feed_finish(ctx,&signature) != PDKIM_OK) + pdkim_rc = pdkim_feed_finish(ctx,&signature); + if (pdkim_rc != PDKIM_OK) { + log_write(0, LOG_MAIN|LOG_PANIC, "DKIM: signing failed (RC %d)", pdkim_rc); goto CLEANUP; + } rc = store_get(strlen(signature->signature_header)+3); Ustrcpy(rc,US signature->signature_header); diff --git a/src/src/transport.c b/src/src/transport.c index 9b2a66631..e68a24dcb 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/transport.c,v 1.25 2009/11/16 19:50:37 nm4 Exp $ */ +/* $Cambridge: exim/src/src/transport.c,v 1.26 2009/12/15 08:23:15 tom Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -1034,7 +1034,9 @@ dkim_transport_write_message(address_item *addr, int fd, int options, if (dkim_strict_result != NULL) { if ( (strcmpic(dkim_strict,US"1") == 0) || (strcmpic(dkim_strict,US"true") == 0) ) { - save_errno = errno; + /* Set errno to something halfway meaningful */ + save_errno = EACCES; + log_write(0, LOG_MAIN, "DKIM: message could not be signed, and dkim_strict is set. Deferring message delivery."); rc = FALSE; goto CLEANUP; }