Commit Graph

25 Commits

Author SHA1 Message Date
Jared Johnson
88c55ed9a3 Emit detailed warning on unuseable default db dirs 2015-03-09 17:17:26 -05:00
Jared Johnson
e98e1c2e82 Regression test for prune_db locking problem 2015-03-05 18:34:59 -06:00
Jared Johnson
15a297372d Default to one-second connect timeout for Redis 2015-02-23 14:32:42 -06:00
Jared Johnson
51ca3fcda4 Skip greylisting when we can't talk to greylist DB 2015-02-23 11:25:36 -06:00
Jared Johnson
4c9bcc0ee4 Configure but don't connect to DB in init_db()
This allows us to start up QP even if e.g. Redis is down
2015-02-23 11:25:18 -06:00
Jared Johnson
3bf1a7f48c Better handling of testing temp files
Rather than creating and ignoring a bunch of random files, create files in
t/tmp, ignored in .gitignore and cleaned up with 'make clean'
2015-01-27 14:41:15 -06:00
Jared Johnson
0dcafcffb6 Add testing for prune_db() in plugins/greylisting 2015-01-27 10:45:10 -06:00
Jared Johnson
462a2ae367 Rename 'redis_server' arg to 'redis' 2015-01-23 15:15:04 -06:00
Jared Johnson
4f9af75e48 Make Redis optional
Previously the greylist plugin tried to use redis and fell back to DBM. This means that if a system already had an established DBM database, but happened to have Redis running, the existing DBM db would be abandoned for a new Redis DB. This would inevitably lead to more delays for legitimate mail, and possibly lost mail.

This adds a 'redis_server' argument which enables Redis and sets the location of the redis server; if it is not explicitly set, DBM is used instead.

If the redis server is unavailable, rather than failing to start QP, we instead fail to register the plugin.
2015-01-23 14:24:23 -06:00
Jared Johnson
63de50c808 Remove unused sub from greylist tests
Not sure how long ago this fell out of use and neither is the author
2015-01-22 23:44:52 -06:00
Jared Johnson
11646b9a27 Add Qpsmtpd::DB testing and more greylist testing 2014-12-30 14:53:53 -06:00
Jared Johnson
eb0ff1fe98 Get rid of grey_timeout and 'white' clients
These are noops:  clients that retry before grey_timeout is exceeded and
clients that retry after grey_timeout is exceeded all pass greylisting until
expired by white_timeout.
2014-12-28 21:27:03 -06:00
Jared Johnson
c01cdffb08 Add testing for greylist() 2014-12-28 21:26:49 -06:00
Jared Johnson
bf8dc171a3 Don't disable greylist in absence of p0f argument 2014-12-22 16:09:41 -06:00
Jared Johnson
1d29db66ff Move some DBM functions to Qpsmptd::DB::File::DBM
Not everything is moved and Qpsmtpd::DB* does not yet have test coverage
2014-11-25 17:52:18 -06:00
Jared Johnson
5fe9d80f9b Clarify DBM-specific functions
This changes function names only
2014-11-24 17:09:42 -06:00
Jared Johnson
3ffee33d33 Remove extraneous semicolons
They confuse my editor
2014-11-11 16:59:40 -06:00
Jared Johnson
2655e7b452 Add tests for exclude files 2014-11-06 17:02:27 -06:00
Jared Johnson
b5d6c2e4c8 Add tests 2014-10-28 14:38:15 -05:00
Matt Simerson
a5420149bd remove test counters from plugin tests
replace with done_testing(), which provides the same "make sure to kvetch if tests fail to run" without requiring humans to do the bookkeeping.
2014-09-17 00:11:32 -07:00
Matt Simerson
7ff2d050f3 initial import - based on my qpsmtpd fork
which will merge into the main branch fairly easily
2013-08-05 15:01:47 -07:00
Matt Simerson
0a16621f02 connection consistency
-  $self->qp->connection->notes
+  $self->connection->notes

and all tests pass.
2012-06-02 00:46:33 -04:00
Matt Simerson
915b9830dc greylisting: reset transaction for immunity tests 2012-05-20 23:35:59 -07:00
Matt Simerson
6b9881c32e greylisting, refactored and many changes
fixed the vestiges of old plugin name 'denysoft_greylisting'

added ability to bypass greylisting based on geoip

deprecated 'mode [denysoft | testonly | off]
	off wasn't useful
	testonly & denysoft replaced by reject [ 0 | 1 ]

renamed DB from denysoft_greylist to greylist.dbm. Will use existing/legacy DB if present.

added DB pruning feature. Automatically prune the DB when qpsmtpd registers the plugin. Perhaps this should be a config option to enable?

added DB upgrade feature. Convert dotted quad IP addresses in DB to integers. Makes greylisting IPv6 compatible, since DB records are colon delimited.

exempt TLS connections from greylisting. The vast majority (perhaps all) of the SMTP clients that request encryption to my server are legit. We could add a config option for this, but this plugin already has a multitude of config options.

refactored much of the greylisting method into discreet subs

added 30 tests

added additional DEBUG level logging for p0f matches

POD changes:
	replaced over, item N, back, with head2 (better formatted output)
	better describe the current behavior of the plugin (some past behaviors no longer exist)
	added TRIPLET section with example
	added loglevel section
2012-05-20 23:35:46 -07:00
Matt Simerson
b81d464c87 added p0f support to greylist plugin
- these changes are in the previous TCPLOCAL patch. Documented here.
added p0f config option
added POD docs to explain usage
modified $dbdir selection logic. The previous logic failed when QPHOME was
 not selected (as is the case when tests are being run).
Added '.' as the dir of last resort for $dbdir selection (others $EMPTY/dir
 dumped greylisting database in / )

  - These changes are included in this patch -
Added t/plugin_tests/greylisting, with greylist logic testing (tests are
 disabled by default, as greylisting is disabled in config.sample/plugins)
Added example entry in config.sample/plugins

Signed-off-by: Robert <rspier@pobox.com>
2010-05-11 21:19:52 -07:00