# [SOLVED] DSPAM not writing signature to database

## Ateo

Greetings,

Please skip down to this post:

https://forums.gentoo.org/viewtopic-p-4505735.html#4505735

I'm trying to figure out why DSPAM is *not* piping my messages back to Postfix. Actually, with all my testing, it appears that sometimes mail is piped back but most of the time it does not (in which case I get my soft bounce)..

DSPAM is getting the message as can be seen by the DSPAM log below and by viewing the DSPAM data in the database. However, it is currently failing right after it determines whether the message is spam/not spam and does not pipe the message back to Postfix.

I've googled the error but the results returned don't seem to help me any....

Here is the relevant master.cf configuration (user dspam is listed as a "trusted user" in dspam.conf):

```
dspam           unix    -       n       n       -       10      pipe

 flags=DRhu user=dspam argv=/usr/bin/dspam

 --client --user ${recipient} --deliver=innocent,spam -i -f ${sender} -- ${recipient}
```

And the relevant dspam.conf configuration:

```
TrustedDeliveryAgent "/usr/sbin/sendmail"

Trust root

Trust dspam

Trust vmail

Trust postfix
```

Here are some logs:

```
Nov 13 10:55:36 mail.mydomain.com postfix/pipe[23899]: E623A123AE: to=<user@mydomain.com>, orig_to=<alias@mydomain.com>, relay=dspam, delay=1.7, delays=1.7/0/0/0.01, dsn=4.3.0, status=SOFTBOUNCE (Command died with status 251: "/usr/bin/dspam")
```

```
23300: [11/13/2007 10:36:15] Control: [10 10] [10 11] Delta: [0 1]

23300: [11/13/2007 10:36:15] total processing time: 0.00847s

23300: [11/13/2007 10:36:15] saving signature as 1,4739ee9f233002082988834

23300: [11/13/2007 10:36:15] libdspam returned probability of 0.002278

23300: [11/13/2007 10:36:15] message result: NOT SPAM
```

Any ideas would be appreciated. I'm not sure what else to look at.

ThanksLast edited by Ateo on Tue Nov 20, 2007 12:05 am; edited 4 times in total

----------

## steveb

Are you running DSPAM in deamon mode?

Why using the pipe transport? Do you see any benefit using it? Why not switching to LMTP or SMTP?

// SteveB

----------

## Ateo

 *steveb wrote:*   

> Are you running DSPAM in deamon mode?

 

Yes.

 *steveb wrote:*   

> Why using the pipe transport? Do you see any benefit using it? Why not switching to LMTP or SMTP?

 

To be honest, I can't answer the first two because I simply do not know. Shortly after posting here, I decided to try my luck with LMTP/SMTP mode in order to use socket connections to reduce tcp overhead but I'm still running into snags.

After restarting the services, as with pipe mode, DSPAM delivers the message back to Postfix. This works for a few messages but then DSPAM stops delivering back to Postfix (DSPAM continues to scan/score/etc) and the message ends up in the Postfix queue with errors. Here is the postfix log for 2 different delivery attempts with 2 different reasons for the [soft] bounce. Needless to say, I'm puzzled.

```
Nov 13 16:47:32 mail.mydomain.com postfix/lmtp[29667]: F2A9118A81: to=<user@mydomain.com>, orig_to=<alias@mydomain.com>, relay=mail.mydomain.com[/var/run/dspam/dspam.sock], delay=1.1, delays=1.1/0/0/0.01, dsn=4.4.2, status=deferred (lost connection with mail.mydomain.com[/var/run/dspam/dspam.sock] while sending end of data -- message may be sent more than once)
```

```
Nov 13 16:52:20 mail.mydomain.com postfix/lmtp[29733]: 9FB62142C2: to=<user@mydomain.com>, orig_to=<alias@mydomain.com>, relay=none, delay=1.6, delays=1.6/0/0/0, dsn=4.4.1, status=deferred (connect to mail.mydomain.net[/var/run/dspam/dspam.sock]: Connection refused)
```

Additionally, even with a successful delivery, DSPAM does not insert the signature into the sql database (dspam_signature_data) but *does* write the signature into the message header (as configured).

RegardsLast edited by Ateo on Fri Nov 16, 2007 12:10 am; edited 1 time in total

----------

## Ateo

Ok. My issue was the fact that I had set DSPAM's group file to "merged".  Anyways, I set it to "shared" and everything delivers well.

However, one issue remains... For some reason, the signature is not written to the database (into dspam_signature_data). dspam_stats, dspam_token_data, dspam_virtual_uids are all written to as expected. What would cause this behavior?

Thanks

----------

## Ateo

OK.. So I found forums.gentoo.org/viewtopic-t-580207.html very helpful. I followed it. Messages are scanned and delivered.

Still, the signature is not being written to the database. All other data is written to the database. To make things easy, I'm posting my config files:

```
boron ~ # dspam --version

DSPAM Anti-Spam Suite 3.8.0 (agent/library)

Copyright (c) 2002-2006 Jonathan A. Zdziarski

http://dspam.nuclearelephant.com

DSPAM may be copied only under the terms of the GNU General Public License,

a copy of which can be found with the DSPAM distribution kit.

Configuration parameters:  '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--with-storage-driver=hash_drv,mysql_drv' '--with-dspam-home=/var/spool/dspam' '--sysconfdir=/etc/mail/dspam' '--enable-daemon' '--disable-ldap' '--enable-clamav' '--enable-large-scale' '--disable-domain-scale' '--disable-syslog' '--enable-debug' '--enable-bnr-debug' '--enable-long-usernames' '--with-dspam-group=dspam' '--with-dspam-home-group=dspam' '--with-dspam-mode=2511' '--with-logdir=/var/log/dspam' '--enable-virtual-users' '--enable-preferences-extension' '--disable-homedir' '--with-mysql-includes=/usr/include/mysql' '--with-mysql-libraries=/usr/lib/mysql' '--build=i686-pc-linux-gnu' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=prescott -O2 -pipe -fomit-frame-pointer -Wl,-z,now' 'CXXFLAGS=-march=prescott -O2 -pipe -fomit-frame-pointer -Wl,-z,now'
```

```
smtpd_recipient_restrictions =

 permit_mynetworks,

 permit_sasl_authenticated,

 ...

 reject_invalid_hostname,

 check_policy_service inet:127.0.0.1:666,

 check_recipient_access pcre:/etc/postfix/maps/dspam_incoming,

 permit
```

```
dspam     unix  -       -       n       -       10      lmtp

127.0.0.1:667 inet    n       -       n       -       -       smtpd

 -o smtpd_authorized_xforward_hosts=127.0.0.0/8

 -o smtpd_client_restrictions=

 -o smtpd_helo_restrictions=

 -o smtpd_sender_restrictions=

 -o smtpd_recipient_restrictions=permit_mynetworks,reject

 -o mynetworks=127.0.0.0/8

 -o receive_override_options=no_unknown_recipient_checks

```

```
/./     FILTER dspam:unix:/var/run/dspam/dspam.sock
```

```
Home /var/spool/dspam

StorageDriver /usr/lib/dspam/libmysql_drv.so

TrustedDeliveryAgent "/usr/sbin/sendmail"

UntrustedDeliveryAgent "/usr/sbin/sendmail"

DeliveryHost        127.0.0.1

DeliveryPort        667

DeliveryIdent       dspam.mydomain.net

DeliveryProto       SMTP

OnFail error

Trust root

Trust dspam

Trust apache

Trust mail

Trust smmsp

Trust daemon

Trust filter

Trust postfix

Debug *

TrainingMode toe

TestConditionalTraining on

Feature noise

Feature whitelist

Feature tb=5

Algorithm burton graham naive

Tokenizer osb

PValue bcr

WebStats on

ImprobabilityDrive on

Preference "trainingMode=TOE"      # TEFT, TUM, TOE

Preference "spamAction=tag"      # tag, quarantine, deliver

Preference "signatureLocation=headers"   # 'message' or 'headers'

Preference "spamSubject="

Preference "statisticalSedation=5"   # 0 to 9

Preference "enableBNR=on"      # on, off

Preference "showFactors=off"      # on, off

Preference "enableWhitelist=on"      # on, off

Preference "whitelistThreshold=5"

AllowOverride trainingMode

AllowOverride spamAction spamSubject

AllowOverride statisticalSedation

AllowOverride enableBNR

AllowOverride enableWhitelist

AllowOverride signatureLocation

AllowOverride showFactors

AllowOverride optIn optOut

AllowOverride whitelistThreshold

MySQLServer     /var/run/mysqld/mysqld.sock

MySQLUser __db_username__

MySQLPass __db_password__

MySQLDb dspamdb

MySQLCompress true

MySQLConnectionCache    10

MySQLVirtualTable          dspam_virtual_uids

MySQLVirtualUIDField       uid

MySQLVirtualUsernameField  username

MySQLUIDInSignature    on

HashRecMax              98317

HashAutoExtend          on

HashMaxExtents          0

HashExtentSize          49157

HashPctIncrease 10

HashMaxSeek             10

HashConnectionCache     10

Notifications   off

PurgeSignature  off # Specified in purge.sql

PurgeNeutral   90

PurgeUnused    off # Specified in purge.sql

PurgeHapaxes   off # Specified in purge.sql

PurgeHits1S    off # Specified in purge.sql

PurgeHits1I    off # Specified in purge.sql

LocalMX 127.0.0.1 192.168.4.245

SystemLog on

UserLog   on

TrainPristine on

Opt out

TrackSources spam nonspam

ParseToHeaders on

ChangeModeOnParse on

ChangeUserOnParse off

Broken case

Broken lineStripping

MaxMessageSize 102400

ServerQueueSize         32

ServerPID              /var/run/dspam/dspam.pid

ServerMode auto

ServerParameters        "--deliver=innocent,spam"

ServerIdent             "dspam.mydomain.net"

ServerDomainSocketPath  "/var/run/dspam/dspam.sock"

ClientHost      "/var/run/dspam/dspam.sock"

ProcessorURLContext on

ProcessorBias on
```

```
global:shared:*
```

```
uid   username

===================

10   global

## END OF LIST
```

```
uid   preference      value

=======================================

10   trainingMode      TOE

10   statisticalSedation   5

10   spamSubject

10   spamAction      tag

10   signatureLocation   header

10   showFactors      off

10   optOut         on

10   optIn         off

10   enableWhitelist      on

10   enableBNR      on

## END OF LIST
```

Please note that I am letting DSPAM learn as mail comes in. I'm not doing any mass training as policyd-weight rejects spam very nicely.

//edit I've changed the title to reflect the current issue

----------

## steveb

Try this:

```
dspam_admin change preference global optOut off

dspam_admin change preference global optIn on

sed -i -e "s:^Opt[\t ]*out[\t ]*$:Opt in:gI" /etc/mail/dspam/dspam.conf
```

Did that solved the problem?

// SteveB

----------

## Ateo

One step ahead of you. I tried playing with opt in/out but that doesn't seem to help any...

Thanks

----------

## steveb

You wrote: *Ateo wrote:*   

> All other data is written to the database.

 

What do you mean with all other data? Does anything get written into the database? What does get written into the database?

Could you try to remove the shared group? Does it work without the shared group?

// SteveB

----------

## Ateo

 *steveb wrote:*   

> You wrote: *Ateo wrote:*   All other data is written to the database. 
> 
> What do you mean with all other data? Does anything get written into the database? What does get written into the database?

 

DSPAM has 5 tables in the database.  dspam_preferences, dspam_signature_data, dspam_stats, dspam_token_data and dspam_virtual_uids. When I say all other data is written, I mean, stats are accounted for for the user, tokens are written and, if no user exists, the user mail is being delivered for AND the user from the group file are created. So, all data except the signature is being saved to the database.

 *steveb wrote:*   

> Could you try to remove the shared group? Does it work without the shared group?

 

I have removed the shared group. In fact, I have removed the file and the issue remains (signature not being stored to database).

FYI: I started with a clean database (dropped DB and recreated). A new user (the user mail is being delivered for) was added to dspam_virtual_uids, tokens were saved to dspam_token_data and stats were started for the user in dspam_stats.

----------

## steveb

Do you get a signature if you try to pipe a mail to dspam from the command line?

// SteveB

----------

## Ateo

No. I do not. Same behavior. Starting with an empty database, the user is created on the fly, stats and tokens saved. Yet no signature...

debug does claim a signature is created/saved:

```
.....

20002: [11/17/2007 13:38:48] Control: [10 10] [10 11] Delta: [0 1]

20002: [11/17/2007 13:38:48] total processing time: 0.02426s

20002: [11/17/2007 13:38:48] saving signature as 4,473f5f68200022095112453

20002: [11/17/2007 13:38:48] libdspam returned probability of 0.000000

20002: [11/17/2007 13:38:48] message result: NOT SPAM

20002: [11/17/2007 13:38:48] DSPAM Instance Shutdown.  Exit Code: 0
```

----------

## steveb

Could you post the structure of your tables inside dspamdb? And how are the rights to the database/tables for the DSPAM user? Could you post that info as well?

// SteveB

----------

## Ateo

The following is created (user database user and database) with from running:

```
emerge --config =dspam-3.8.0-r7
```

The dspam user has the following rights (I've even set permissions to all):

```

Databases    User    Hosts    Permissions

======================================================

dspamdb      dspam   Any      Select | Insert | Update | Delete
```

Here is the DB structure:

```
CREATE TABLE `dspam_preferences` (

  `uid` smallint(5) unsigned NOT NULL,

  `preference` varchar(32) NOT NULL,

  `value` varchar(64) NOT NULL,

  UNIQUE KEY `id_preferences_01` (`uid`,`preference`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `dspam_signature_data` (

  `uid` smallint(5) unsigned NOT NULL,

  `signature` char(32) NOT NULL,

  `data` blob NOT NULL,

  `length` smallint(6) NOT NULL,

  `created_on` date NOT NULL,

  UNIQUE KEY `id_signature_data_01` (`uid`,`signature`),

  KEY `id_signature_data_02` (`created_on`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 MAX_ROWS=2500000 AVG_ROW_LENGTH=8096;

CREATE TABLE `dspam_stats` (

  `uid` smallint(5) unsigned NOT NULL,

  `spam_learned` int(11) NOT NULL,

  `innocent_learned` int(11) NOT NULL,

  `spam_misclassified` int(11) NOT NULL,

  `innocent_misclassified` int(11) NOT NULL,

  `spam_corpusfed` int(11) NOT NULL,

  `innocent_corpusfed` int(11) NOT NULL,

  `spam_classified` int(11) NOT NULL,

  `innocent_classified` int(11) NOT NULL,

  PRIMARY KEY  (`uid`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `dspam_token_data` (

  `uid` smallint(5) unsigned NOT NULL,

  `token` bigint(20) unsigned NOT NULL,

  `spam_hits` int(11) NOT NULL,

  `innocent_hits` int(11) NOT NULL,

  `last_hit` date NOT NULL,

  UNIQUE KEY `id_token_data_01` (`uid`,`token`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=1;

CREATE TABLE `dspam_virtual_uids` (

  `uid` smallint(5) unsigned NOT NULL auto_increment,

  `username` varchar(128) default NULL,

  PRIMARY KEY  (`uid`),

  UNIQUE KEY `id_virtual_uids_01` (`username`)

) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
```

Thanks

----------

## steveb

Are you open to new stuff? Would it be possible to drop the tables and recreate them?

// SteveB

----------

## Ateo

Absolutely. I'm open to about anything right now. This issue is over a week old.. =)

----------

## steveb

Okay. First stop DSPAM:

```
/etc/init.d/dspam stop
```

Then drop the database and the DSPAM user from your MySQL instance:

```
DROP DATABASE dspamdb;

REVOKE ALL PRIVILEGES, GRANT OPTION FROM dspam;
```

Then clear all the stuff in /var/spool/dspam/data:

```
rm -rf /var/spool/dspam/data/*
```

Now use the ebuild to create the database and the other stuff:

```
emerge --config =dspam-3.8.0-r7
```

Now create the user with uid 0 (used for default preferences). Connect to your MySQL and execute:

```
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";INSERT INTO dspamdb.dspam_virtual_uids VALUES ('0', 'default_prefs');
```

Now fill in the default parameters:

```
dspam_admin change preference default_prefs enableBNR "on"

dspam_admin change preference default_prefs enableWhitelist "on"

dspam_admin change preference default_prefs ignoreGroups "off"

dspam_admin change preference default_prefs optIn "on"

dspam_admin change preference default_prefs optOut "off"

dspam_admin change preference default_prefs optOutClamAV "off"

dspam_admin change preference default_prefs processorBias "on"

dspam_admin change preference default_prefs showFactors "off"

dspam_admin change preference default_prefs signatureLocation "header"

dspam_admin change preference default_prefs spamAction "tag"

dspam_admin change preference default_prefs spamSubject "[SPAM]"

dspam_admin change preference default_prefs statisticalSedation "5"

dspam_admin change preference default_prefs storeFragments "off"

dspam_admin change preference default_prefs trainingMode "TOE"

dspam_admin change preference default_prefs whitelistThreshold "10"
```

If you go with shared groups, then you don't need to add the part blow with the preferences for the user "global". If you go with merged groups, then add this:

```
dspam_admin change preference global enableBNR "on"

dspam_admin change preference global enableWhitelist "off"

dspam_admin change preference global ignoreGroups "on"

dspam_admin change preference global optIn "on"

dspam_admin change preference global optOut "off"

dspam_admin change preference global optOutClamAV "on"

dspam_admin change preference global processorBias "off"

dspam_admin change preference global showFactors "off"

dspam_admin change preference global signatureLocation "header"

dspam_admin change preference global spamAction "tag"

dspam_admin change preference global spamSubject ""

dspam_admin change preference global statisticalSedation "5"

dspam_admin change preference global storeFragments "off"

dspam_admin change preference global trainingMode "TOE"

dspam_admin change preference global whitelistThreshold "999999"
```

Now create the shared group (I personally would use merged group but you have probably your reasons to use shared):

```
echo "global:shared:*">/var/spool/dspam/group
```

Now restart DSPAM and try to classify. Is the signature now showing up in the database?

// SteveB

----------

## Ateo

GADS! It's still not writing the signature....

But the log says different...

```
22472: [11/18/2007 13:47:18] DSPAM Instance Startup

22472: [11/18/2007 13:47:18] input args: dspam --deliver=innocent,spam

22472: [11/18/2007 13:47:18] pass-thru args: /usr/sbin/sendmail

22472: [11/18/2007 13:47:18] processing user user@domain.com

22472: [11/18/2007 13:47:18] uid = 0, euid = 0, gid = 0, egid = 1002

22472: [11/18/2007 13:47:18] loading preferences for user user@domain.com

22472: [11/18/2007 13:47:18] Loading preferences for uid 2

22472: [11/18/2007 13:47:18] Loading preferences for uid 0

22472: [11/18/2007 13:47:18] Loading preferences for uid 0

22472: [11/18/2007 13:47:18] loaded default preferences externally

22472: [11/18/2007 13:47:18] using /var/spool/dspam/opt-in/user@domain.com.dspam as path

22472: [11/18/2007 13:47:18] using /var/spool/dspam/opt-out/user@domain.com.nodspam as path

22472: [11/18/2007 13:47:18] adding user to merged group global

22472: [11/18/2007 13:47:18] sedation level set to: 5

22472: [11/18/2007 13:47:18] Loading 4 BNR patterns

22472: [11/18/2007 13:47:18] Whitelist threshold: 10

....... tests .......

22472: [11/18/2007 13:47:18] Naive-Bayesian Probability: 0.000000 Samples: 195

22472: [11/18/2007 13:47:18] Graham-Bayesian Probability: 0.002278 Samples: 15

22472: [11/18/2007 13:47:18] Burton-Bayesian Probability: 0.000018 Samples: 27

22472: [11/18/2007 13:47:18] Result Confidence: 1.00

22472: [11/18/2007 13:47:18] BNR Decision Concurs

22472: [11/18/2007 13:47:18] Control: [10 10] [10 11] Delta: [0 1]

22472: [11/18/2007 13:47:18] total processing time: 0.02083s

22472: [11/18/2007 13:47:18] saving signature as 2,4740b2e6224721560216709

22472: [11/18/2007 13:47:18] libdspam returned probability of 0.000000

22472: [11/18/2007 13:47:18] message result: NOT SPAM

22472: [11/18/2007 13:47:18] delivering message

22472: [11/18/2007 13:47:18] Establishing connection to 127.0.0.1:11025

22472: [11/18/2007 13:47:18] Connection established

22472: [11/18/2007 13:47:19] DSPAM Instance Shutdown.  Exit Code: 0

22472: [11/18/2007 13:47:19] checking trusted user list for root(0)
```

dspam_preferences populated... CHECK

dspam_stats saved... CHECK

dspam_token_data saved... CHECK

dspam_virtual_uids saved... CHECK

Frustrating... No signature... I followed your instructions 3 times.

I appreciate your help...

----------

## steveb

Strange! Do you see an entry in /var/spool/dspam/system.log referencing the mail?

To me this all looks like you are using the hash driver and not mysql driver. What output do you get from:

```
find /var/spool/dspam/data/
```

// SteveB

----------

## Ateo

Yes I do...

```
1195422438      I       "Agent J" <amoeba.x@gmail.com>  2,4740b2e6224721560216709       DSPAM + error 251       0.022397        user@domain.com      Delivered    <d24d28bc0711181347l49240a07yaaa932a8be558539@mail.gmail.com>
```

----------

## steveb

What output do you get from this command:

```
echo -ne "Date: $(date)\nFrom: Agent J <amoeba.x@gmail.com>\nTo: user@domain.com\nSubject: Link\n\nhttp://www.linux-magazin.de\n" | dspam --user user@domain.com --deliver=summary --stdout
```

Please replace "user@domain.com" with your user name you use in DSPAM.

If that works, then you probably have a connectivity issue. Either with connecting to the DSPAM socket or to MySQL. What version of MySQL are you using?

Do you have the file /var/log/dspam/sql.errors? If so, what is the content?

// SteveB

----------

## Ateo

The output of the above command:

```
$ echo -ne "Date: $(date)\nFrom: Agent J <amoeba.x@gmail.com>\nTo: user@domain.com\nSubject: Link\n\nhttp://www.linux-magazin.de\n" | dspam --user user@domain.com --deliver=summary --stdout                              

X-DSPAM-Result: user@domain.com; result="Innocent"; class="Innocent"; probability=0.0000; confidence=1.00; signature=2,4740cd70247925939618124
```

I am using dev-db/mysql-5.0.44-r2...

/var/log/dspam/sql.errors does not currently exist. In my time debugging, the only time I've seen this log file created is when DSPAM attempts to load a preference with an empty value. In my case, I had the preference "spamSubject" set to an empty value. Other than that, I've not had any other SQL errors written.

----------

## steveb

Have you tuned your MySQL server for DSPAM? The whole stuff sounds like DSPAM is loosing connectivity to MySQL. Have you tried to apply the patches from Bugzilla Bug 199428?

Especially the dspam-3.8.0-mysql_reconnect.patch?

// SteveB

----------

## Ateo

I applied the reconnect patch (actually, I applied all patches). The signature is still not being written. Also, dspam_stats is no longer written to.

I am going to try with PgSQL...

----------

## steveb

 *Ateo wrote:*   

> I applied the reconnect patch (actually, I applied all patches). The signature is still not being written. Also, dspam_stats is no longer written to.
> 
> I am going to try with PgSQL...

 This is ultra fishy. PostgreSQL could be a solution but I would be very much be interested in seeing what the problem is with MySQL.

// SteveB

----------

## magic919

Is it normal to have the comma in the signature?

 *Quote:*   

> 
> 
> signature=2,4740cd70247925939618124
> 
> 

 

Only none of mine do.

```

X-DSPAM-Result: user; result="Innocent"; class="Innocent"; probability=0.0000; confidence=0.42; signature=4741f5b9174681804284693

```

----------

## Ateo

 *steveb wrote:*   

> This is ultra fishy. PostgreSQL could be a solution but I would be very much be interested in seeing what the problem is with MySQL.

 

It gets stranger.. The same behavior occurs with PgSQL. All data (stats, tokens, new uid if needed) are written *except* the signature. No logs to sql.errors either. Pg logs.. nothing...

Is my dspam.conf right? Is there any parameter in there that I should comment out? As far as I can tell, I'm configured good here at my end. I could be wrong...

 *magic919 wrote:*   

> Is it normal to have the comma in the signature?

 

I've never known signatures to not have the comma. The number before the comma is the uid of recipient (fyi).

----------

## steveb

 *magic919 wrote:*   

> Is it normal to have the comma in the signature?

 Yes it is normal if you have:

```
MySQLUIDInSignature on
```

// SteveB

----------

## magic919

Cheers Steve.  It's a feature I never use.

----------

## steveb

 *magic919 wrote:*   

> Cheers Steve.  It's a feature I never use.

 Hello Magic  :Smile: 

I use it for retraining. It is a good way to allow users to retrain with just sending the signature to a certain email address.

// SteveB

----------

## steveb

I am an IDIOT!!! Sorry!

Could you change:

```
MySQLVirtualTable          dspam_virtual_uids

MySQLVirtualUIDField       uid

MySQLVirtualUsernameField  username

TrainPristine on
```

To:

```
#MySQLVirtualTable          dspam_virtual_uids

#MySQLVirtualUIDField       uid

#MySQLVirtualUsernameField  username

#TrainPristine on
```

The problem with the signatures is the TrainPristine switch:

```
#

# TrainPristine: for systems where the original message remains server side

# and can therefore be presented in pristine format for retraining. This option

# will cause DSPAM to cease all writing of signatures and DSPAM headers to the

# message, and deliver the message in as pristine format as possible. This mode

# REQUIRES that the original message in its pristine format (as of delivery)

# be presented for retraining, as in the case of webmail, imap, or other

# applications where the message is actually kept server-side during reading,

# and is preserved. DO NOT use this switch unless the original message can be

# presented for retraining with the ORIGINAL HEADERS and NO MODIFICATIONS.

#

# NOTE: You can't use this setting with dspam_trian; if you're going to use it,

#       wait until after you train any corpora.

#

#TrainPristine on
```

The other 3 parameters "MySQLVirtual...." are not needed since you anyway use DSPAM for the UID.

Tell me if this was/is the problem.

// SteveB

----------

## Ateo

Steve.. It was the TrainPristine parameter.. I understood that parameter wrong. As I read it, I thought this needed to be enabled if messages are on the server (regardless of reason)..

I can't thank you enough.

//solved...

----------

## steveb

 *Ateo wrote:*   

> Steve.. It was the TrainPristine parameter.. I understood that parameter wrong. As I read it, I thought this needed to be enabled if messages are on the server (regardless of reason)..

 Sorry for not spotting that. I looked at your configuration but not hard enough. After you posted that you have the same error with PostgreSQL, I took the time to compare with diff your and my version and then I spotted TrainPristine being enabled. Sorry for that.

 *Ateo wrote:*   

> I can't thank you enough.

 No problem. That's the reason we all are hanging here in the forum. Helping each other where we can.

 *Ateo wrote:*   

> //solved...

 Cool.  :Very Happy: 

// SteveB

----------

## magic919

 *steveb wrote:*   

>  *magic919 wrote:*   Cheers Steve.  It's a feature I never use. Hello Magic 
> 
> I use it for retraining. It is a good way to allow users to retrain with just sending the signature to a certain email address.
> 
> // SteveB

 

Hey Steve  :Smile: 

I only retrain with IMAP folders these days.  Some of the users just couldn't be bothered with the forwarding - too much effort for the poor things...

----------

## steveb

 *magic919 wrote:*   

> I only retrain with IMAP folders these days.  Some of the users just couldn't be bothered with the forwarding - too much effort for the poor things...

 Okay. I am not in the nice position to enforce stuff. I have too many domains on the server and each domain owner has his way of handling things and each domain user again has his way. So I offer as much as possible ways to work with the anti-spam filter. IMAP folders is one way but not the only one. Unfortunately I have to offer more than that.

// SteveB

----------

