Man, my email is still scarily empty [1]. One thing to keep in mind—until yesterday, I did no filtering for spam. Nothing. I got it all. And now?
It's like spam doesn't even exist.
Even though I started yesterday (just before midnight) I really only have about twelve hours of actual stats since there were a few problems with the program (more on that in a bit). But, in the past twelve hours, 2,251 emails came in, and only **six** made it through to the whitelist, a rate of about 0.3%.
Not bad.
And of the six, two were spam, but only one got through because the other one was sent to a non-existant account.
Now, the problems.
Problem one—the default embargo time was set too high. I only found this out after running the program for an hour. So that was a restart.
Problem two—the program crashed when dumping the tuples, and I don't know why. The program responds to the signal USR1 by calling fork() (which creates a duplicate of the running process); the parent process then goes back to servicing requests while the child process generates the dump file and exits. I do it this way for two reasons; 1) the program can still process requests and 2) since the child process gets a separate copy of everything, it can dump the data without the parent changing the data as it runs. The dump went fine; it is when the child process ends that the program goes into the weeds.
Now, I've used similar code in another daemon I wrote [2], and it worked on the development server, but not on my email server. There is a slight difference in Linux kernels between the two, but the major difference between the two—the mail server is a virtual server. Perhaps the calls to _exit() were problematic on the virtual server? Change them to exit() (there's a slight difference between the two, the details of which aren't important, because—).
And that didn't work. Program still crashed (and mind you, each of these tests take just over an hour to do). It could just be a problem with fork() and signal semantics under the virtual server. To work around that problem, I just removed the call to fork() and have the single process do the dump (ignoring any requests in the meantime).
And that seems to have done the trick to keep it up and running.