Florent Bruneau [Sun, 12 Oct 2008 09:44:38 +0000 (11:44 +0200)]
Don't reload when an asynchronous filter is running.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 12 Oct 2008 08:19:39 +0000 (10:19 +0200)]
Fix tst-filters (use latest API).
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 11 Oct 2008 19:56:43 +0000 (21:56 +0200)]
valgrind cleanup (hum, unbound does not cleanup all the memory it allocate...)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 11 Oct 2008 19:27:51 +0000 (21:27 +0200)]
Fix stupid bug.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 11 Oct 2008 18:52:18 +0000 (20:52 +0200)]
Useless.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 11 Oct 2008 18:50:38 +0000 (20:50 +0200)]
Port strlist to use async DNS.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 11 Oct 2008 16:13:06 +0000 (18:13 +0200)]
Many fixes.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 11 Oct 2008 15:20:54 +0000 (17:20 +0200)]
Asynchronous DNS queries on iplist.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 10 Oct 2008 22:07:20 +0000 (00:07 +0200)]
Basic support for async filters.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 8 Oct 2008 20:30:15 +0000 (22:30 +0200)]
Allow user-defined fd in events.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 8 Oct 2008 06:34:01 +0000 (08:34 +0200)]
Let say an event is just a pointer.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 7 Oct 2008 20:54:31 +0000 (22:54 +0200)]
More explicit type for events && cleanup event_cancel.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 7 Oct 2008 20:50:04 +0000 (22:50 +0200)]
Add event to interrupt the server_loop.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Pierre Habouzit [Tue, 7 Oct 2008 08:46:35 +0000 (10:46 +0200)]
Force the final dot, even if not provided in the configuration for RBLs.
Note: the len - 2 and len - 1 are safe because each format will always
write more than 2 chars in the buffer.
We also check for overflow at the same time.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Florent Bruneau [Tue, 7 Oct 2008 08:32:05 +0000 (10:32 +0200)]
Reduce verbosity.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 6 Oct 2008 22:18:07 +0000 (00:18 +0200)]
Update installation.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 6 Oct 2008 22:12:39 +0000 (00:12 +0200)]
Configuration sample for postlicyd-rsyncrbl.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 6 Oct 2008 22:05:04 +0000 (00:05 +0200)]
Add a rbl rsync script.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 6 Oct 2008 20:27:15 +0000 (22:27 +0200)]
Logging for pfix-srsd too.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 6 Oct 2008 20:24:54 +0000 (22:24 +0200)]
Improve logging again.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Pierre Habouzit [Mon, 6 Oct 2008 13:24:43 +0000 (15:24 +0200)]
we need a bit more time to have accurate stats
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Pierre Habouzit [Mon, 6 Oct 2008 09:38:59 +0000 (11:38 +0200)]
Add likely/unlikely macros.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Pierre Habouzit [Mon, 6 Oct 2008 09:33:01 +0000 (11:33 +0200)]
Use gettimeofday for finer tests.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Pierre Habouzit [Mon, 6 Oct 2008 08:46:31 +0000 (10:46 +0200)]
64bits fixes.
On 64bits platforms, ssize_t is an int64_t.
Given the average string length pfixtools will handle, a 32bits integer is
enough, let's use int everywhere.
Also a pointer difference is an ptrdiff_t which is also a 64bits integer, so
when used as the width specifier of a %.*s format, it must be cast into an
int.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Florent Bruneau [Sun, 5 Oct 2008 21:33:56 +0000 (23:33 +0200)]
Don't reconfig after each query after a manual reload.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 5 Oct 2008 20:04:21 +0000 (22:04 +0200)]
Performance tests of TCBDB.
Random insertion is not very fast, but enumeration is. Maintenance may run
withing 15 seconds.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 5 Oct 2008 18:55:09 +0000 (20:55 +0200)]
Speed-up lookup.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 5 Oct 2008 16:28:54 +0000 (18:28 +0200)]
Oops.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 5 Oct 2008 16:13:44 +0000 (18:13 +0200)]
Merge branch 'with-dns-bl'
Florent Bruneau [Sun, 5 Oct 2008 16:12:44 +0000 (18:12 +0200)]
Fix crash in conf, improves debug logging for rbl.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 5 Oct 2008 15:26:38 +0000 (17:26 +0200)]
Add DNS support for strlist filters (i.e. rhbl).
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 5 Oct 2008 13:40:21 +0000 (15:40 +0200)]
Can disable syslog logging on tests.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 5 Oct 2008 13:22:54 +0000 (15:22 +0200)]
Merge branch 'master' into with-dns-bl
Conflicts:
postlicyd/iplist.c
postlicyd/tst-rbl.c
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 5 Oct 2008 12:48:34 +0000 (14:48 +0200)]
Add rbldns parameter to iplist as an alias for 'file'.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 5 Oct 2008 12:44:46 +0000 (14:44 +0200)]
Add basic support for rbldnsd zone files.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Aymeric Augustin [Sun, 5 Oct 2008 09:09:51 +0000 (11:09 +0200)]
Rename to match convention in the tools directory
Aymeric Augustin [Sun, 5 Oct 2008 09:09:50 +0000 (11:09 +0200)]
Add a script to convert the postgrey_whitelist_clients file
Florent Bruneau [Sun, 5 Oct 2008 09:00:13 +0000 (11:00 +0200)]
Fix stats of tests.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 21:00:59 +0000 (23:00 +0200)]
Improves test and cleanup.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 20:57:59 +0000 (22:57 +0200)]
Add a tool to convert rhbl databases (rbldns format) to postlicyd databases.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 20:56:20 +0000 (22:56 +0200)]
Speedup (x4) lookup in large rbl database.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 20:19:53 +0000 (22:19 +0200)]
Fix compilation of tst-rbl.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 16:05:03 +0000 (18:05 +0200)]
Better fix for pidfile.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 15:59:53 +0000 (17:59 +0200)]
Fix startup sequence.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 14:16:14 +0000 (16:16 +0200)]
Merge branch 'master' into with-dns-bl
Florent Bruneau [Sat, 4 Oct 2008 14:15:53 +0000 (16:15 +0200)]
Oops, I forgot to ship those files.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 14:14:13 +0000 (16:14 +0200)]
Add support for rbl by dns resolution.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 13:23:09 +0000 (15:23 +0200)]
Merge branch 'master' into with-dns-bl
Florent Bruneau [Sat, 4 Oct 2008 13:08:01 +0000 (15:08 +0200)]
Support for sender_domain and recipient_domain in match filter.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 13:04:42 +0000 (15:04 +0200)]
Add hostname match on recipient_domain and sender_domain.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 10:39:46 +0000 (12:39 +0200)]
Add query->(recipient|sender)_domain
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 10:22:51 +0000 (12:22 +0200)]
Cleverer hard_match detection.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 07:39:24 +0000 (09:39 +0200)]
This is useless.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 07:36:42 +0000 (09:36 +0200)]
Ensure config is properly unloaded.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 4 Oct 2008 07:32:30 +0000 (09:32 +0200)]
Cleanup logging.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 3 Oct 2008 20:31:33 +0000 (22:31 +0200)]
Log filter result.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 3 Oct 2008 20:18:16 +0000 (22:18 +0200)]
Add prefix and suffix matching for strlist filter.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 2 Oct 2008 21:32:26 +0000 (23:32 +0200)]
Cleanup daemon startup.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 2 Oct 2008 20:00:58 +0000 (22:00 +0200)]
Add corrupted database detection, improves logging.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 2 Oct 2008 19:46:55 +0000 (21:46 +0200)]
Typo.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 2 Oct 2008 19:42:11 +0000 (21:42 +0200)]
Fix a valgrind warning in unit test runner.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 2 Oct 2008 06:35:23 +0000 (08:35 +0200)]
Better init.d script.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 1 Oct 2008 21:31:38 +0000 (23:31 +0200)]
Example of init script.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 1 Oct 2008 21:23:50 +0000 (23:23 +0200)]
Fix cleanup. Improve logging.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 1 Oct 2008 21:09:26 +0000 (23:09 +0200)]
Implements greylist database cleanup.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 1 Oct 2008 18:35:42 +0000 (20:35 +0200)]
Add doc about the new max_age parameter of the greylister.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 1 Oct 2008 18:30:08 +0000 (20:30 +0200)]
Add a test of the cleanup.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 1 Oct 2008 06:44:03 +0000 (08:44 +0200)]
Add entry deprecation in greylist.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 1 Oct 2008 06:25:05 +0000 (08:25 +0200)]
Add test for retry out of the retry_window.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 30 Sep 2008 22:16:59 +0000 (00:16 +0200)]
Add greylist tests.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 29 Sep 2008 21:23:49 +0000 (23:23 +0200)]
More tests.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 29 Sep 2008 21:10:27 +0000 (23:10 +0200)]
More testcases.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 29 Sep 2008 20:51:07 +0000 (22:51 +0200)]
Add a second testcase.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 29 Sep 2008 20:25:06 +0000 (22:25 +0200)]
Add test data.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 28 Sep 2008 20:01:20 +0000 (22:01 +0200)]
Start adding tests for the filters.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 28 Sep 2008 13:14:29 +0000 (15:14 +0200)]
Add filter_test and move query parser in its own file.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 28 Sep 2008 10:10:56 +0000 (12:10 +0200)]
Minor fix.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 28 Sep 2008 09:58:58 +0000 (11:58 +0200)]
Just a few helpers.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 28 Sep 2008 09:34:38 +0000 (11:34 +0200)]
mprotect locked arrays.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 24 Sep 2008 19:44:31 +0000 (21:44 +0200)]
Not so bad.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 24 Sep 2008 19:42:47 +0000 (21:42 +0200)]
Add the new filter type in configuration example.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 24 Sep 2008 19:31:50 +0000 (21:31 +0200)]
Fixes.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 24 Sep 2008 06:52:27 +0000 (08:52 +0200)]
Use str.h functions for case insensitive comparisons.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 24 Sep 2008 06:47:05 +0000 (08:47 +0200)]
Implements filtering.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 23 Sep 2008 21:00:13 +0000 (23:00 +0200)]
Starts a "match" filter that compares a field of the query with a given value.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 22 Sep 2008 20:36:25 +0000 (22:36 +0200)]
Save 4bytes per entry of the trie.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 19 Sep 2008 15:34:01 +0000 (17:34 +0200)]
Reorder conf.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 19 Sep 2008 15:30:44 +0000 (17:30 +0200)]
Add server port in the example.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 19 Sep 2008 15:28:03 +0000 (17:28 +0200)]
Read the port from the configuration file.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 18 Sep 2008 20:57:52 +0000 (22:57 +0200)]
Simplify code.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 18 Sep 2008 20:17:45 +0000 (22:17 +0200)]
Configuration reloader for postlicyd.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 18 Sep 2008 16:15:37 +0000 (18:15 +0200)]
Add hook to refresh config on SIGHUP.
Lock the pid file.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 17 Sep 2008 21:30:54 +0000 (23:30 +0200)]
Array contains a "lock" flag, allowing "per array" locking.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 17 Sep 2008 20:19:53 +0000 (22:19 +0200)]
Some improvements to the trie:
- add trie_prefix to check if the trie contains a prefix for a string.
- add comments
- lock the trie_t structure, not only its content.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 17 Sep 2008 18:21:39 +0000 (20:21 +0200)]
Oops.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 17 Sep 2008 17:27:49 +0000 (19:27 +0200)]
Fix loop detection (we're on oriented graph).
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 17 Sep 2008 15:51:11 +0000 (17:51 +0200)]
Remove debug.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 17 Sep 2008 14:43:08 +0000 (16:43 +0200)]
Declare Array(void*).
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 17 Sep 2008 14:38:06 +0000 (16:38 +0200)]
Store param value length. Fix off-by-one.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 17 Sep 2008 10:18:04 +0000 (12:18 +0200)]
Check configuration for internal loops.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>