|
Lines 85-91
Link Here
|
| 85 |
+ /* spam support */ |
85 |
+ /* spam support */ |
| 86 |
+ |
86 |
+ |
| 87 |
+ static int |
87 |
+ static int |
| 88 |
+ getline (int s, char *buf, int len) |
88 |
+ local_getline (int s, char *buf, int len) |
| 89 |
+ { |
89 |
+ { |
| 90 |
+ char *bp = buf; |
90 |
+ char *bp = buf; |
| 91 |
+ int ret = 1; |
91 |
+ int ret = 1; |
|
Lines 129-136
Link Here
|
| 129 |
+ int score; |
129 |
+ int score; |
| 130 |
+ int threshold; |
130 |
+ int threshold; |
| 131 |
+ |
131 |
+ |
| 132 |
+ if (! getline (s, buf, sizeof (buf))) { |
132 |
+ if (! local_getline (s, buf, sizeof (buf))) { |
| 133 |
+ syslog (LOG_ERR, "read_response: response getline failed"); |
133 |
+ syslog (LOG_ERR, "read_response: response local_getline failed"); |
| 134 |
+ return SIEVE_FAIL; |
134 |
+ return SIEVE_FAIL; |
| 135 |
+ } |
135 |
+ } |
| 136 |
+ if (sscanf (buf, "SPAMD/%d.%d %d %*s", &major, &minor, &response) != 3) { |
136 |
+ if (sscanf (buf, "SPAMD/%d.%d %d %*s", &major, &minor, &response) != 3) { |
|
Lines 143-150
Link Here
|
| 143 |
+ major, minor); |
143 |
+ major, minor); |
| 144 |
+ return SIEVE_FAIL; |
144 |
+ return SIEVE_FAIL; |
| 145 |
+ } |
145 |
+ } |
| 146 |
+ if (! getline (s, buf, sizeof (buf))) { |
146 |
+ if (! local_getline (s, buf, sizeof (buf))) { |
| 147 |
+ syslog (LOG_ERR, "read_response: header getline failed"); |
147 |
+ syslog (LOG_ERR, "read_response: header local_getline failed"); |
| 148 |
+ return SIEVE_FAIL; |
148 |
+ return SIEVE_FAIL; |
| 149 |
+ } |
149 |
+ } |
| 150 |
+ if (sscanf (buf, "Spam: %5s ; %d / %d", is_spam, &score, &threshold) != 3) { |
150 |
+ if (sscanf (buf, "Spam: %5s ; %d / %d", is_spam, &score, &threshold) != 3) { |