1
/* $Id: agent_shared.c,v 1.81 2010/08/22 20:16:54 sbajic Exp $ */
1
/* $Id: agent_shared.c,v 1.86 2011/07/11 22:05:48 sbajic Exp $ */
5
COPYRIGHT (C) 2002-2010 DSPAM PROJECT
5
COPYRIGHT (C) 2002-2011 DSPAM PROJECT
7
This program is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License
9
as published by the Free Software Foundation; version 2
7
This program is free software: you can redistribute it and/or modify
8
it under the terms of the GNU Affero General Public License as
9
published by the Free Software Foundation, either version 3 of the
10
License, or (at your option) any later version.
12
12
This program is distributed in the hope that it will be useful,
13
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
15
GNU Affero General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
You should have received a copy of the GNU Affero General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
95
94
int initialize_atx(AGENT_CTX *ATX) {
96
95
memset(ATX, 0, sizeof(AGENT_CTX));
97
ATX->training_mode = DST_DEFAULT;
98
96
ATX->training_buffer = 0;
99
97
ATX->train_pristine = 0;
100
98
ATX->classification = DSR_NONE;
237
235
if (!strncmp (argv[i], "--mode=", 7))
239
237
char *mode = strchr(argv[i], '=')+1;
240
process_mode(ATX, mode);
238
if (process_mode(ATX, mode))
240
ATX->flags |= DAF_FIXED_TR_MODE;
446
446
if (!strcmp (argv[i], "--version"))
448
448
printf ("\nDSPAM Anti-Spam Suite %s (agent/library)\n\n", VERSION);
449
printf ("Copyright (c) 2002-2010 DSPAM Project\n");
449
printf ("Copyright (C) 2002-2011 DSPAM Project\n");
450
450
printf ("http://dspam.sourceforge.net.\n\n");
451
printf ("DSPAM may be copied only under the terms of the GNU "
452
"General Public License,\n");
453
printf ("a copy of which can be found with the DSPAM distribution "
451
printf ("DSPAM may be copied only under the terms of the GNU Affero General Public\n");
452
printf ("License, a copy of which can be found with the DSPAM distribution kit.\n\n");
455
453
#ifdef TRUSTED_USER_SECURITY
456
454
if (ATX->trusted) {
591
589
/* Training mode */
593
if (ATX->training_mode == DST_DEFAULT) {
591
if (!(ATX->flags & DAF_FIXED_TR_MODE)) {
594
592
char *v = _ds_read_attribute(agent_config, "TrainingMode");
595
process_mode(ATX, v);
593
if (process_mode(ATX, v)) {
594
LOG(LOG_ERR, ERR_AGENT_NO_TR_MODE);
598
599
/* Default delivery agent */
698
if (ATX->training_mode == DST_DEFAULT)
700
LOG(LOG_ERR, ERR_AGENT_NO_TR_MODE);
704
699
if (!_ds_match_attribute(agent_config, "ParseToHeaders", "on")) {
706
701
if (ATX->users->items == 0)