I have found that the "%xds" parameter doesn't seem to work on my installation and using it confuses dspam.
AFAICT, this parameter is superfluous anyway, since dspam writes the signature to the message body or header, and when retraining a message it finds this information and uses it. It isn't necessary to pass the signature on the command line.
Hence, I am now using this:
$rcmail_config['markasjunk2_spam_cmd'] = "/usr/local/bin/dspam --user %i --class=spam --source=error";
$rcmail_config['markasjunk2_ham_cmd'] = "/usr/local/bin/dspam --user %i --class=ham --source=error ";