The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 corrupted /var/db/spamd?
Author: Dan 
Date:   19-02-11 23:39

I had a problem with my /var/db/spamd. It was 1.1G and contained only 25,000 entries. This isn't right. It should be about 10M.

Here is how I fixed it:

/usr/local/etc/rc.d/obspamd stop
/usr/local/etc/rc.d/obspamlogd stop

spamdb | grep SPAMTRAP | awk -F '|' '{print $2}' > spamtrap
spamdb | grep TRAPPED | awk -F '|' '{print $2}' > trapped
spamdb | grep WHITE | awk -F '|' '{print $2}' > white

mv /var/db/spamdb /somewhere/

touch /var/db/spamd
chown _spamd:_spamd /var/db/spamd
chmod 600 /var/db/spamd

ls -l /var/db/spamd
-rw------- 1 _spamd _spamd 0 Feb 19 23:31 /var/db/spamd

# cat spamtrap | xargs -J % -n 200 spamdb -T -a %

# spamdb | grep SPAMTRAP | wc -l
24620

# wc -l spamtrap
24620 spamtrap


# cat white | xargs -J % -n 200 spamdb -a %

# spamdb | grep WHITE | wc -l
494
# wc -l white
494 white


# cat trapped | xargs -J % -n 200 spamdb -t -a %

# spamdb | grep TRAPPED | wc -l
92

# wc -l trapped
92 trapped

# ls -lh /var/db/spamd
-rw------- 1 _spamd _spamd 2.5M Feb 19 23:36 /var/db/spamd

Ahh, only 2.5M, good.

--
Webmaster

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 corrupted /var/db/spamd?   new
Dan 19-02-11 23:39 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org