On Apr 25, 2012, at 4:05 PM, Stevan Bajić wrote:

> On 25.04.2012 22:51, Chad M Stewart wrote:
>> I'll be using dspam for lots of domains.  I'm just getting this setup and 
>> trying to send a simple test message through.   I can't figure out why dspam 
>> is trying to write a UID with a NULL value when the .sql setup file says it 
>> is not to be NULL.  What can I do to get this working?  Have I missed 
>> something?
>> 
>> (I did have to change the .sql file to read 'engine=' instead of 'type=' but 
>> otherwise I've left it alone.
>> 
>> # $Id: virtual_user_aliases.sql,v 1.2 2009/05/25 11:52:02 sbajic Exp $
>> 
>> create table dspam_virtual_uids (
>>  uid int unsigned not null,
>>  username varchar(128) not null
>> ) engine=MyISAM;
>> 
>> create unique index id_virtual_uids_01 on dspam_virtual_uids(username);
> Looks like an old version of this here:
> http://dspam.git.sourceforge.net/git/gitweb.cgi?p=dspam/dspam;a=blob;f=src/tools.mysql_drv/virtual_user_aliases.sql;hb=HEAD
> 
> 
>> 
>> dspam-devel-3.10.1_1,1 Bayesian spam filter - development version
>> mysql-client-5.5.22 Multithreaded SQL database (client)
>> FreeBSD mta01 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 
>> 2012     r...@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>> 
>> 
>> 
>> 23387: [04/25/2012 19:49:38] checking trusted user list for root(0)
>> 23387: [04/25/2012 19:49:39] No QuarantineAgent option found. Using standard 
>> quarantine.
>> 23387: [04/25/2012 19:49:39] using database handle id 1
>> 23387: [04/25/2012 19:49:39] handle locked
>> 23387: [04/25/2012 19:49:39] DSPAM Instance Startup
>> 23387: [04/25/2012 19:49:39] input args: dspam --deliver=innocent,spam
>> 23387: [04/25/2012 19:49:39] pass-thru args: /usr/bin/procmail
>> 23387: [04/25/2012 19:49:39] processing user spam-d...@balius.com
>> 23387: [04/25/2012 19:49:39] uid = 0, euid = 0, gid = 0, egid = 0
>> 23387: [04/25/2012 19:49:39] loading preferences for user 
>> spam-d...@balius.com
>> 23387: [04/25/2012 19:49:39] _mysql_drv_getpwnam: returning NULL for query 
>> on name: spam-d...@balius.com
>> 23387: [04/25/2012 19:49:39] _ds_pref_load: unable to 
>> _mysql_drv_getpwnam(spam-d...@balius.com)
>> 23387: [04/25/2012 19:49:39] _mysql_drv_getpwnam: returning NULL for query 
>> on name: @balius.com
>> 23387: [04/25/2012 19:49:39] _ds_pref_load: unable to 
>> _mysql_drv_getpwnam(@balius.com)
>> 23387: [04/25/2012 19:49:39] Loading preferences for uid 0
>> 23387: [04/25/2012 19:49:39] Loading preferences for uid 0
>> 23387: [04/25/2012 19:49:39] default preferences empty. reverting to 
>> dspam.conf preferences.
>> 23387: [04/25/2012 19:49:39] Loading preferences from dspam.conf
>> 23387: [04/25/2012 19:49:39] using 
>> /var/db/dspam/opt-in/balius.com/spam-drop.dspam as path
>> 23387: [04/25/2012 19:49:39] using 
>> /var/db/dspam/opt-out/balius.com/spam-drop.nodspam as path
>> 23387: [04/25/2012 19:49:39] sedation level set to: 5
>> 23387: [04/25/2012 19:49:39] _mysql_drv_getpwnam: setting, then returning 
>> passed name: spam-d...@balius.com
>> 23387: [04/25/2012 19:49:39] _mysql_drv_setpwnam: verified_user is 1
>> 23387: [04/25/2012 19:49:39] _mysql_drv_setpwnam: unable to run query: 
>> INSERT INTO dspam_virtual_uids (uid,username) VALUES 
>> (NULL,'spam-d...@balius.com')
>> 23387: [04/25/2012 19:49:39] _mysql_drv_get_spamtotals: unable to 
>> _mysql_drv_getpwnam(spam-d...@balius.com)
>> 23387: [04/25/2012 19:49:39] _ds_init_storage: unable to load totals. Using 
>> zero values.
>> 23387: [04/25/2012 19:49:39] message is signed.  retaining original text for 
>> reassembly
>> 23387: [04/25/2012 19:49:39] _mysql_drv_getpwnam: setting, then returning 
>> passed name: spam-d...@balius.com
>> 23387: [04/25/2012 19:49:39] _mysql_drv_setpwnam: verified_user is 1
>> 23387: [04/25/2012 19:49:39] _mysql_drv_setpwnam: unable to run query: 
>> INSERT INTO dspam_virtual_uids (uid,username) VALUES 
>> (NULL,'spam-d...@balius.com')
>> 23387: [04/25/2012 19:49:39] _ds_getall_spamrecords: unable to 
>> _mysql_drv_getpwnam(spam-d...@balius.com)
>> 23387: [04/25/2012 19:49:39] _ds_getall_spamrecords() failed
>> 23387: [04/25/2012 19:49:39] total processing time: 0.00256s
>> 23387: [04/25/2012 19:49:39] _mysql_drv_getpwnam: setting, then returning 
>> passed name: spam-d...@balius.com
>> 23387: [04/25/2012 19:49:39] _mysql_drv_setpwnam: verified_user is 1
>> 23387: [04/25/2012 19:49:39] _mysql_drv_setpwnam: unable to run query: 
>> INSERT INTO dspam_virtual_uids (uid,username) VALUES 
>> (NULL,'spam-d...@balius.com')
>> 23387: [04/25/2012 19:49:39] _mysql_drv_set_spamtotals: unable to 
>> _mysql_drv_getpwnam(spam-d...@balius.com)
>> 23387: [04/25/2012 19:49:39] delivering message
>> 23387: [04/25/2012 19:49:39] Establishing connection to 127.0.0.1:10025
>> 23387: [04/25/2012 19:49:39] Connection established
>> 23387: [04/25/2012 19:49:39] DSPAM Instance Shutdown.  Exit Code: 0
>> 23387: [04/25/2012 19:49:39] checking trusted user list for root(0)
>> 
> Aha. You are the one responsible to add users into the 
> dspam_virtual_uids table. If you want DSPAM to do that for you then you 
> have to use the other database schema:
> http://dspam.git.sourceforge.net/git/gitweb.cgi?p=dspam/dspam;a=blob;f=src/tools.mysql_drv/virtual_users.sql;hb=HEAD
> 
> Please go and read the DSPAM documentation describing when to use which 
> schema.

I did and it is confusing.   :(

the mysql_drv.txt file says

> If you plan on enabling virtual users (something you'll need to do if the 
> users
> don't actually exist on your system), also run virtual_users.sql.

While the relay.txt file says

> Step 3: Install DSPAM MySQL Objects (With a twist)
> 
> Create the MySQL objects as outlined in the MySQL DSPAM doc, but use the
> virtual_user_aliases.sql script instead of virtual-users.sql script to create
> a table without a primary key. This will allow you to create multiple email
> addresses with the same uid, which is how DSPAM recognizes users.
> 
> 

Maybe I'm just thick headed. ;-)

Since I'm setting up what I would call a relay, I followed those directions.  I 
re-created the database and now things are working.  My relay is controlling 
valid/non users, i.e. checking with the down stream smtp server and only 
accepts recipients that will be accepted by the down stream smtp server.  

I've been reading the other thread "increase spam hit rate" and am enjoying and 
learning.  :)

-Chad
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Dspam-user mailing list
Dspam-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-user

Reply via email to