IF(PERL_EXECUTABLE)
ADD_CUSTOM_COMMAND(OUTPUT perl/Makefile
- PRE_BUILD
+ DEPENDS perl/Makefile.PL
COMMAND ${PERL_EXECUTABLE} ./Makefile.PL
WORKING_DIRECTORY perl)
CONFIGURE_FILE(perl/Makefile.PL.in perl/Makefile.PL)
# Perl lib
IF(PERL_EXECUTABLE)
- INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} ./Makefile.PL WORKING_DIRECTORY perl)")
- INSTALL(CODE "EXECUTE_PROCESS(COMMAND make WORKING_DIRECTORY perl)")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND make install WORKING_DIRECTORY perl)")
ENDIF(PERL_EXECUTABLE)
my %cfg = (
'hosts' => ['localhost:11333'],
'timeout' => 1,
+ 'password' => '',
+ 'statfiles' => ['WINNOW_HAM', 'WINNOW_SPAM'],
);
sub new {
),
br,
"<label for=\"id_statfile\">Statfile:</label>",
- textfield(-name=>'statfile', -id=>'id_statfile'),
+ popup_menu(-name=>'statfile', -id=>'id_statfile', -values=>$cfg{'statfiles'}),
br,
"<label for=\"id_file\">File:</label>",
filefield(-name=>'upload_file', -id=>'id_file'),
if (!@servers || scalar(@servers) == 0) {
@servers = @{ $cfg{'hosts'} };
}
- my $rspamd = Mail::Rspamd::Client->new({hosts => \@servers, timeout=>$cfg{timeout}});
+ my $rspamd = Mail::Rspamd::Client->new({hosts => \@servers, timeout=>$cfg{timeout}, password=>$cfg{password}});
my $cmd = $cgi->param('command');
if (!$cmd) {
return undef;
sub learn {
my ($self, $msg) = @_;
- $self->{command} = 'LEARN';
+ $self->{command} = 'learn';
$self->{control} = 1;
return $self->do_all_cmd ($msg);
}
comp = g_completion_new (completion_func);
g_completion_add_items (comp, comp_list);
+ g_completion_set_compare (comp, g_ascii_strncasecmp);
/* Fill hostname buf */
hostmax = sysconf (_SC_HOST_NAME_MAX) + 1;
hostbuf = alloca (hostmax);
#endif
}
- if (task->worker) {
- task->worker->srv->stat->messages_scanned++;
- }
-
return 0;
}
msg_info ("%s", logbuf);
rspamd_dispatcher_write (task->dispatcher, CRLF, sizeof (CRLF) - 1, FALSE, TRUE);
+ task->worker->srv->stat->messages_scanned++;
if (default_score >= default_required_score) {
task->worker->srv->stat->messages_spam ++;
}
rspamd_dispatcher_write (task->dispatcher, outbuf, r, TRUE, FALSE);
rspamd_dispatcher_write (task->dispatcher, outmsg, strlen (outmsg), FALSE, TRUE);
+ task->worker->srv->stat->messages_scanned++;
if (default_score >= default_required_score) {
task->worker->srv->stat->messages_spam ++;
}