Statistics
| Revision:

root / libsylph / prefs_common.c @ 786

History | View | Annotate | Download (16.9 kB)

1
/*
2
 * LibSylph -- E-Mail client library
3
 * Copyright (C) 1999-2005 Hiroyuki Yamamoto
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2.1 of the License, or (at your option) any later version.
9
 *
10
 * This library 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 GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public
16
 * License along with this library; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  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 <glib/gi18n.h>
28
#include <stdio.h>
29
#include <errno.h>
30
31
#include "prefs.h"
32
#include "prefs_common.h"
33
#include "filter.h"
34
#include "codeconv.h"
35
#include "utils.h"
36
37
PrefsCommon prefs_common;
38
39
static PrefParam param[] = {
40
        /* Receive */
41
        {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL},
42
        {"autochk_interval", "10", &prefs_common.autochk_itv, P_INT},
43
        {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL},
44
        {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc,
45
         P_BOOL},
46
        {"enable_newmsg_notify", "FALSE", &prefs_common.enable_newmsg_notify,
47
         P_BOOL},
48
        {"newmsg_notify_command", NULL, &prefs_common.newmsg_notify_cmd,
49
         P_STRING},
50
51
        {"inc_local", "FALSE", &prefs_common.inc_local, P_BOOL},
52
        {"filter_on_inc_local", "TRUE", &prefs_common.filter_on_inc, P_BOOL},
53
        {"spool_path", DEFAULT_SPOOL_PATH, &prefs_common.spool_path, P_STRING},
54
55
        /* Send */
56
        {"save_message", "TRUE", &prefs_common.savemsg, P_BOOL},
57
        {"filter_sent_message", "FALSE", &prefs_common.filter_sent, P_BOOL},
58
59
        {"encoding_method", "0", &prefs_common.encoding_method, P_ENUM},
60
61
        {"allow_jisx0201_kana", "FALSE", &prefs_common.allow_jisx0201_kana,
62
         P_BOOL},
63
64
        /* Compose */
65
        {"auto_signature", "TRUE", &prefs_common.auto_sig, P_BOOL},
66
        {"signature_separator", "-- ", &prefs_common.sig_sep, P_STRING},
67
68
        {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL},
69
70
        {"undo_level", "50", &prefs_common.undolevels, P_INT},
71
72
        {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT},
73
        {"linewrap_quotation", "FALSE", &prefs_common.linewrap_quote, P_BOOL},
74
        {"linewrap_auto", "FALSE", &prefs_common.autowrap, P_BOOL},
75
        {"linewrap_before_sending", "FALSE", &prefs_common.linewrap_at_send,
76
         P_BOOL},
77
78
        {"enable_autosave", "FALSE", &prefs_common.enable_autosave, P_BOOL},
79
        {"autosave_interval", "5", &prefs_common.autosave_itv, P_INT},
80
81
        {"reply_with_quote", "TRUE", &prefs_common.reply_with_quote, P_BOOL},
82
        {"reply_account_autoselect", "TRUE",
83
         &prefs_common.reply_account_autosel, P_BOOL},
84
        {"default_reply_list", "TRUE", &prefs_common.default_reply_list,
85
         P_BOOL},
86
87
        {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL},
88
89
        /* Quote */
90
        {"reply_quote_mark", "> ", &prefs_common.quotemark, P_STRING},
91
        {"reply_quote_format", "On %d\\n%f wrote:\\n\\n%Q",
92
         &prefs_common.quotefmt, P_STRING},
93
94
        {"forward_quote_mark", "> ", &prefs_common.fw_quotemark, P_STRING},
95
        {"forward_quote_format",
96
         "\\n\\nBegin forwarded message:\\n\\n"
97
         "?d{Date: %d\\n}?f{From: %f\\n}?t{To: %t\\n}?c{Cc: %c\\n}"
98
         "?n{Newsgroups: %n\\n}?s{Subject: %s\\n}\\n\\n%M",
99
         &prefs_common.fw_quotefmt, P_STRING},
100
101
        /* Spelling */
102
        {"check_spell", "FALSE", &prefs_common.check_spell, P_BOOL},
103
        {"spell_lang", "en", &prefs_common.spell_lang, P_STRING},
104
105
        /* Display */
106
        {"message_font_name", DEFAULT_MESSAGE_FONT, &prefs_common.textfont,
107
         P_STRING},
108
109
        {"display_folder_unread_num", "TRUE",
110
         &prefs_common.display_folder_unread, P_BOOL},
111
        {"display_folder_num_columns", "FALSE",
112
         &prefs_common.display_folder_num_columns, P_BOOL},
113
114
        {"newsgroup_abbrev_len", "16", &prefs_common.ng_abbrev_len, P_INT},
115
116
        {"translate_header", "TRUE", &prefs_common.trans_hdr, P_BOOL},
117
118
        /* Display: Summary View */
119
        {"enable_swap_from", "FALSE", &prefs_common.swap_from, P_BOOL},
120
        {"date_format", "%y/%m/%d(%a) %H:%M", &prefs_common.date_format,
121
         P_STRING},
122
        {"expand_thread", "TRUE", &prefs_common.expand_thread, P_BOOL},
123
124
        {"enable_rules_hint", "TRUE", &prefs_common.enable_rules_hint, P_BOOL},
125
        {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL},
126
127
        {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM},
128
        {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL},
129
130
        {"summary_col_show_mark", "TRUE",
131
         &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL},
132
        {"summary_col_show_unread", "TRUE",
133
         &prefs_common.summary_col_visible[S_COL_UNREAD], P_BOOL},
134
        {"summary_col_show_mime", "TRUE",
135
         &prefs_common.summary_col_visible[S_COL_MIME], P_BOOL},
136
        {"summary_col_show_subject", "TRUE",
137
         &prefs_common.summary_col_visible[S_COL_SUBJECT], P_BOOL},
138
        {"summary_col_show_from", "TRUE",
139
         &prefs_common.summary_col_visible[S_COL_FROM], P_BOOL},
140
        {"summary_col_show_date", "TRUE",
141
         &prefs_common.summary_col_visible[S_COL_DATE], P_BOOL},
142
        {"summary_col_show_size", "TRUE",
143
         &prefs_common.summary_col_visible[S_COL_SIZE], P_BOOL},
144
        {"summary_col_show_number", "FALSE",
145
         &prefs_common.summary_col_visible[S_COL_NUMBER], P_BOOL},
146
147
        {"summary_col_pos_mark", "0",
148
          &prefs_common.summary_col_pos[S_COL_MARK], P_INT},
149
        {"summary_col_pos_unread", "1",
150
          &prefs_common.summary_col_pos[S_COL_UNREAD], P_INT},
151
        {"summary_col_pos_mime", "2",
152
          &prefs_common.summary_col_pos[S_COL_MIME], P_INT},
153
        {"summary_col_pos_subject", "3",
154
          &prefs_common.summary_col_pos[S_COL_SUBJECT], P_INT},
155
        {"summary_col_pos_from", "4",
156
          &prefs_common.summary_col_pos[S_COL_FROM], P_INT},
157
        {"summary_col_pos_date", "5",
158
          &prefs_common.summary_col_pos[S_COL_DATE], P_INT},
159
        {"summary_col_pos_size", "6",
160
          &prefs_common.summary_col_pos[S_COL_SIZE], P_INT},
161
        {"summary_col_pos_number", "7",
162
          &prefs_common.summary_col_pos[S_COL_NUMBER], P_INT},
163
164
        {"summary_col_size_mark", "10",
165
         &prefs_common.summary_col_size[S_COL_MARK], P_INT},
166
        {"summary_col_size_unread", "13",
167
         &prefs_common.summary_col_size[S_COL_UNREAD], P_INT},
168
        {"summary_col_size_mime", "10",
169
         &prefs_common.summary_col_size[S_COL_MIME], P_INT},
170
        {"summary_col_size_subject", "200",
171
         &prefs_common.summary_col_size[S_COL_SUBJECT], P_INT},
172
        {"summary_col_size_from", "120",
173
         &prefs_common.summary_col_size[S_COL_FROM], P_INT},
174
        {"summary_col_size_date", "118",
175
         &prefs_common.summary_col_size[S_COL_DATE], P_INT},
176
        {"summary_col_size_size", "45",
177
         &prefs_common.summary_col_size[S_COL_SIZE], P_INT},
178
        {"summary_col_size_number", "40",
179
         &prefs_common.summary_col_size[S_COL_NUMBER], P_INT},
180
181
        /* Widget size */
182
        {"folderwin_x", "16", &prefs_common.folderwin_x, P_INT},
183
        {"folderwin_y", "16", &prefs_common.folderwin_y, P_INT},
184
        {"folderview_width", "179", &prefs_common.folderview_width, P_INT},
185
        {"folderview_height", "450", &prefs_common.folderview_height, P_INT},
186
        {"folderview_visible", "TRUE", &prefs_common.folderview_visible,
187
         P_BOOL},
188
189
        {"folder_col_folder", "150", &prefs_common.folder_col_folder, P_INT},
190
        {"folder_col_new", "32", &prefs_common.folder_col_new, P_INT},
191
        {"folder_col_unread", "32", &prefs_common.folder_col_unread, P_INT},
192
        {"folder_col_total", "32", &prefs_common.folder_col_total, P_INT},
193
194
        {"summaryview_width", "600", &prefs_common.summaryview_width, P_INT},
195
        {"summaryview_height", "157", &prefs_common.summaryview_height, P_INT},
196
197
        {"main_messagewin_x", "256", &prefs_common.main_msgwin_x, P_INT},
198
        {"main_messagewin_y", "210", &prefs_common.main_msgwin_y, P_INT},
199
        {"messageview_width", "600", &prefs_common.msgview_width, P_INT},
200
        {"messageview_height", "300", &prefs_common.msgview_height, P_INT},
201
        {"messageview_visible", "TRUE", &prefs_common.msgview_visible, P_BOOL},
202
203
        {"mainview_x", "64", &prefs_common.mainview_x, P_INT},
204
        {"mainview_y", "64", &prefs_common.mainview_y, P_INT},
205
        {"mainview_width", "600", &prefs_common.mainview_width, P_INT},
206
        {"mainview_height", "600", &prefs_common.mainview_height, P_INT},
207
        {"mainwin_x", "64", &prefs_common.mainwin_x, P_INT},
208
        {"mainwin_y", "64", &prefs_common.mainwin_y, P_INT},
209
        {"mainwin_width", "800", &prefs_common.mainwin_width, P_INT},
210
        {"mainwin_height", "600", &prefs_common.mainwin_height, P_INT},
211
        {"messagewin_width", "600", &prefs_common.msgwin_width, P_INT},
212
        {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT},
213
        {"sourcewin_width", "600", &prefs_common.sourcewin_width, P_INT},
214
        {"sourcewin_height", "500", &prefs_common.sourcewin_height, P_INT},
215
        {"compose_x", "32", &prefs_common.compose_x, P_INT},
216
        {"compose_y", "32", &prefs_common.compose_y, P_INT},
217
        {"compose_width", "600", &prefs_common.compose_width, P_INT},
218
        {"compose_height", "560", &prefs_common.compose_height, P_INT},
219
220
        /* Message */
221
        {"enable_color", "TRUE", &prefs_common.enable_color, P_BOOL},
222
223
        {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_INT},
224
        {"quote_level2_color", "179", &prefs_common.quote_level2_col, P_INT},
225
        {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_INT},
226
        {"uri_color", "32512", &prefs_common.uri_col, P_INT},
227
        {"signature_color", "0", &prefs_common.sig_col, P_USHORT},
228
        {"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
229
         P_BOOL},
230
231
        {"convert_mb_alnum", "FALSE", &prefs_common.conv_mb_alnum, P_BOOL},
232
        {"display_header_pane", "TRUE", &prefs_common.display_header_pane,
233
         P_BOOL},
234
        {"display_header", "TRUE", &prefs_common.display_header, P_BOOL},
235
        {"render_html", "TRUE", &prefs_common.render_html, P_BOOL},
236
        {"line_space", "2", &prefs_common.line_space, P_INT},
237
238
        {"textview_cursor_visible", "FALSE",
239
         &prefs_common.textview_cursor_visible, P_BOOL},
240
241
        {"enable_smooth_scroll", "FALSE", &prefs_common.enable_smooth_scroll,
242
         P_BOOL},
243
        {"scroll_step", "1", &prefs_common.scroll_step, P_INT},
244
        {"scroll_half_page", "FALSE", &prefs_common.scroll_halfpage, P_BOOL},
245
246
        {"resize_image", "TRUE", &prefs_common.resize_image, P_BOOL},
247
        {"inline_image", "TRUE", &prefs_common.inline_image, P_BOOL},
248
249
        /* Encoding */
250
        {"default_encoding", NULL, &prefs_common.default_encoding, P_STRING},
251
        {"outgoing_charset", NULL, &prefs_common.outgoing_charset, P_STRING},
252
253
        {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL},
254
255
        /* MIME viewer */
256
        {"mime_image_viewer", "display '%s'", &prefs_common.mime_image_viewer,
257
         P_STRING},
258
        {"mime_audio_player", "play '%s'", &prefs_common.mime_audio_player,
259
         P_STRING},
260
        {"mime_open_command", "gedit '%s'", &prefs_common.mime_open_cmd,
261
         P_STRING},
262
263
        /* Junk mail */
264
        {"enable_junk", "FALSE", &prefs_common.enable_junk, P_BOOL},
265
#ifdef G_OS_WIN32
266
        {"junk_learn_command", "bsfilterw -su", &prefs_common.junk_learncmd,
267
         P_STRING},
268
        {"nojunk_learn_command", "bsfilterw -cu",
269
         &prefs_common.nojunk_learncmd, P_STRING},
270
        {"junk_classify_command", "bsfilterw",
271
         &prefs_common.junk_classify_cmd, P_STRING},
272
#else
273
        {"junk_learn_command", "bogofilter -s -I", &prefs_common.junk_learncmd,
274
         P_STRING},
275
        {"nojunk_learn_command", "bogofilter -n -I",
276
         &prefs_common.nojunk_learncmd, P_STRING},
277
        {"junk_classify_command", "bogofilter -I",
278
         &prefs_common.junk_classify_cmd, P_STRING},
279
#endif
280
        {"junk_folder", NULL, &prefs_common.junk_folder, P_STRING},
281
        {"filter_junk_on_receive", "FALSE", &prefs_common.filter_junk_on_recv,
282
         P_BOOL},
283
        {"delete_junk_on_receive", "TRUE", &prefs_common.delete_junk_on_recv,
284
         P_BOOL},
285
        {"mark_junk_as_read", "FALSE", &prefs_common.mark_junk_as_read, P_BOOL},
286
287
        /* Privacy */
288
        {"auto_check_signatures", "TRUE", &prefs_common.auto_check_signatures,
289
         P_BOOL},
290
        {"gpg_signature_popup", "FALSE", &prefs_common.gpg_signature_popup,
291
         P_BOOL},
292
        {"store_passphrase", "FALSE", &prefs_common.store_passphrase, P_BOOL},
293
        {"store_passphrase_timeout", "0",
294
         &prefs_common.store_passphrase_timeout, P_INT},
295
        {"passphrase_grab", "FALSE", &prefs_common.passphrase_grab, P_BOOL},
296
#ifdef G_OS_WIN32
297
        {"show_gpg_warning", "FALSE", &prefs_common.gpg_warning, P_BOOL},
298
#else
299
        {"show_gpg_warning", "TRUE", &prefs_common.gpg_warning, P_BOOL},
300
#endif
301
302
        /* Interface */
303
        {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL},
304
        {"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL},
305
306
        {"always_show_message_when_selected", "FALSE",
307
         &prefs_common.always_show_msg, P_BOOL},
308
        {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
309
         P_BOOL},
310
        {"mark_as_read_on_new_window", "FALSE",
311
         &prefs_common.mark_as_read_on_new_window, P_BOOL},
312
        {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc, P_BOOL},
313
        {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL},
314
315
#ifdef G_OS_WIN32
316
        {"comply_gnome_hig", "FALSE", &prefs_common.comply_gnome_hig, P_BOOL},
317
#else
318
        {"comply_gnome_hig", "TRUE", &prefs_common.comply_gnome_hig, P_BOOL},
319
#endif
320
321
        /* Other */
322
        {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM},
323
        {"no_receive_error_panel", "FALSE", &prefs_common.no_recv_err_panel,
324
         P_BOOL},
325
        {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
326
         P_BOOL},
327
328
        {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
329
         P_BOOL},
330
331
        {"confirm_on_exit", "FALSE", &prefs_common.confirm_on_exit, P_BOOL},
332
        {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL},
333
        {"ask_on_cleaning", "TRUE", &prefs_common.ask_on_clean, P_BOOL},
334
        {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
335
         P_BOOL},
336
337
        {"logwindow_line_limit", "1000", &prefs_common.logwin_line_limit,
338
         P_INT},
339
340
        /* External commands */
341
#ifdef G_OS_WIN32
342
        {"uri_open_command", NULL, &prefs_common.uri_cmd,
343
#else
344
        {"uri_open_command", DEFAULT_BROWSER_CMD, &prefs_common.uri_cmd,
345
#endif
346
         P_STRING},
347
#ifdef G_OS_WIN32
348
        {"print_command", NULL, &prefs_common.print_cmd, P_STRING},
349
#else
350
        {"print_command", "lpr %s", &prefs_common.print_cmd, P_STRING},
351
#endif
352
#ifdef G_OS_WIN32
353
        {"ext_editor_command", "notepad '%s'", &prefs_common.ext_editor_cmd,
354
#else
355
        {"ext_editor_command", "gedit %s", &prefs_common.ext_editor_cmd,
356
#endif
357
         P_STRING},
358
359
        {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL},
360
        {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING},
361
        {"use_ext_sendmail", "FALSE", &prefs_common.use_extsend, P_BOOL},
362
        {"ext_sendmail_cmd", DEFAULT_SENDMAIL_CMD, &prefs_common.extsend_cmd,
363
         P_STRING},
364
365
        /* Advanced */
366
        {"strict_cache_check", "FALSE", &prefs_common.strict_cache_check,
367
         P_BOOL},
368
        {"io_timeout_secs", "60", &prefs_common.io_timeout_secs, P_INT},
369
370
        {NULL, NULL, NULL, P_OTHER}
371
};
372
373
374
PrefParam *prefs_common_get_params(void)
375
{
376
        return param;
377
}
378
379
void prefs_common_read_config(void)
380
{
381
        FILE *fp;
382
        gchar *path;
383
        gchar buf[PREFSBUFSIZE];
384
385
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
386
387
        prefs_read_config(param, "Common", path, NULL);
388
389
#ifdef G_OS_WIN32
390
        if (!is_file_exist(path)) {
391
                if (conv_is_ja_locale()) {
392
                        g_free(prefs_common.textfont);
393
                        prefs_common.textfont = g_strdup("MS Gothic 12");
394
                }
395
        }
396
#endif
397
398
        g_free(path);
399
400
        prefs_common.online_mode = TRUE;
401
402
        prefs_common_junk_filter_list_set();
403
404
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
405
                           NULL);
406
        if ((fp = g_fopen(path, "rb")) == NULL) {
407
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
408
                g_free(path);
409
                return;
410
        }
411
        g_free(path);
412
        while (fgets(buf, sizeof(buf), fp) != NULL) {
413
                g_strstrip(buf);
414
                if (buf[0] == '\0') continue;
415
                prefs_common.mime_open_cmd_history =
416
                        add_history(prefs_common.mime_open_cmd_history, buf);
417
        }
418
        fclose(fp);
419
420
        prefs_common.mime_open_cmd_history =
421
                g_list_reverse(prefs_common.mime_open_cmd_history);
422
}
423
424
void prefs_common_write_config(void)
425
{
426
        GList *cur;
427
        FILE *fp;
428
        gchar *path;
429
430
        prefs_write_config(param, "Common", COMMON_RC);
431
432
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
433
                           NULL);
434
        if ((fp = g_fopen(path, "wb")) == NULL) {
435
                FILE_OP_ERROR(path, "fopen");
436
                g_free(path);
437
                return;
438
        }
439
440
        for (cur = prefs_common.mime_open_cmd_history;
441
             cur != NULL; cur = cur->next) {
442
                fputs((gchar *)cur->data, fp);
443
                fputc('\n', fp);
444
        }
445
446
        fclose(fp);
447
        g_free(path);
448
}
449
450
void prefs_common_junk_filter_list_set(void)
451
{
452
        FilterRule *rule;
453
        FilterCond *cond;
454
        FilterAction *action;
455
        GSList *cond_list = NULL, *action_list = NULL;
456
457
        if (prefs_common.junk_fltlist) {
458
                filter_rule_list_free(prefs_common.junk_fltlist);
459
                prefs_common.junk_fltlist = NULL;
460
        }
461
462
        if (!prefs_common.junk_classify_cmd || !prefs_common.junk_folder)
463
                return;
464
465
        cond = filter_cond_new(FLT_COND_CMD_TEST, 0, 0, NULL,
466
                               prefs_common.junk_classify_cmd);
467
        cond_list = g_slist_append(NULL, cond);
468
        if (prefs_common.delete_junk_on_recv) {
469
                action = filter_action_new(FLT_ACTION_COPY,
470
                                           prefs_common.junk_folder);
471
                action_list = g_slist_append(NULL, action);
472
                action = filter_action_new(FLT_ACTION_DELETE, NULL);
473
                action_list = g_slist_append(action_list, action);
474
        } else {
475
                action = filter_action_new(FLT_ACTION_MOVE,
476
                                           prefs_common.junk_folder);
477
                action_list = g_slist_append(NULL, action);
478
        }
479
480
        if (prefs_common.mark_junk_as_read) {
481
                action = filter_action_new(FLT_ACTION_MARK_READ, NULL);
482
                action_list = g_slist_append(action_list, action);
483
        }
484
485
        rule = filter_rule_new(_("Junk mail filter"), FLT_OR,
486
                               cond_list, action_list);
487
488
        prefs_common.junk_fltlist = g_slist_append(NULL, rule);
489
}