Commit Graph

291 Commits

Author SHA1 Message Date
Jared Johnson
5f6485e84f Change fake_{config,hook} to mock_{config,hook}
'mock' is more accurate and recognizable
2015-02-12 16:19:44 -06:00
Jared Johnson
95d40297cf Use a fake greeting for testing run_continuation()
This makes the test more universally useful in exercising run_continuation()
itself even with forks that e.g. use custom greetings
2015-02-12 15:53:50 -06:00
Jared Johnson
d2079c455a A little more testing for run_continuation() 2015-02-11 15:07:10 -06:00
Jared Johnson
92d5ff6dc7 Fix test descriptions 2015-02-03 17:11:05 -06:00
Jared Johnson
dcdda3a5e7 Don't interpret invalid return codes as OK 2015-02-03 17:01:52 -06:00
Jared Johnson
f6b952ce8e Comment out broken test exposed by some test fixes 2015-02-03 16:44:06 -06:00
Jared Johnson
b3f8ce6b07 Tests for error logging in run_continuation() 2015-02-03 16:44:06 -06:00
Jared Johnson
7af1f770a5 Fix hook testing order
This exposes a bug with handling invalid return codes
2015-02-03 16:15:16 -06:00
Jared Johnson
e2556a4ee9 Moar testing for Qpsmtpd::run_continuation() 2015-01-30 01:50:54 -06:00
Matt Simerson
d9ac50f383 make sure $transaction->notes is blessed before
calling it as such. It doesn't resolve #199 but it does help there.

I'm not sure initializing Qpsmtpd::transaction as {} is a brilliant idea, but I haven't a better solution for that yet.
2015-01-29 11:25:14 -08:00
Jared Johnson
3b0d60545d Tests for Qpsmtpd::Plugin::register_hook() 2015-01-28 17:23:21 -06:00
Jared Johnson
113becf8be Get rid of Qpsmtpd::DB::File
DBM is probably the only file format we'll ever support anyhow
2015-01-27 15:55:53 -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
Matt Simerson
178c5f6884 Merge pull request #196 from msimerson/dmarc
dmarc: add error handling and tests
2015-01-27 10:30:28 -08:00
Jared Johnson
b6311caae0 Pass multiple keys to del() to speed up prune_db() 2015-01-27 11:50:55 -06:00
Jared Johnson
1320a01f46 Speed up prune_db() with new Qpsmtpd::DB::mget()
This reduces round trips to Redis, speeding up DB pruning,
especially over a network
2015-01-27 10:59:47 -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
e76b6a9048 Fix consistency problems with DBM store
Destroy the AnyDBM-tied hash after untying

Google's wisdom seems to indicate that leaving the AnyDBM-tied hash around after
untying it was causing data to not flush to the DBM file... or something. At any
rate the regression test added here confirms inconsistency when using multiple
instances which is fixed by destroying the AnyDBM-tied hash after untying.
2015-01-21 16:43:23 -06:00
Jared Johnson
e3187ace0d Add tests for Qpsmtpd::DB::File::DBM 2015-01-21 16:32:11 -06:00
Matt Simerson
8185d33fa5 dmarc: add error handling and tests 2015-01-21 10:16:03 -08:00
Matt Simerson
391dfc9309 Merge pull request #189 from msimerson/auth-results
completed DKIM signing detection to A-R header
2015-01-21 10:00:55 -08:00
Jared Johnson
f8e220e3b5 Handle missing GeoIP data gracefully
Previously, the GeoIP plugin would crash on certain missing GeoIP data.
Now it will continue to operate on whatever data it can get at.

Note that it already warns when any data it's looking for is missing.
2015-01-14 15:28:14 -06:00
Matt Simerson
62a063b366 completed DKIM signing detection to A-R header
cleaning function, making it 'safe'

* added test coverage to authentication_results and clean_authentication_results
2015-01-04 14:27:59 -08:00
Matt Simerson
4226dfaa3e fcrdns: document the is_valid_localhost skip
with a logdebug line
2015-01-04 02:48:01 -05:00
Matt Simerson
296219c603 fcrdns: add tests and improved localhost detection 2015-01-04 02:03:09 -05:00
Matt Simerson
4a11e2cb71 Revert "Turn warnings into $qpsmtpd->log() calls" 2015-01-03 21:45:59 -08:00
Jared Johnson
87c6799a1e More complete tests for data_respond() 2014-12-30 17:48:47 -06:00
Jared Johnson
a308e53aa7 Merge pull request #156 from msimerson/smtp
moved SMTP changes into new PR
2014-12-30 16:47:23 -06:00
Jared Johnson
89b942b634 Update expected error text 2014-12-30 14:53:54 -06:00
Jared Johnson
474a086d90 Tests for Qpsmtpd::DB::Redis 2014-12-30 14:53:54 -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
Matt Simerson
d6fabb2b40 added some tests for data_respond 2014-12-26 22:15:05 -08:00
Matt Simerson
e9497d7e51 moved SMTP changes into new PR 2014-12-26 22:15:05 -08:00
Matt Simerson
1f43e30de1 Merge pull request #169 from jaredj/hook-testing
Generalize hook testing
2014-12-24 16:12:24 -08:00
Jared Johnson
a7fee58aad More explicit explanations 2014-12-24 18:06:22 -06:00
Jared Johnson
bf8dc171a3 Don't disable greylist in absence of p0f argument 2014-12-22 16:09:41 -06:00
Jared Johnson
a5f786c986 Take advantage of fake_hook() in existing tests 2014-12-18 14:16:23 -06:00
Jared Johnson
0204fb0f18 Add some comments on uses for fake_{hook,config} 2014-12-18 14:01:32 -06:00
Jared Johnson
7f357af1c2 Move hook testing stuff to Test::Qpsmtpd
This makes it more available to plugins outside of t/plugin_tests/
2014-12-18 13:32:58 -06:00
Jared Johnson
46d26848a9 Generalized method for test hooks 2014-12-18 13:32:57 -06:00
Jared Johnson
7d33c42d35 Less obtrusive addition of test hooks 2014-12-18 13:32:57 -06:00
Jared Johnson
ea937f89dc Warn about lack of ASN data when GeoIP2 is loaded 2014-12-18 13:30:26 -06:00
Jared Johnson
4d59ce8406 Fix unstable use of $1 in Qpsmtpd::warn_level() 2014-12-17 16:11:12 -06:00
Jared Johnson
d3ec361ab8 Turn warnings into $qpsmtpd->log() calls
This can be convenient, especially when one wants to emit a warning that will
show up when running the test suite but still be properly logged in production
2014-12-15 20:07:45 -06:00
Jared Johnson
3d17325ede More readable output for some auth.t tests 2014-12-15 14:19:23 -06:00