1 |
/* GNU mailutils - a suite of utilities for electronic mail |
/* GNU Mailutils -- a suite of utilities for electronic mail |
2 |
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
GNU Mailutils is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU Lesser General Public License as published by |
it under the terms of the GNU Lesser General Public License as published by |
6 |
the Free Software Foundation; either version 2, or (at your option) |
the Free Software Foundation; either version 2, or (at your option) |
7 |
any later version. |
any later version. |
8 |
|
|
9 |
This program is distributed in the hope that it will be useful, |
GNU Mailutils is distributed in the hope that it will be useful, |
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
GNU Lesser General Public License for more details. |
GNU Lesser General Public License for more details. |
13 |
|
|
14 |
You should have received a copy of the GNU Lesser General Public License |
You should have received a copy of the GNU Lesser General Public License |
15 |
along with this program; if not, write to the Free Software |
along with GNU Mailutils; if not, write to the Free Software |
16 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
17 |
|
|
18 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
46 |
int |
int |
47 |
sieve_action_discard (sieve_machine_t mach, list_t args, list_t tags) |
sieve_action_discard (sieve_machine_t mach, list_t args, list_t tags) |
48 |
{ |
{ |
49 |
sieve_log_action (mach, "DISCARD", "marking as deleted"); |
sieve_log_action (mach, "DISCARD", _("marking as deleted")); |
50 |
if (sieve_is_dry_run (mach)) |
if (sieve_is_dry_run (mach)) |
51 |
return 0; |
return 0; |
52 |
sieve_mark_deleted (mach->msg, 1); |
sieve_mark_deleted (mach->msg, 1); |
60 |
sieve_value_t *val = sieve_value_get (args, 0); |
sieve_value_t *val = sieve_value_get (args, 0); |
61 |
if (!val) |
if (!val) |
62 |
{ |
{ |
63 |
sieve_error (mach, "fileinto: can't get filename!"); |
sieve_error (mach, _("fileinto: can't get filename!")); |
64 |
sieve_abort (mach); |
sieve_abort (mach); |
65 |
} |
} |
66 |
sieve_log_action (mach, "FILEINTO", "delivering into %s", val->v.string); |
sieve_log_action (mach, "FILEINTO", _("delivering into %s"), val->v.string); |
67 |
if (sieve_is_dry_run (mach)) |
if (sieve_is_dry_run (mach)) |
68 |
return 0; |
return 0; |
69 |
|
|
70 |
rc = message_save_to_mailbox (mach->msg, mach->ticket, mach->mu_debug, |
rc = message_save_to_mailbox (mach->msg, mach->ticket, mach->mu_debug, |
71 |
val->v.string); |
val->v.string); |
72 |
if (rc) |
if (rc) |
73 |
sieve_error (mach, "fileinto: cannot save to mailbox: %s", |
sieve_error (mach, _("fileinto: cannot save to mailbox: %s"), |
74 |
mu_errstring (rc)); |
mu_errstring (rc)); |
75 |
else |
else |
76 |
sieve_mark_deleted (mach->msg, 1); |
sieve_mark_deleted (mach->msg, 1); |
236 |
sieve_value_t *val = sieve_value_get (args, 0); |
sieve_value_t *val = sieve_value_get (args, 0); |
237 |
if (!val) |
if (!val) |
238 |
{ |
{ |
239 |
sieve_error (mach, "reject: can't get text!"); |
sieve_error (mach, _("reject: can't get text!")); |
240 |
sieve_abort (mach); |
sieve_abort (mach); |
241 |
} |
} |
242 |
sieve_log_action (mach, "REJECT", NULL); |
sieve_log_action (mach, "REJECT", NULL); |
252 |
if (rc) |
if (rc) |
253 |
{ |
{ |
254 |
sieve_error (mach, |
sieve_error (mach, |
255 |
"%d: reject - can't create to address <%s>: %s\n", |
_("%d: reject - can't create to address <%s>: %s\n"), |
256 |
sieve_get_message_num (mach), |
sieve_get_message_num (mach), |
257 |
addrtext, mu_errstring (rc)); |
addrtext, mu_errstring (rc)); |
258 |
free (addrtext); |
free (addrtext); |
264 |
if (rc) |
if (rc) |
265 |
{ |
{ |
266 |
sieve_error (mach, |
sieve_error (mach, |
267 |
"%d: reject - can't create from address <%s>: %s\n", |
_("%d: reject - can't create from address <%s>: %s\n"), |
268 |
sieve_get_message_num (mach), |
sieve_get_message_num (mach), |
269 |
sieve_get_daemon_email (mach), |
sieve_get_daemon_email (mach), |
270 |
mu_errstring (rc)); |
mu_errstring (rc)); |
278 |
mailer_get_url (mailer, &url); |
mailer_get_url (mailer, &url); |
279 |
|
|
280 |
sieve_error (mach, |
sieve_error (mach, |
281 |
"%d: reject - can't open mailer %s: %s\n", |
_("%d: reject - can't open mailer %s: %s\n"), |
282 |
sieve_get_message_num (mach), |
sieve_get_message_num (mach), |
283 |
url_to_string (url), |
url_to_string (url), |
284 |
mu_errstring (rc)); |
mu_errstring (rc)); |
353 |
sieve_value_t *val = sieve_value_get (args, 0); |
sieve_value_t *val = sieve_value_get (args, 0); |
354 |
if (!val) |
if (!val) |
355 |
{ |
{ |
356 |
sieve_error (mach, "redirect: can't get address!"); |
sieve_error (mach, _("redirect: can't get address!")); |
357 |
sieve_abort (mach); |
sieve_abort (mach); |
358 |
} |
} |
359 |
|
|
361 |
if (rc) |
if (rc) |
362 |
{ |
{ |
363 |
sieve_error (mach, |
sieve_error (mach, |
364 |
"%d: redirect - parsing to `%s' failed: %s\n", |
_("%d: redirect - parsing to `%s' failed: %s\n"), |
365 |
sieve_get_message_num (mach), |
sieve_get_message_num (mach), |
366 |
val->v.string, mu_errstring (rc)); |
val->v.string, mu_errstring (rc)); |
367 |
return 1; |
return 1; |
368 |
} |
} |
369 |
|
|
370 |
sieve_log_action (mach, "REDIRECT", "to %s", val->v.string); |
sieve_log_action (mach, "REDIRECT", _("to %s"), val->v.string); |
371 |
if (sieve_is_dry_run (mach)) |
if (sieve_is_dry_run (mach)) |
372 |
return 0; |
return 0; |
373 |
|
|
374 |
msg = sieve_get_message (mach); |
msg = sieve_get_message (mach); |
375 |
if (check_redirect_loop (msg)) |
if (check_redirect_loop (msg)) |
376 |
{ |
{ |
377 |
sieve_error (mach, "%d: Redirection loop detected", |
sieve_error (mach, _("%d: Redirection loop detected"), |
378 |
sieve_get_message_num (mach)); |
sieve_get_message_num (mach)); |
379 |
goto end; |
goto end; |
380 |
} |
} |
383 |
if (rc) |
if (rc) |
384 |
{ |
{ |
385 |
sieve_error (mach, |
sieve_error (mach, |
386 |
"%d: redirect - can't get envelope sender: %s\n", |
_("%d: redirect - can't get envelope sender: %s\n"), |
387 |
sieve_get_message_num (mach), mu_errstring (rc)); |
sieve_get_message_num (mach), mu_errstring (rc)); |
388 |
goto end; |
goto end; |
389 |
} |
} |
392 |
if (rc) |
if (rc) |
393 |
{ |
{ |
394 |
sieve_error (mach, |
sieve_error (mach, |
395 |
"%d: redirect - can't create from address <%s>: %s\n", |
_("%d: redirect - can't create from address <%s>: %s\n"), |
396 |
sieve_get_message_num (mach), |
sieve_get_message_num (mach), |
397 |
fromaddr, mu_errstring (rc)); |
fromaddr, mu_errstring (rc)); |
398 |
free (fromaddr); |
free (fromaddr); |
404 |
rc = message_create_copy (&newmsg, msg); |
rc = message_create_copy (&newmsg, msg); |
405 |
if (rc) |
if (rc) |
406 |
{ |
{ |
407 |
sieve_error (mach, "%d: can't copy message: %s", |
sieve_error (mach, _("%d: can't copy message: %s"), |
408 |
sieve_get_message_num (mach), |
sieve_get_message_num (mach), |
409 |
mu_errstring (rc)); |
mu_errstring (rc)); |
410 |
goto end; |
goto end; |
419 |
} |
} |
420 |
else |
else |
421 |
{ |
{ |
422 |
sieve_error (mach, "%d: can't get my email address", |
sieve_error (mach, _("%d: can't get my email address"), |
423 |
sieve_get_message_num (mach)); |
sieve_get_message_num (mach)); |
424 |
goto end; |
goto end; |
425 |
} |
} |
431 |
mailer_get_url (mailer, &url); |
mailer_get_url (mailer, &url); |
432 |
|
|
433 |
sieve_error (mach, |
sieve_error (mach, |
434 |
"%d: redirect - can't open mailer %s: %s\n", |
_("%d: redirect - can't open mailer %s: %s\n"), |
435 |
sieve_get_message_num (mach), |
sieve_get_message_num (mach), |
436 |
url_to_string (url), |
url_to_string (url), |
437 |
mu_errstring (rc)); |
mu_errstring (rc)); |