-/* $Cambridge: exim/src/src/dkim.c,v 1.7 2009/10/15 15:44:51 tom Exp $ */
+/* $Cambridge: exim/src/src/dkim.c,v 1.11 2009/12/15 08:23:15 tom Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 2009 */
+/* Copyright (c) University of Cambridge, 1995 - 2007 */
/* See the file NOTICE for conditions of use and distribution. */
/* Code for DKIM support. Other DKIM relevant code is in
uschar *rc = NULL;
pdkim_signature *signature;
int pdkim_canon;
+ int pdkim_rc;
int sread;
char buf[4096];
int save_errno = 0;
if (Ustrcmp(dkim_canon, "relaxed") == 0)
pdkim_canon = PDKIM_CANON_RELAXED;
else if (Ustrcmp(dkim_canon, "simple") == 0)
- pdkim_canon = PDKIM_CANON_RELAXED;
+ pdkim_canon = PDKIM_CANON_SIMPLE;
else {
log_write(0, LOG_MAIN, "DKIM: unknown canonicalization method '%s', defaulting to 'relaxed'.\n",dkim_canon);
pdkim_canon = PDKIM_CANON_RELAXED;
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);
store_pool = old_pool;
errno = save_errno;
return rc;
-};
+}
#endif