67 |
|
|
68 |
init_filter(f); |
init_filter(f); |
69 |
|
|
70 |
strncat(f->key, line + m[1].rm_so, |
strncat(f->key, line + m[1].rm_so, min(m[1].rm_eo - m[1].rm_so, |
71 |
min(m[1].rm_eo - m[1].rm_so, KEY_LEN - 1)); |
KEY_LEN - 1)); |
72 |
|
|
73 |
if (m[2].rm_so != -1) { |
if (m[2].rm_so != -1) { |
74 |
if (!strncasecmp(line + m[2].rm_so + 1, "or", 2)) |
if (!strncasecmp(line + m[2].rm_so + 1, "or", 2)) |
108 |
strncat(curfltr->action.destmbox, |
strncat(curfltr->action.destmbox, |
109 |
line + m[2].rm_so + 1, |
line + m[2].rm_so + 1, |
110 |
min(m[2].rm_eo - m[2].rm_so - 2, |
min(m[2].rm_eo - m[2].rm_so - 2, |
111 |
MBOX_LEN - 1)); |
MBOX_LEN - 1)); |
112 |
else |
else |
113 |
strncat(curfltr->action.destmbox, line + m[2].rm_so, |
strncat(curfltr->action.destmbox, line + m[2].rm_so, |
114 |
min(m[2].rm_eo - m[2].rm_so, MBOX_LEN - 1)); |
min(m[2].rm_eo - m[2].rm_so, MBOX_LEN - 1)); |
119 |
strncat(curfltr->action.destmbox, |
strncat(curfltr->action.destmbox, |
120 |
line + m[3].rm_so + 1, |
line + m[3].rm_so + 1, |
121 |
min(m[3].rm_eo - m[3].rm_so - 2, |
min(m[3].rm_eo - m[3].rm_so - 2, |
122 |
MBOX_LEN - 1)); |
MBOX_LEN - 1)); |
123 |
else |
else |
124 |
strncat(curfltr->action.destmbox, line + m[3].rm_so, |
strncat(curfltr->action.destmbox, line + m[3].rm_so, |
125 |
min(m[3].rm_eo - m[3].rm_so, MBOX_LEN - 1)); |
min(m[3].rm_eo - m[3].rm_so, MBOX_LEN - 1)); |
127 |
curfltr->action.type = ACTION_RCOPY; |
curfltr->action.type = ACTION_RCOPY; |
128 |
for (a = accounts; a; a = a->next) |
for (a = accounts; a; a = a->next) |
129 |
if (!strncasecmp(line + m[4].rm_so, a->key, |
if (!strncasecmp(line + m[4].rm_so, a->key, |
130 |
strlen(a->key))) |
strlen(a->key))) |
131 |
curfltr->action.raccount = a; |
curfltr->action.raccount = a; |
132 |
if (!curfltr->action.raccount) |
if (!curfltr->action.raccount) |
133 |
return ERROR_PARSER; |
return ERROR_PARSER; |
137 |
strncat(curfltr->action.destmbox, |
strncat(curfltr->action.destmbox, |
138 |
line + m[5].rm_so + 1, |
line + m[5].rm_so + 1, |
139 |
min(m[5].rm_eo - m[5].rm_so - 2, |
min(m[5].rm_eo - m[5].rm_so - 2, |
140 |
MBOX_LEN - 1)); |
MBOX_LEN - 1)); |
141 |
else |
else |
142 |
strncat(curfltr->action.destmbox, line + m[5].rm_so, |
strncat(curfltr->action.destmbox, line + m[5].rm_so, |
143 |
min(m[5].rm_eo - m[5].rm_so, MBOX_LEN - 1)); |
min(m[5].rm_eo - m[5].rm_so, MBOX_LEN - 1)); |
145 |
curfltr->action.type = ACTION_RMOVE; |
curfltr->action.type = ACTION_RMOVE; |
146 |
for (a = accounts; a; a = a->next) |
for (a = accounts; a; a = a->next) |
147 |
if (!strncasecmp(line + m[6].rm_so, a->key, |
if (!strncasecmp(line + m[6].rm_so, a->key, |
148 |
strlen(a->key))) |
strlen(a->key))) |
149 |
curfltr->action.raccount = a; |
curfltr->action.raccount = a; |
150 |
if (!curfltr->action.raccount) |
if (!curfltr->action.raccount) |
151 |
return ERROR_PARSER; |
return ERROR_PARSER; |
155 |
strncat(curfltr->action.destmbox, |
strncat(curfltr->action.destmbox, |
156 |
line + m[7].rm_so + 1, |
line + m[7].rm_so + 1, |
157 |
min(m[7].rm_eo - m[7].rm_so - 2, |
min(m[7].rm_eo - m[7].rm_so - 2, |
158 |
MBOX_LEN - 1)); |
MBOX_LEN - 1)); |
159 |
else |
else |
160 |
strncat(curfltr->action.destmbox, line + m[7].rm_so, |
strncat(curfltr->action.destmbox, line + m[7].rm_so, |
161 |
min(m[7].rm_eo - m[7].rm_so, MBOX_LEN - 1)); |
min(m[7].rm_eo - m[7].rm_so, MBOX_LEN - 1)); |
224 |
|
|
225 |
|
|
226 |
/* |
/* |
227 |
* A new mask entry was declared, create it and set it's |
* A new mask entry was declared, create it and set it's variables accordingly. |
|
* variables accordingly. |
|
228 |
*/ |
*/ |
229 |
int |
int |
230 |
set_mask(char *line, regmatch_t * m, int mmt) |
set_mask(char *line, regmatch_t * m, int mmt) |