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 General Public License as published by |
it under the terms of the GNU 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 General Public License for more details. |
GNU General Public License for more details. |
13 |
|
|
14 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU 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 |
#include "mail.h" |
#include "mail.h" |
148 |
} |
} |
149 |
else |
else |
150 |
{ |
{ |
151 |
util_error ("Unknown command: %s", argv[0]); |
util_error (_("Unknown command: %s"), argv[0]); |
152 |
status = 1; |
status = 1; |
153 |
} |
} |
154 |
|
|
390 |
if (!mail_env_entry_is_set (env) || env->type != type) |
if (!mail_env_entry_is_set (env) || env->type != type) |
391 |
{ |
{ |
392 |
if (warn) |
if (warn) |
393 |
util_error ("No value set for \"%s\"", variable); |
util_error (_("No value set for \"%s\""), variable); |
394 |
return 1; |
return 1; |
395 |
} |
} |
396 |
if (ptr) |
if (ptr) |
488 |
break; |
break; |
489 |
|
|
490 |
case Mail_env_whatever: |
case Mail_env_whatever: |
491 |
fprintf (ofile, "oops?"); |
fprintf (ofile, _("oops?")); |
492 |
} |
} |
493 |
fprintf (ofile, "\n"); |
fprintf (ofile, "\n"); |
494 |
} |
} |
583 |
if (!homedir) |
if (!homedir) |
584 |
{ |
{ |
585 |
/* Shouldn't happen, but one never knows */ |
/* Shouldn't happen, but one never knows */ |
586 |
util_error ("can't get homedir"); |
util_error (_("can't get homedir")); |
587 |
exit (EXIT_FAILURE); |
exit (EXIT_FAILURE); |
588 |
} |
} |
589 |
return homedir; |
return homedir; |
646 |
if (envelope_sender (env, buffer, sizeof (buffer), NULL) |
if (envelope_sender (env, buffer, sizeof (buffer), NULL) |
647 |
|| address_create (&addr, buffer)) |
|| address_create (&addr, buffer)) |
648 |
{ |
{ |
649 |
util_error("can't determine sender name (msg %d)", msgno); |
util_error (_("can't determine sender name (msg %d)"), msgno); |
650 |
return NULL; |
return NULL; |
651 |
} |
} |
652 |
} |
} |
653 |
|
|
654 |
if (address_get_email (addr, 1, buffer, sizeof(buffer), NULL)) |
if (address_get_email (addr, 1, buffer, sizeof(buffer), NULL)) |
655 |
{ |
{ |
656 |
util_error("can't determine sender name (msg %d)", msgno); |
util_error (_("can't determine sender name (msg %d)"), msgno); |
657 |
address_destroy (&addr); |
address_destroy (&addr); |
658 |
return NULL; |
return NULL; |
659 |
} |
} |
721 |
|
|
722 |
if ((p = strdup(value)) == NULL) |
if ((p = strdup(value)) == NULL) |
723 |
{ |
{ |
724 |
util_error("not enough memory\n"); |
util_error(_("not enough memory\n")); |
725 |
return; |
return; |
726 |
} |
} |
727 |
list_append (*list, p); |
list_append (*list, p); |
879 |
outfile = fopen (filename, "a"); |
outfile = fopen (filename, "a"); |
880 |
if (!outfile) |
if (!outfile) |
881 |
{ |
{ |
882 |
util_error("can't open save file %s: %s", |
util_error(_("can't open save file %s: %s"), |
883 |
filename, strerror (errno)); |
filename, strerror (errno)); |
884 |
} |
} |
885 |
else |
else |
896 |
|
|
897 |
if (!bsize) |
if (!bsize) |
898 |
{ |
{ |
899 |
util_error("not enough memory for creating save file"); |
util_error(_("not enough memory for creating save file")); |
900 |
} |
} |
901 |
else |
else |
902 |
{ |
{ |
981 |
else |
else |
982 |
{ |
{ |
983 |
status = 1; |
status = 1; |
984 |
fprintf (stdout, "Unknown command: %s\n", word); |
fprintf (stdout, _("Unknown command: %s\n"), word); |
985 |
} |
} |
986 |
return status; |
return status; |
987 |
} |
} |
1006 |
{ |
{ |
1007 |
if (message_unencapsulate (mesg, &submsg, NULL)) |
if (message_unencapsulate (mesg, &submsg, NULL)) |
1008 |
{ |
{ |
1009 |
util_error ("can't unencapsulate message/part"); |
util_error (_("can't unencapsulate message/part")); |
1010 |
return 1; |
return 1; |
1011 |
} |
} |
1012 |
mesg = submsg; |
mesg = submsg; |
1015 |
message_get_num_parts (mesg, &nparts); |
message_get_num_parts (mesg, &nparts); |
1016 |
if (nparts < msgset->msg_part[i]) |
if (nparts < msgset->msg_part[i]) |
1017 |
{ |
{ |
1018 |
util_error ("no such (sub)part in the message: %d", |
util_error (_("no such (sub)part in the message: %d"), |
1019 |
msgset->msg_part[i]); |
msgset->msg_part[i]); |
1020 |
return 1; |
return 1; |
1021 |
} |
} |
1022 |
|
|
1023 |
if (message_get_part (mesg, msgset->msg_part[i], &submsg)) |
if (message_get_part (mesg, msgset->msg_part[i], &submsg)) |
1024 |
{ |
{ |
1025 |
util_error ("can't get (sub)part from the message: %d", |
util_error (_("can't get (sub)part from the message: %d"), |
1026 |
msgset->msg_part[i]); |
msgset->msg_part[i]); |
1027 |
return 1; |
return 1; |
1028 |
} |
} |
1146 |
rc = header_create (&hdr, "", 0, NULL); |
rc = header_create (&hdr, "", 0, NULL); |
1147 |
if (rc) |
if (rc) |
1148 |
{ |
{ |
1149 |
util_error ("can't create temporary header: %s", mu_errstring (rc)); |
util_error (_("can't create temporary header: %s"), mu_errstring (rc)); |
1150 |
return 1; |
return 1; |
1151 |
} |
} |
1152 |
|
|
1187 |
{ |
{ |
1188 |
errcnt++; |
errcnt++; |
1189 |
if (exp) |
if (exp) |
1190 |
util_error ("can't parse address `%s' (while expanding `%s'): %s", |
util_error (_("can't parse address `%s' (while expanding `%s'): %s"), |
1191 |
exp, p, mu_errstring (rc)); |
exp, p, mu_errstring (rc)); |
1192 |
else |
else |
1193 |
util_error ("can't parse address `%s': %s", |
util_error (_("can't parse address `%s': %s"), |
1194 |
p, mu_errstring (rc)); |
p, mu_errstring (rc)); |
1195 |
} |
} |
1196 |
|
|
1243 |
status = mailbox_get_message (mbox, msgno, msg); |
status = mailbox_get_message (mbox, msgno, msg); |
1244 |
if (status) |
if (status) |
1245 |
{ |
{ |
1246 |
util_error ("can't get message %lu: %s", |
util_error (_("can't get message %lu: %s"), |
1247 |
(unsigned long) msgno, mu_errstring (status)); |
(unsigned long) msgno, mu_errstring (status)); |
1248 |
return status; |
return status; |
1249 |
} |
} |
1251 |
if ((flag & MSG_NODELETED) && util_isdeleted (*msg)) |
if ((flag & MSG_NODELETED) && util_isdeleted (*msg)) |
1252 |
{ |
{ |
1253 |
if (!(flag & MSG_SILENT)) |
if (!(flag & MSG_SILENT)) |
1254 |
util_error ("%lu: Inappropriate message (has been deleted)", |
util_error (_("%lu: Inappropriate message (has been deleted)"), |
1255 |
(unsigned long) msgno); |
(unsigned long) msgno); |
1256 |
return ENOENT; |
return ENOENT; |
1257 |
} |
} |
1261 |
int |
int |
1262 |
util_error_range (size_t msgno) |
util_error_range (size_t msgno) |
1263 |
{ |
{ |
1264 |
util_error ("%d: invalid message number", msgno); |
util_error (_("%d: invalid message number"), msgno); |
1265 |
return 1; |
return 1; |
1266 |
} |
} |