aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-07-02 23:25:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-07-02 23:25:58 +0100
commit124a73f604b74ce8f4513592d4be8440594c97f7 (patch)
tree8da68cbe782fc99706ac9ac65e72c3de0df72317 /src/libserver
parentedd96476d40a6fc348ec864902c4e0f2cf675b3a (diff)
downloadrspamd-124a73f604b74ce8f4513592d4be8440594c97f7.tar.gz
rspamd-124a73f604b74ce8f4513592d4be8440594c97f7.zip
[Fix] Allow modifiers in SPF macros
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/spf.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/libserver/spf.c b/src/libserver/spf.c
index 32ee6c453..d2813c272 100644
--- a/src/libserver/spf.c
+++ b/src/libserver/spf.c
@@ -1488,15 +1488,6 @@ expand_spf_macro (struct spf_record *rec, struct spf_resolved_element *resolved,
state = 0;
need_expand = TRUE;
}
- else if (*p != 'r' && !g_ascii_isdigit (*p)) {
- msg_info_spf (
- "<%s>: spf error for domain %s: unknown or unsupported spf modifier %c in %s",
- task->message_id,
- rec->sender_domain,
- *p,
- begin);
- return begin;
- }
p++;
slen++;
break;
@@ -1620,7 +1611,8 @@ expand_spf_macro (struct spf_record *rec, struct spf_resolved_element *resolved,
break;
default:
msg_info_spf (
- "<%s>: spf error for domain %s: unknown or unsupported spf macro %c in %s",
+ "<%s>: spf error for domain %s: unknown or "
+ "unsupported spf macro %c in %s",
task->message_id,
rec->sender_domain,
*p,
@@ -1639,12 +1631,15 @@ expand_spf_macro (struct spf_record *rec, struct spf_resolved_element *resolved,
reverse_spf_ip (c - len, len);
len = 0;
}
- else if (g_ascii_isdigit (*p)) {
- /*XXX: try to implement domain trimming */
+ else if (g_ascii_isdigit (*p) || *p == '+' || *p == '-' ||
+ *p == '.' || *p == ',' || *p == '/' || *p == '_' ||
+ *p == '=') {
+ /* TODO: implement domain trimming */
}
else {
msg_info_spf (
- "<%s>: spf error for domain %s: unknown or unsupported spf macro %c in %s",
+ "<%s>: spf error for domain %s: unknown or "
+ "unsupported spf macro %c in %s",
task->message_id,
rec->sender_domain,
*p,