aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-09-19 16:56:16 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-09-19 20:59:25 +0200
commitb0e378af1d574d2745e676acdb2cf180a7338886 (patch)
tree37ece6ccf1d806c8f52cba7895e594c5f6153c6d /src/libserver
parent4a09a0c772b6f73dda7c44d637771fd2596f1acc (diff)
downloadrspamd-b0e378af1d574d2745e676acdb2cf180a7338886.tar.gz
rspamd-b0e378af1d574d2745e676acdb2cf180a7338886.zip
[Feature] Add R_DKIM_PERMFAIL symbol
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/dkim.c9
-rw-r--r--src/libserver/dkim.h3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c
index 3c4d7ed36..33ac2cb96 100644
--- a/src/libserver/dkim.c
+++ b/src/libserver/dkim.c
@@ -1111,9 +1111,16 @@ rspamd_dkim_dns_cb (struct rdns_reply *reply, gpointer arg)
gsize keylen = 0;
if (reply->code != RDNS_RC_NOERROR) {
+ gint err_code = DKIM_SIGERROR_NOKEY;
+ if (reply->code == RDNS_RC_NOREC) {
+ err_code = DKIM_SIGERROR_NOREC;
+ }
+ else if (reply->code == RDNS_RC_NXDOMAIN) {
+ err_code = DKIM_SIGERROR_NOREC;
+ }
g_set_error (&err,
DKIM_ERROR,
- DKIM_SIGERROR_NOKEY,
+ err_code,
"dns request to %s failed: %s",
cbdata->ctx->dns_key,
rdns_strerror (reply->code));
diff --git a/src/libserver/dkim.h b/src/libserver/dkim.h
index 35f298807..b2ff151ad 100644
--- a/src/libserver/dkim.h
+++ b/src/libserver/dkim.h
@@ -36,7 +36,7 @@
#define DKIM_SIGERROR_EXPIRED 3 /* signature expired */
#define DKIM_SIGERROR_FUTURE 4 /* signature in the future */
#define DKIM_SIGERROR_TIMESTAMPS 5 /* x= < t= */
-#define DKIM_SIGERROR_UNUSED 6 /* OBSOLETE */
+#define DKIM_SIGERROR_NOREC 6 /* No record */
#define DKIM_SIGERROR_INVALID_HC 7 /* c= invalid (header) */
#define DKIM_SIGERROR_INVALID_BC 8 /* c= invalid (body) */
#define DKIM_SIGERROR_MISSING_A 9 /* a= missing */
@@ -83,6 +83,7 @@
#define DKIM_TRYAGAIN 2 /* try again later */
#define DKIM_NOTFOUND 3 /* requested record not found */
#define DKIM_RECORD_ERROR 4 /* error requesting record */
+#define DKIM_PERM_ERROR 5 /* permanent error */
#define DKIM_CANON_SIMPLE 0 /* as specified in DKIM spec */
#define DKIM_CANON_RELAXED 1 /* as specified in DKIM spec */