Harmonise GUI maximum value with libspamc's one
authorRicardo Mones <ricardo@mones.org>
Tue, 4 Aug 2020 08:47:15 +0000 (10:47 +0200)
committerRicardo Mones <ricardo@mones.org>
Tue, 4 Aug 2020 08:47:15 +0000 (10:47 +0200)
…and now SpamAssassin plugin can handle messages up to 256 Mb.

src/plugins/spamassassin/spamassassin_gtk.c

index b88a332938f94dde209f626aea007d4ef8bf0654..ad7ad2ca1f4f333acc9514140aefa97477f91c9a 100644 (file)
@@ -41,6 +41,9 @@
 #include "menu.h"
 #include "addressbook.h"
 #include "combobox.h"
+#include "libspamc.h"
+
+#define SA_MAX_SIZE_KB (SPAMC_MAX_MESSAGE_LEN / 1024)
 
 struct SpamAssassinPage
 {
@@ -375,7 +378,7 @@ static void spamassassin_create_widget_func(PrefsPage * _page,
        gtk_widget_show(max_size_label);
        gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_label, FALSE, FALSE, 0);
 
-       max_size_spinbtn_adj = GTK_ADJUSTMENT(gtk_adjustment_new(250, 0, 10000, 10, 10, 0));
+       max_size_spinbtn_adj = GTK_ADJUSTMENT(gtk_adjustment_new(250, 0, SA_MAX_SIZE_KB, 10, 10, 0));
        max_size_spinbtn = gtk_spin_button_new(GTK_ADJUSTMENT(max_size_spinbtn_adj), 1, 0);
        gtk_widget_show(max_size_spinbtn);
        gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_spinbtn, FALSE, FALSE, 0);