aboutsummaryrefslogtreecommitdiffstats
path: root/src/dkim.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-06-05 02:39:21 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-06-05 02:39:21 +0400
commit1d8da7cd96a810bc6119a8f604e934235e68f9cf (patch)
treedc5429eff1a4fdd0e7e932d4fc8675b94ebf8398 /src/dkim.c
parent75f3cf52fcb5421d98fd1a2ab0d9ae50d0ef3b1e (diff)
downloadrspamd-1d8da7cd96a810bc6119a8f604e934235e68f9cf.tar.gz
rspamd-1d8da7cd96a810bc6119a8f604e934235e68f9cf.zip
* DKIM module now check only first signature as others must be rejected or skipped by definition.
* Add 'trusted_only' and 'skip_multi' options to DKIM module. * Improve flags parsing to support strings like: 'true', 'false', '1', '0', 'yes', 'no', 'y', 'n'.
Diffstat (limited to 'src/dkim.c')
-rw-r--r--src/dkim.c88
1 files changed, 48 insertions, 40 deletions
diff --git a/src/dkim.c b/src/dkim.c
index d50ddc0eb..7d4d91471 100644
--- a/src/dkim.c
+++ b/src/dkim.c
@@ -854,7 +854,7 @@ rspamd_dkim_relaxed_body_step (GChecksum *ck, const gchar **start, guint remain)
*start = h;
-#if 1
+#if 0
msg_debug ("update signature with buffer: %*s", t - buf, buf);
#endif
g_checksum_update (ck, buf, t - buf);
@@ -1087,17 +1087,19 @@ rspamd_dkim_canonize_header_simple (rspamd_dkim_context_t *ctx, const gchar *hea
}
}
- if (!is_sign) {
+ if (found) {
+ if (!is_sign) {
- for (i = to_sign->len - 1; i >= 0 && count > 0; i --, count --) {
- elt = &g_array_index (to_sign, struct rspamd_dkim_sign_chunk, i);
- msg_debug ("update signature with header: %*s", elt->len, elt->begin);
- g_checksum_update (ctx->headers_hash, elt->begin, elt->len);
+ for (i = to_sign->len - 1; i >= 0 && count > 0; i --, count --) {
+ elt = &g_array_index (to_sign, struct rspamd_dkim_sign_chunk, i);
+ msg_debug ("update signature with header: %*s", elt->len, elt->begin);
+ g_checksum_update (ctx->headers_hash, elt->begin, elt->len);
+ }
+ }
+ else {
+ elt = &g_array_index (to_sign, struct rspamd_dkim_sign_chunk, 0);
+ rspamd_dkim_signature_update (ctx, elt->begin, elt->len);
}
- }
- else {
- elt = &g_array_index (to_sign, struct rspamd_dkim_sign_chunk, to_sign->len - 1);
- rspamd_dkim_signature_update (ctx, elt->begin, elt->len);
}
g_array_free (to_sign, TRUE);
@@ -1119,40 +1121,46 @@ rspamd_dkim_canonize_header (rspamd_dkim_context_t *ctx, struct worker_task *tas
else {
rh = g_hash_table_lookup (task->raw_headers, header_name);
if (rh) {
- rh_iter = rh;
- while (rh_iter) {
- rh_num ++;
- rh_iter = rh_iter->next;
- }
+ if (!is_sig) {
+ rh_iter = rh;
+ while (rh_iter) {
+ rh_num ++;
+ rh_iter = rh_iter->next;
+ }
- if (rh_num > count) {
- /* Set skip count */
- rh_num -= count;
- }
- else {
- rh_num = 0;
- }
- rh_iter = rh;
- while (rh_num) {
- rh_iter = rh_iter->next;
- rh_num --;
- }
- /* Now insert required headers */
- while (rh_iter) {
- nh = g_list_prepend (nh, rh_iter);
- rh_iter = rh_iter->next;
- }
- cur = nh;
- while (cur) {
- rh = cur->data;
- if (! rspamd_dkim_canonize_header_relaxed (ctx, rh->value, header_name, is_sig)) {
+ if (rh_num > count) {
+ /* Set skip count */
+ rh_num -= count;
+ }
+ else {
+ rh_num = 0;
+ }
+ rh_iter = rh;
+ while (rh_num) {
+ rh_iter = rh_iter->next;
+ rh_num --;
+ }
+ /* Now insert required headers */
+ while (rh_iter) {
+ nh = g_list_prepend (nh, rh_iter);
+ rh_iter = rh_iter->next;
+ }
+ cur = nh;
+ while (cur) {
+ rh = cur->data;
+ if (! rspamd_dkim_canonize_header_relaxed (ctx, rh->value, header_name, is_sig)) {
+ g_list_free (nh);
+ return FALSE;
+ }
+ cur = g_list_next (cur);
+ }
+ if (nh != NULL) {
g_list_free (nh);
- return FALSE;
}
- cur = g_list_next (cur);
}
- if (nh != NULL) {
- g_list_free (nh);
+ else {
+ /* For signature check just use the first dkim header */
+ rspamd_dkim_canonize_header_relaxed (ctx, rh->value, header_name, is_sig);
}
return TRUE;
}
Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/l10n/ca.json
blob: 61f816eb2da47d3d2d6bf748fd231b35506c2e17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56