Mercurial > dnsbl
comparison src/dnsbl.cpp @ 352:f5a6740cabee
need to lowercase the domain extracted from the from header so it will match the keys in dkim_from
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Mon, 26 Dec 2016 12:30:08 -0800 |
parents | f4ca91f49cb6 |
children | 2fd904f2efc2 |
comparison
equal
deleted
inserted
replaced
351:d4be824a3870 | 352:f5a6740cabee |
---|---|
1115 } | 1115 } |
1116 if ((n > 1) && (email[0] == '\'') && (email[n-1] == '\'')) { | 1116 if ((n > 1) && (email[0] == '\'') && (email[n-1] == '\'')) { |
1117 n -= 2; | 1117 n -= 2; |
1118 email++; | 1118 email++; |
1119 } | 1119 } |
1120 if (n ==0) return strdup("<>"); | 1120 if (n == 0) return strdup("<>"); |
1121 char *key = strdup(email); | 1121 char *key = strdup(email); |
1122 key[n] = '\0'; | 1122 key[n] = '\0'; |
1123 for (size_t i=0; i<n; i++) key[i] = tolower(key[i]); | 1123 for (size_t i=0; i<n; i++) key[i] = tolower(key[i]); |
1124 | 1124 |
1125 if (srs) { | 1125 if (srs) { |
1530 if (0 == regexec(&from_pattern, value, nmatch, match, 0)) { | 1530 if (0 == regexec(&from_pattern, value, nmatch, match, 0)) { |
1531 int s1 = match[1].rm_so; // domain | 1531 int s1 = match[1].rm_so; // domain |
1532 int e1 = match[1].rm_eo; | 1532 int e1 = match[1].rm_eo; |
1533 if (s1 != -1) { | 1533 if (s1 != -1) { |
1534 value[e1] = '\0'; | 1534 value[e1] = '\0'; |
1535 priv.fromaddr = strdup(value+s1); | 1535 priv.fromaddr = to_lower_string(value+s1, false); |
1536 } | 1536 } |
1537 } | 1537 } |
1538 } | 1538 } |
1539 | 1539 |
1540 // headers that avoid autowhitelisting | 1540 // headers that avoid autowhitelisting |