revert bug #591676 changes
[claws.git] / src / main.c
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2002 Hiroyuki Yamamoto
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifdef HAVE_CONFIG_H
21 #  include "config.h"
22 #endif
23
24 #include "defs.h"
25
26 #include <glib.h>
27 #include <gtk/gtkmain.h>
28 #include <gtk/gtkrc.h>
29
30 #if HAVE_GDK_IMLIB
31 #  include <gdk_imlib.h>
32 #endif
33
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <string.h>
37 #include <ctype.h>
38 #include <unistd.h>
39 #include <time.h>
40 #include <sys/stat.h>
41 #include <sys/types.h>
42 #include <signal.h>
43
44 #if HAVE_LOCALE_H
45 #  include <locale.h>
46 #endif
47
48 #if USE_GPGME
49 #  include <gpgme.h>
50 #  include "passphrase.h"
51 #endif
52
53 #include "intl.h"
54 #include "main.h"
55 #include "mainwindow.h"
56 #include "folderview.h"
57 #include "summaryview.h"
58 #include "prefs_common.h"
59 #include "prefs_filter.h"
60 #include "prefs_account.h"
61 #include "prefs_actions.h"
62 #include "scoring.h"
63 #include "prefs_display_header.h"
64 #include "account.h"
65 #include "procmsg.h"
66 #include "inc.h"
67 #include "import.h"
68 #include "manage_window.h"
69 #include "alertpanel.h"
70 #include "statusbar.h"
71 #include "addressbook.h"
72 #include "compose.h"
73 #include "folder.h"
74 #include "setup.h"
75 #include "utils.h"
76 #include "gtkutils.h"
77
78 #if USE_GPGME
79 #  include "rfc2015.h"
80 #endif
81 #if USE_SSL
82 #  include "ssl.h"
83 #endif
84
85 #include "version.h"
86
87 #include "crash.h"
88
89 gchar *prog_version;
90 gchar *startup_dir;
91 gchar *argv0;
92 gboolean debug_mode = FALSE;
93
94 static gint lock_socket = -1;
95 static gint lock_socket_tag = 0;
96
97 static struct Cmd {
98         gboolean receive;
99         gboolean receive_all;
100         gboolean compose;
101         const gchar *compose_mailto;
102         GPtrArray *attach_files;
103         gboolean status;
104         gboolean send;
105         gboolean crash;
106         gchar   *crash_params;
107 } cmd;
108
109 static void parse_cmd_opt(int argc, char *argv[]);
110
111 #if USE_GPGME
112 static void idle_function_for_gpgme(void);
113 #endif /* USE_GPGME */
114
115 static gint prohibit_duplicate_launch   (void);
116 static void lock_socket_input_cb        (gpointer          data,
117                                          gint              source,
118                                          GdkInputCondition condition);
119 #ifndef CLAWS                                    
120 static 
121 #endif
122 gchar *get_socket_name          (void);
123
124
125 static void open_compose_new            (const gchar    *address,
126                                          GPtrArray      *attach_files);
127
128 static void send_queue                  (void);
129 static void initial_processing          (FolderItem *item, gpointer data);
130
131 #if 0
132 /* for gettext */
133 _("File `%s' already exists.\n"
134   "Can't create folder.")
135 #endif
136
137 #define MAKE_DIR_IF_NOT_EXIST(dir) \
138 { \
139         if (!is_dir_exist(dir)) { \
140                 if (is_file_exist(dir)) { \
141                         alertpanel_warning \
142                                 (_("File `%s' already exists.\n" \
143                                    "Can't create folder."), \
144                                  dir); \
145                         return 1; \
146                 } \
147                 if (make_dir(dir) < 0) \
148                         return 1; \
149         } \
150 }
151
152 int main(int argc, char *argv[])
153 {
154         gchar *userrc;
155         MainWindow *mainwin;
156         FolderView *folderview;
157
158         setlocale(LC_ALL, "");
159         bindtextdomain(PACKAGE, LOCALEDIR);
160         textdomain(PACKAGE);
161
162         prog_version = PROG_VERSION;
163         startup_dir = g_get_current_dir();
164         argv0 = g_strdup(argv[0]);
165
166         parse_cmd_opt(argc, argv);
167
168         gtk_set_locale();
169         gtk_init(&argc, &argv);
170
171         if (cmd.crash) {
172                 crash_main(cmd.crash_params);
173                 return 0;
174         }
175
176         crash_install_handlers();
177
178 #if USE_THREADS || USE_LDAP
179         g_thread_init(NULL);
180         if (!g_thread_supported())
181                 g_error(_("g_thread is not supported by glib.\n"));
182 #endif
183
184 #if HAVE_GDK_IMLIB
185         gdk_imlib_init();
186         gtk_widget_push_visual(gdk_imlib_get_visual());
187         gtk_widget_push_colormap(gdk_imlib_get_colormap());
188 #endif
189
190 #if USE_SSL
191         ssl_init();
192 #endif
193
194         srandom((gint)time(NULL));
195
196         /* parse gtkrc files */
197         userrc = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".gtkrc",
198                              NULL);
199         gtk_rc_parse(userrc);
200         g_free(userrc);
201         userrc = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".gtk",
202                              G_DIR_SEPARATOR_S, "gtkrc", NULL);
203         gtk_rc_parse(userrc);
204         g_free(userrc);
205         userrc = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, "gtkrc", NULL);
206         gtk_rc_parse(userrc);
207         g_free(userrc);
208
209         gtk_rc_parse("./gtkrc");
210
211         userrc = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, MENU_RC, NULL);
212         gtk_item_factory_parse_rc(userrc);
213         g_free(userrc);
214
215         CHDIR_RETURN_VAL_IF_FAIL(get_home_dir(), 1);
216
217         /* check and create unix domain socket */
218         lock_socket = prohibit_duplicate_launch();
219         if (lock_socket < 0) return 0;
220
221         if (cmd.status) {
222                 puts("0 Sylpheed not running.");
223                 return 0;
224         }
225
226         /* backup if old rc file exists */
227         if (is_file_exist(RC_DIR)) {
228                 if (rename(RC_DIR, RC_DIR ".bak") < 0)
229                         FILE_OP_ERROR(RC_DIR, "rename");
230         }
231         MAKE_DIR_IF_NOT_EXIST(RC_DIR);
232         MAKE_DIR_IF_NOT_EXIST(get_imap_cache_dir());
233         MAKE_DIR_IF_NOT_EXIST(get_news_cache_dir());
234         MAKE_DIR_IF_NOT_EXIST(get_mime_tmp_dir());
235         MAKE_DIR_IF_NOT_EXIST(get_tmp_dir());
236         MAKE_DIR_IF_NOT_EXIST(RC_DIR G_DIR_SEPARATOR_S "uidl");
237
238         if (is_file_exist(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log")) {
239                 if (rename(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log",
240                            RC_DIR G_DIR_SEPARATOR_S "sylpheed.log.bak") < 0)
241                         FILE_OP_ERROR("sylpheed.log", "rename");
242         }
243         set_log_file(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log");
244
245         if (is_file_exist(RC_DIR G_DIR_SEPARATOR_S "assortrc") &&
246             !is_file_exist(RC_DIR G_DIR_SEPARATOR_S "filterrc")) {
247                 if (rename(RC_DIR G_DIR_SEPARATOR_S "assortrc",
248                            RC_DIR G_DIR_SEPARATOR_S "filterrc") < 0)
249                         FILE_OP_ERROR(RC_DIR G_DIR_SEPARATOR_S "assortrc",
250                                       "rename");
251         }
252
253         prefs_common_init();
254         prefs_common_read_config();
255
256 #if USE_GPGME
257         if (gpgme_check_engine()) {  /* Also does some gpgme init */
258                 rfc2015_disable_all();
259                 debug_print("gpgme_engine_version:\n%s\n",
260                             gpgme_get_engine_info());
261
262                 if (prefs_common.gpg_warning) {
263                         AlertValue val;
264
265                         val = alertpanel_message_with_disable
266                                 (_("Warning"),
267                                  _("GnuPG is not installed properly, or needs to be upgraded.\n"
268                                    "OpenPGP support disabled."));
269                         if (val & G_ALERTDISABLE)
270                                 prefs_common.gpg_warning = FALSE;
271                 }
272         }
273         gpgme_register_idle(idle_function_for_gpgme);
274 #endif
275
276 #if USE_ASPELL
277         gtkaspellcheckers = gtkaspell_checkers_new();
278 #endif
279         
280
281         prefs_common_save_config();
282         prefs_filter_read_config();
283         prefs_filter_write_config();
284         prefs_actions_read_config();
285         prefs_actions_write_config();
286         prefs_display_header_read_config();
287         prefs_display_header_write_config();
288         /* prefs_filtering_read_config(); */
289         addressbook_read_file();
290         renderer_read_config();
291
292         gtkut_widget_init();
293
294         mainwin = main_window_create
295                 (prefs_common.sep_folder | prefs_common.sep_msg << 1);
296         folderview = mainwin->folderview;
297
298         /* register the callback of unix domain socket input */
299         lock_socket_tag = gdk_input_add(lock_socket,
300                                         GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
301                                         lock_socket_input_cb,
302                                         mainwin);
303
304         account_read_config_all();
305         account_save_config_all();
306
307         if (folder_read_list() < 0) {
308                 setup(mainwin);
309                 folder_write_list();
310         }
311         if (!account_get_list()) {
312                 account_edit_open();
313                 account_add();
314         }
315
316         account_set_missing_folder();
317         folder_set_missing_folders();
318         folderview_set(folderview);
319
320         /* prefs_scoring_read_config(); */
321         prefs_matcher_read_config();
322
323         /* make one all-folder processing before using sylpheed */
324         folder_func_to_all_folders(initial_processing, (gpointer *)mainwin);
325
326         addressbook_read_file();
327
328         inc_autocheck_timer_init(mainwin);
329
330         /* ignore SIGPIPE signal for preventing sudden death of program */
331         signal(SIGPIPE, SIG_IGN);
332
333         if (cmd.receive_all || prefs_common.chk_on_startup)
334                 inc_all_account_mail(mainwin, prefs_common.newmail_notify_manu);
335         else if (cmd.receive)
336                 inc_mail(mainwin, prefs_common.newmail_notify_manu);
337         else
338                 gtk_widget_grab_focus(folderview->ctree);
339
340         if (cmd.compose)
341                 open_compose_new(cmd.compose_mailto, cmd.attach_files);
342         if (cmd.attach_files) {
343                 ptr_array_free_strings(cmd.attach_files);
344                 g_ptr_array_free(cmd.attach_files, TRUE);
345                 cmd.attach_files = NULL;
346         }
347         if (cmd.send)
348                 send_queue();
349
350         gtk_main();
351
352         addressbook_destroy();
353
354 #if USE_ASPELL       
355         gtkaspell_checkers_delete();
356 #endif
357
358         return 0;
359 }
360
361 static void parse_cmd_opt(int argc, char *argv[])
362 {
363         gint i;
364
365         for (i = 1; i < argc; i++) {
366                 if (!strncmp(argv[i], "--debug", 7))
367                         debug_mode = TRUE;
368                 else if (!strncmp(argv[i], "--receive-all", 13))
369                         cmd.receive_all = TRUE;
370                 else if (!strncmp(argv[i], "--receive", 9))
371                         cmd.receive = TRUE;
372                 else if (!strncmp(argv[i], "--compose", 9)) {
373                         const gchar *p = argv[i + 1];
374
375                         cmd.compose = TRUE;
376                         cmd.compose_mailto = NULL;
377                         if (p && *p != '\0' && *p != '-') {
378                                 if (!strncmp(p, "mailto:", 7))
379                                         cmd.compose_mailto = p + 7;
380                                 else
381                                         cmd.compose_mailto = p;
382                                 i++;
383                         }
384                 } else if (!strncmp(argv[i], "--attach", 8)) {
385                         const gchar *p = argv[i + 1];
386                         gchar *file;
387
388                         while (p && *p != '\0' && *p != '-') {
389                                 if (!cmd.attach_files)
390                                         cmd.attach_files = g_ptr_array_new();
391                                 if (*p != G_DIR_SEPARATOR)
392                                         file = g_strconcat(startup_dir,
393                                                            G_DIR_SEPARATOR_S,
394                                                            p, NULL);
395                                 else
396                                         file = g_strdup(p);
397                                 g_ptr_array_add(cmd.attach_files, file);
398                                 i++;
399                                 p = argv[i + 1];
400                         }
401                 } else if (!strncmp(argv[i], "--send", 6)) {
402                         cmd.send = TRUE;
403                 } else if (!strncmp(argv[i], "--version", 9)) {
404                         puts("Sylpheed version " VERSION);
405                         exit(0);
406                 } else if (!strncmp(argv[i], "--status", 8)) {
407                         cmd.status = TRUE;
408                 } else if (!strncmp(argv[i], "--help", 6)) {
409                         g_print(_("Usage: %s [OPTION]...\n"),
410                                 g_basename(argv[0]));
411
412                         puts(_("  --compose [address]    open composition window"));
413                         puts(_("  --attach file1 [file2]...\n"
414                                "                         open composition window with specified files\n"
415                                "                         attached"));
416                         puts(_("  --receive              receive new messages"));
417                         puts(_("  --receive-all          receive new messages of all accounts"));
418                         puts(_("  --send                 send all queued messages"));
419                         puts(_("  --status               show the total number of messages"));
420                         puts(_("  --debug                debug mode"));
421                         puts(_("  --help                 display this help and exit"));
422                         puts(_("  --version              output version information and exit"));
423
424                         exit(1);
425                 } else if (!strncmp(argv[i], "--crash", 7)) {
426                         cmd.crash = TRUE;
427                         cmd.crash_params = g_strdup(argv[i + 1]);
428                         i++;
429                 }
430                 
431         }
432
433         if (cmd.attach_files && cmd.compose == FALSE) {
434                 cmd.compose = TRUE;
435                 cmd.compose_mailto = NULL;
436         }
437 }
438
439 static gint get_queued_message_num(void)
440 {
441         FolderItem *queue;
442
443         queue = folder_get_default_queue();
444         if (!queue) return -1;
445
446         folder_item_scan(queue);
447         return queue->total;
448 }
449
450 static void save_all_caches(FolderItem *item, gpointer data)
451 {
452         if (!item->cache)
453                 return;
454         folder_item_write_cache(item);
455 }
456
457 static void initial_processing(FolderItem *item, gpointer data)
458 {
459         MainWindow *mainwin = (MainWindow *)data;
460         gchar *buf;
461
462         g_return_if_fail(item);
463         buf = g_strdup_printf(_("Processing (%s)..."), 
464                               item->path 
465                               ? item->path 
466                               : _("top level folder"));
467         debug_print("%s\n", buf);
468         g_free(buf);
469
470         main_window_cursor_wait(mainwin);
471         
472         folder_item_apply_processing(item);
473
474         debug_print("done.\n");
475         STATUSBAR_POP(mainwin);
476         main_window_cursor_normal(mainwin);
477 }
478
479 void app_will_exit(GtkWidget *widget, gpointer data)
480 {
481         MainWindow *mainwin = data;
482         gchar *filename;
483
484         if (compose_get_compose_list()) {
485                 if (alertpanel(_("Notice"),
486                                _("Composing message exists. Really quit?"),
487                                _("OK"), _("Cancel"), NULL) != G_ALERTDEFAULT)
488                         return;
489                 manage_window_focus_in(mainwin->window, NULL, NULL);
490         }
491
492         if (prefs_common.warn_queued_on_exit && get_queued_message_num() > 0) {
493                 if (alertpanel(_("Queued messages"),
494                                _("Some unsent messages are queued. Exit now?"),
495                                _("OK"), _("Cancel"), NULL) != G_ALERTDEFAULT)
496                         return;
497                 manage_window_focus_in(mainwin->window, NULL, NULL);
498         }
499
500         inc_autocheck_timer_remove();
501
502 #if USE_GPGME
503         gpgmegtk_free_passphrase();
504 #endif
505
506         if (prefs_common.clean_on_exit)
507                 main_window_empty_trash(mainwin, prefs_common.ask_on_clean);
508
509         /* save prefs for opened folder */
510         if(mainwin->folderview->opened)
511         {
512                 FolderItem *item;
513
514                 item = gtk_ctree_node_get_row_data(GTK_CTREE(mainwin->folderview->ctree), mainwin->folderview->opened);
515                 summary_save_prefs_to_folderitem(mainwin->folderview->summaryview, item);
516         }
517
518         /* save all state before exiting */
519         folder_write_list();
520         folder_func_to_all_folders(save_all_caches, NULL);
521
522         main_window_get_size(mainwin);
523         main_window_get_position(mainwin);
524         prefs_common_save_config();
525         prefs_filter_write_config();
526         account_save_config_all();
527         addressbook_export_to_file();
528
529         filename = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, MENU_RC, NULL);
530         gtk_item_factory_dump_rc(filename, NULL, TRUE);
531         g_free(filename);
532
533         /* delete temporary files */
534         remove_all_files(get_mime_tmp_dir());
535
536         close_log_file();
537
538         /* delete unix domain socket */
539         gdk_input_remove(lock_socket_tag);
540         fd_close(lock_socket);
541         filename = get_socket_name();
542         unlink(filename);
543
544 #if USE_SSL
545         ssl_done();
546 #endif
547
548         gtk_main_quit();
549 }
550
551 #if USE_GPGME
552 static void idle_function_for_gpgme(void)
553 {
554         while (gtk_events_pending())
555                 gtk_main_iteration();
556 }
557 #endif /* USE_GPGME */
558
559 /*
560  * CLAWS: want this public so crash dialog can delete the
561  * lock file too
562  */
563 #ifndef CLAWS
564 static
565 #endif
566 gchar *get_socket_name(void)
567 {
568         static gchar *filename = NULL;
569
570         if (filename == NULL) {
571                 filename = g_strdup_printf("%s%csylpheed-%d",
572                                            g_get_tmp_dir(), G_DIR_SEPARATOR,
573                                            getuid());
574         }
575
576         return filename;
577 }
578
579 static gint prohibit_duplicate_launch(void)
580 {
581         gint uxsock;
582         gchar *path;
583
584         path = get_socket_name();
585         uxsock = fd_connect_unix(path);
586         if (uxsock < 0) {
587                 unlink(path);
588                 return fd_open_unix(path);
589         }
590
591         /* remote command mode */
592
593         debug_print("another Sylpheed is already running.\n");
594
595         if (cmd.receive_all)
596                 fd_write(uxsock, "receive_all\n", 12);
597         else if (cmd.receive)
598                 fd_write(uxsock, "receive\n", 8);
599         else if (cmd.compose && cmd.attach_files) {
600                 gchar *str, *compose_str;
601                 gint i;
602
603                 if (cmd.compose_mailto)
604                         compose_str = g_strdup_printf("compose_attach %s\n",
605                                                       cmd.compose_mailto);
606                 else
607                         compose_str = g_strdup("compose_attach\n");
608
609                 fd_write(uxsock, compose_str, strlen(compose_str));
610                 g_free(compose_str);
611
612                 for (i = 0; i < cmd.attach_files->len; i++) {
613                         str = g_ptr_array_index(cmd.attach_files, i);
614                         fd_write(uxsock, str, strlen(str));
615                         fd_write(uxsock, "\n", 1);
616                 }
617
618                 fd_write(uxsock, ".\n", 2);
619         } else if (cmd.compose) {
620                 gchar *compose_str;
621
622                 if (cmd.compose_mailto)
623                         compose_str = g_strdup_printf("compose %s\n", cmd.compose_mailto);
624                 else
625                         compose_str = g_strdup("compose\n");
626
627                 fd_write(uxsock, compose_str, strlen(compose_str));
628                 g_free(compose_str);
629         } else if (cmd.send) {
630                 fd_write(uxsock, "send\n", 5);
631         } else if (cmd.status) {
632                 gchar buf[BUFFSIZE];
633
634                 fd_write(uxsock, "status\n", 7);
635                 fd_gets(uxsock, buf, sizeof(buf));
636                 fputs(buf, stdout);
637         } else
638                 fd_write(uxsock, "popup\n", 6);
639
640         fd_close(uxsock);
641         return -1;
642 }
643
644 static void lock_socket_input_cb(gpointer data,
645                                  gint source,
646                                  GdkInputCondition condition)
647 {
648         MainWindow *mainwin = (MainWindow *)data;
649         gint sock;
650         gchar buf[BUFFSIZE];
651
652         sock = fd_accept(source);
653         fd_gets(sock, buf, sizeof(buf));
654
655         if (!strncmp(buf, "popup", 5)) {
656                 main_window_popup(mainwin);
657         } else if (!strncmp(buf, "receive_all", 11)) {
658                 main_window_popup(mainwin);
659                 inc_all_account_mail(mainwin, prefs_common.newmail_notify_manu);
660         } else if (!strncmp(buf, "receive", 7)) {
661                 main_window_popup(mainwin);
662                 inc_mail(mainwin, prefs_common.newmail_notify_manu);
663         } else if (!strncmp(buf, "compose_attach", 14)) {
664                 GPtrArray *files;
665                 gchar *mailto;
666
667                 mailto = g_strdup(buf + strlen("compose_attach") + 1);
668                 files = g_ptr_array_new();
669                 while (fd_gets(sock, buf, sizeof(buf)) > 0) {
670                         if (buf[0] == '.' && buf[1] == '\n') break;
671                         strretchomp(buf);
672                         g_ptr_array_add(files, g_strdup(buf));
673                 }
674                 open_compose_new(mailto, files);
675                 ptr_array_free_strings(files);
676                 g_ptr_array_free(files, TRUE);
677                 g_free(mailto);
678         } else if (!strncmp(buf, "compose", 7)) {
679                 open_compose_new(buf + strlen("compose") + 1, NULL);
680         } else if (!strncmp(buf, "send", 4)) {
681                 send_queue();
682         } else if (!strncmp(buf, "status", 6)) {
683                 guint new, unread, total;
684
685                 folder_count_total_msgs(&new, &unread, &total);
686                 g_snprintf(buf, sizeof(buf), "%d %d %d\n", new, unread, total);
687                 fd_write(sock, buf, strlen(buf));
688         }
689
690         fd_close(sock);
691 }
692
693 static void open_compose_new(const gchar *address, GPtrArray *attach_files)
694 {
695         gchar *addr = NULL;
696
697         if (address) {
698                 Xstrdup_a(addr, address, return);
699                 g_strstrip(addr);
700         }
701
702         compose_new(NULL, addr, attach_files);
703 }
704
705 static void send_queue(void)
706 {
707         GList *list;
708         FolderItem *def_outbox;
709
710         def_outbox = folder_get_default_outbox();
711
712         for (list = folder_get_list(); list != NULL; list = list->next) {
713                 Folder *folder = list->data;
714
715                 if (folder->queue) {
716                         if (procmsg_send_queue
717                                 (folder->queue, prefs_common.savemsg) < 0)
718                                 alertpanel_error(_("Some errors occurred while sending queued messages."));
719                         statusbar_pop_all();
720                         folder_item_scan(folder->queue);
721                         folderview_update_item(folder->queue, TRUE);
722                         if (prefs_common.savemsg && folder->outbox) {
723                                 folderview_update_item(folder->outbox, TRUE);
724                                 if (folder->outbox == def_outbox)
725                                         def_outbox = NULL;
726                         }
727                 }
728         }
729
730         if (prefs_common.savemsg && def_outbox)
731                 folderview_update_item(def_outbox, TRUE);
732 }