Commit Graph

56 Commits

Author SHA1 Message Date
Jared Johnson
84aa8e2328 Die when an invalid dir is specified manually 2015-03-09 17:17:26 -05:00
Jared Johnson
4106da56d1 Don't leave DB locked after pruning an empty DB 2015-03-05 18:34:13 -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
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
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
5a58e02e80 Scarier error message for redis failures 2015-01-23 15:23:18 -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
8c1c5c851d Remove unnecessary calls to cleanup_and_return()
prune_db() and migrate_db() already call unlock(), calling
cleanup_and_return() only added a second (redundant) call to unlock()
2015-01-21 17:31:47 -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
16126bd941 Less 'and' 2014-12-22 17:00:29 -06:00
Jared Johnson
bf8dc171a3 Don't disable greylist in absence of p0f argument 2014-12-22 16:09:41 -06:00
Jared Johnson
4de1d388b9 Silence a warning in plugins/greylisting 2014-12-05 11:31:59 -06:00
Jared Johnson
ef26c61b6d Use Qpsmtpd::DB in karma plugin
And clean up a few things in Qpsmtpd::DB
2014-11-26 16:28:52 -06:00
Jared Johnson
72c9c79f31 Move the rest of DBM operations to Qpsmtpd::DB 2014-11-26 16:06:24 -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
a0c8baae8d Add POD section pointing to per-recip db support 2014-11-25 10:42:47 -06:00
Jared Johnson
0c1498d44d Drop documentation too 2014-11-24 18:48:40 -06:00
Jared Johnson
20cbbad9e8 Drop support for per-recipient greylist dbm files
This does not drop support for including the recipient in the greylist key.

Note that this was already broken for an indeterminate (long) amount of time
2014-11-24 18:18:21 -06:00
Jared Johnson
5fe9d80f9b Clarify DBM-specific functions
This changes function names only
2014-11-24 17:09:42 -06:00
Jared Johnson
cf09a662ad New convention for calling Qpsmtpd::Base stuff
I think
2014-11-13 16:29:52 -06:00
Jared Johnson
2655e7b452 Add tests for exclude files 2014-11-06 17:02:27 -06:00
Jared Johnson
7fb80f35ab Fix some broken variable names 2014-11-06 16:23:29 -06:00
Jared Johnson
81b55eb1ac Support postgrey-style greylist exclusion files
Not yet tested
2014-11-06 16:21:10 -06:00
Jared Johnson
289c5b2ca6 Add RFC link 2014-11-03 16:14:51 -06:00
Jared Johnson
e9400cc085 Add missing $self and explicit return 2014-10-28 14:37:56 -05:00
Jared Johnson
179d6427fc Consolidate greylist exclusions into exclude()
This makes for an easily overridden method for excluding hosts from greylisting with custom rules
2014-10-27 17:24:06 -05:00
Matt Simerson
4c314eb642 patch from Carlos Canau <Carlos@Canau.COM> 2014-10-02 15:25:57 -07:00
Jonathan Hall
897a1fd8aa Remove a ton of 'return ()', and a few other minor readability tweaks. 2014-09-17 20:28:51 -05:00
Matt Simerson
ebdb25a4bd extracted config*() from Qpsmtpd.pm -> Config.pm
* includes full test converage for Qpsmtpd::Config
    * folded t/config.t into t/qpsmtpd-config.t
* includes additional tests for Qpsmtpd
    * folded t/tempstuff into t/qpsmtpd.t
* PBP adjustments here and there
* other tweaks to handle test warnings
2014-09-15 23:41:31 -07:00
Matt Simerson
75a3e4baae find plugins -type f -exec perltidy -b {} \; 2013-08-05 15:05:15 -07:00
Matt Simerson
b2a3ef4c34 greylisting: POD correction 2013-08-05 15:01:49 -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
57a0e4ba7b updated plugins to use QP::Plugins::is_immune 2012-06-04 03:26:16 -04: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
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
Ask Bjørn Hansen
a23d4b3da9 Fix 01-syntax test failures
Exclude some tests with dependencies.

Remove -T from perl line in plugins
This makes it harder to test with PERL5LIB/perlbrew etc
2012-04-29 01:36:01 -07:00
Matt Simerson
d8467d784b Made greylisting plugin log a little less by default 2012-04-29 00:44:02 -07:00
Matt Simerson
318c9ed4f2 applied greylisting NFSLock patch
Issue #1 on Google issue tracker. The patch was 'accepted' by Ask in 2007, but never applied.
2012-04-29 00:32:52 -07:00
Matt Simerson
dbaa9dbd6c POD corrections, additional tests, plugin consistency
on files in plugins dir:
  fixed a number of POD errors

  formatted some # comments into POD

  removed bare 1;  (these are plugins, not perl modules)
    most instances of this were copy/pasted from a previous plugin that had it

  removed instances of # vim ts=N ...
    they weren't consistent, many didn't match .perltidyrc

  on modules that failed perl -c tests, added 'use Qpsmtpd::Constants;'

Conflicts:

	plugins/async/check_earlytalker
	plugins/async/dns_whitelist_soft
	plugins/async/dnsbl
	plugins/async/queue/smtp-forward
	plugins/async/require_resolvable_fromhost
	plugins/async/rhsbl
	plugins/async/uribl
	plugins/auth/auth_checkpassword
	plugins/auth/auth_cvm_unix_local
	plugins/auth/auth_flat_file
	plugins/auth/auth_ldap_bind
	plugins/auth/auth_vpopmail
	plugins/auth/auth_vpopmail_sql
	plugins/auth/authdeny
	plugins/check_badmailfromto
	plugins/check_badrcptto_patterns
	plugins/check_bogus_bounce
	plugins/check_earlytalker
	plugins/check_norelay
	plugins/check_spamhelo
	plugins/connection_time
	plugins/dns_whitelist_soft
	plugins/dnsbl
	plugins/domainkeys
	plugins/greylisting
	plugins/hosts_allow
	plugins/http_config
	plugins/logging/adaptive
	plugins/logging/apache
	plugins/logging/connection_id
	plugins/logging/transaction_id
	plugins/logging/warn
	plugins/milter
	plugins/queue/exim-bsmtp
	plugins/queue/maildir
	plugins/queue/postfix-queue
	plugins/queue/smtp-forward
	plugins/quit_fortune
	plugins/random_error
	plugins/rcpt_map
	plugins/rcpt_regexp
	plugins/relay_only
	plugins/require_resolvable_fromhost
	plugins/rhsbl
	plugins/sender_permitted_from
	plugins/spamassassin
	plugins/tls
	plugins/tls_cert
	plugins/uribl
	plugins/virus/aveclient
	plugins/virus/bitdefender
	plugins/virus/clamav
	plugins/virus/clamdscan
	plugins/virus/hbedv
	plugins/virus/kavscanner
	plugins/virus/klez_filter
	plugins/virus/sophie
	plugins/virus/uvscan
2012-04-29 00:00:10 -07:00
Robert
61de599c1b Normalize #! lines on all plugins
find . -type f | xargs -n1 perl -pi.bak -0777 -e '$want = "#!perl -Tw"; s/\A#!.*\n/$want\n/; s/\A([^#])/$want\n\1/s'
2012-04-28 20:41:31 -07:00
Matt Simerson
d0c9b7cbe5 corrected email address 2010-07-25 22:31:19 -07:00
Matt Simerson
671a6953b0 add TCPLOCAL* variables to $qp->connection
(patch remade against latest rspier/qpsmtpd)

added remote_port, local_ip, local_port, and local_host to $qp->connection, as the p0f plugin relies on it.
added notes to TcpServer.pm and the p0f plugin noting the dependence, and the lack of support for models other than tcpserver.

Signed-off-by: Robert <rspier@pobox.com>
2010-05-11 21:15:57 -07:00
Ask Bjørn Hansen
4d27319233 fix "Use of uninitialized value in pattern match" warning (Gavin Carr
and Jim Murray)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@846 958fd67b-6ff1-0310-b445-bb7760255be9
2008-02-13 08:34:18 +00:00
Ask Bjørn Hansen
5c9e3d6004 greylisting: fix db_dir configuration option so it actually works
(kitno455, issue #6)

  http://code.google.com/p/smtpd/issues/detail?id=6



git-svn-id: https://svn.perl.org/qpsmtpd/trunk@724 958fd67b-6ff1-0310-b445-bb7760255be9
2007-03-15 06:51:37 +00:00
Ask Bjørn Hansen
cc00c1d9ff rename %ARGS to %PERMITTED_ARGS
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@723 958fd67b-6ff1-0310-b445-bb7760255be9
2007-03-15 06:49:23 +00:00