Commit Graph

2286 Commits

Author SHA1 Message Date
Jared Johnson
a053ac7a32 Merge pull request #217 from msimerson/log-file
make sure $transaction->notes is blessed before
2015-01-29 15:32:41 -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
0d79c1ef8e Merge pull request #215 from msimerson/qmd
delete qmail-deliverable BEGIN block
2015-01-29 05:39:15 -06:00
Jared Johnson
a17b44de25 Merge pull request #214 from msimerson/summarize
log/summarize: ignore init msg from logging/*
2015-01-29 05:37:55 -06:00
Jared Johnson
194cde52af Merge pull request #213 from msimerson/geoip-debug
geoip: change a couple INFO -> DEBUG
2015-01-29 05:37:12 -06:00
Matt Simerson
fddf571988 Merge pull request #216 from msimerson/tcpserver2
Tcpserver2
2015-01-29 00:23:07 -08:00
Matt Simerson
cad4f2b1d6 TcpServer: don't 'use parent Qpsmtpd::Base'
it breaks stuff. Instead, grab a base object and use it
2015-01-29 00:15:43 -08:00
Matt Simerson
11ddf03164 disable qmail-deliverable BEGIN block
because FindBin has some undesirable global effects
2015-01-29 03:10:56 -05:00
Matt Simerson
98d148a0bf refactor start_connection 2015-01-29 00:04:13 -08:00
Matt Simerson
d7dd17085e log/summarize: ignore init msg from logging/* 2015-01-28 22:54:32 -08:00
Matt Simerson
bc4e7e61a5 geoip: change a couple INFO -> DEBUG 2015-01-28 22:10:06 -08:00
Matt Simerson
d81b2d4331 Merge pull request #147 from msimerson/tcpserver
update tcpenv and lrpip calls to use -> syntax
2015-01-28 20:08:53 -08:00
Matt Simerson
be9f4aef0c update tcpenv and lrpip calls to use -> syntax
don't load plugins twice.

Not exactly sure where that feature crept in some time ago. It was suppressed by checking to see if a queue plugin was already registered, and then bailing out on subsequent register_hook runs. I noticed it in testing, b/c I didn't have a queue plugin loaded. This removes the duplicate calls to register_hook.

* adds caching of the AUTH methods. You can't add new plugins or register new
  hooks w/o restarting QP, so cache the list and avoid having to generate it on every connection.

* other PBP changes (early exits, less indention, fewer unnecessary parens, etc.)
2015-01-28 19:58:58 -08:00
Matt Simerson
575c0b09e3 Merge pull request #209 from jaredj/notight
No tight square brackets or curly braces
2015-01-28 19:57:27 -08:00
Matt Simerson
04914bf4c9 Merge pull request #212 from salvis/dkim-doc-tweak
plugins/dkim doc tweak
2015-01-28 19:45:46 -08:00
Hans Salvisberg
c1e3652beb Tweak plugins/dkim doc to clarify the d= issue and add a third email reflector. 2015-01-29 02:05:28 +01:00
Matt Simerson
17d0c42d58 Merge pull request #211 from jaredj/test-register-hook
Tests for Qpsmtpd::Plugin::register_hook()
2015-01-28 15:57:18 -08:00
Jared Johnson
f5b58d08e8 Merge pull request #210 from smtpd/dns
use perl DNS methods instead of shell cmds
2015-01-28 17:33:20 -06:00
Jared Johnson
3b0d60545d Tests for Qpsmtpd::Plugin::register_hook() 2015-01-28 17:23:21 -06:00
Matt Simerson
31dbe00514 use perl DNS methods instead of shell cmds 2015-01-28 10:23:03 -08:00
Jared Johnson
88818c1cc9 No tight square brackets or curly braces
> Likewise, the parameter -sbt=n or --square-bracket-tightness=n controls the
> space within square brackets, as illustrated below.
>
>  $width = $col[ $j + $k ] - $col[ $j ];  # -sbt=0
>  $width = $col[ $j + $k ] - $col[$j];    # -sbt=1 (default)
>  $width = $col[$j + $k] - $col[$j];      # -sbt=2
> Curly braces which do not contain code blocks are controlled by the
> parameter -bt=n or --brace-tightness=n.
>
>  $obj->{ $parsed_sql->{ 'table' }[0] };    # -bt=0
>  $obj->{ $parsed_sql->{'table'}[0] };      # -bt=1 (default)
>  $obj->{$parsed_sql->{'table'}[0]};        # -bt=2

As with PR #201, I can't find any previous concensus on introducing this
and for myself, I prefer the default.

FTR I can't find anything else in .perltidyrc that I have any bones with :)
2015-01-27 19:35:55 -06:00
Matt Simerson
45bc5cfffc Merge pull request #207 from jaredj/zap-db-file
Get rid of Qpsmtpd::DB::File
2015-01-27 13:57:17 -08: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
Matt Simerson
ce97a0eb41 Merge pull request #206 from jaredj/t-tmp
Better handling of testing temp files
2015-01-27 12:43:46 -08: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
Matt Simerson
cfce4e44d0 Merge pull request #201 from jaredj/default-parens
Don't enforce tight parens with perltidy
2015-01-27 10:30:10 -08:00
Matt Simerson
343a7ee686 Merge pull request #204 from jaredj/faster-prune
Speed up greylisting prune_db() for Redis
2015-01-27 10:29:59 -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
Matt Simerson
3ed568f9d4 Merge pull request #202 from jaredj/greylist-storage-opts
Make Redis optional
2015-01-23 14:22:21 -08: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
0095e11158 Don't enforce tight parens with perltidy
Revert to default of -pt=1 rather than -pt=2:

> -bt,-pt,-sbt: Container tightness
> These are parameters for controlling the amount of space within containing
> parentheses, braces, and square brackets. The example below shows the effect
> of the three possible values, 0, 1, and 2, for the case of parentheses:
>
>  if ( ( my $len_tab = length( $tabstr ) ) > 0 ) {  # -pt=0
>  if ( ( my $len_tab = length($tabstr) ) > 0 ) {    # -pt=1 (default)
>  if ((my $len_tab = length($tabstr)) > 0) {        # -pt=2
> A value of 0 causes all parens to be padded on the inside with a space, and
> a value of 2 causes this never to happen. With a value of 1, spaces will be
> introduced if the item within is more than a single token.

The tight parens decision was made in 2005 when .perltidyrc was introduced:

2535e77293

I tried pretty hard but couldn't find any previous discussion about this
decision, I'm not quite sure who supported it, who cared about it at all,
or who knew about it at all.

What I know is that I like pt=1 better. Nobody ever gets what they want
if they don't ask :)
2015-01-22 23:53:25 -06:00
Matt Simerson
012866ef97 Merge pull request #200 from jaredj/greylist-test-cruft
Remove unused sub from greylist tests
2015-01-22 21:47:51 -08: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
Matt Simerson
846c77ee94 Merge pull request #198 from jaredj/less-cleanup-and-return
Remove unnecessary calls to cleanup_and_return()
2015-01-21 15:45:32 -08: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
Matt Simerson
b97508b217 Merge pull request #197 from jaredj/dbm-so-crazy
Fix DBM set() problem and add Qpsmtpd::DB::File::DBM tests
2015-01-21 14:56:11 -08: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
376498f2e8 Merge pull request #190 from msimerson/use-lib
remove instances of: use lib 'lib' in lib/ and
2015-01-21 10:06:07 -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
Matt Simerson
5fff5105f8 Merge pull request #195 from jaredj/missing-geoip-data
Handle missing GeoIP data gracefully
2015-01-21 09:45:44 -08:00
salvis
de08a11e04 Merge pull request #1 from smtpd/master
Update from original.
2015-01-19 23:06:46 +01:00
Jared Johnson
9450c21c06 Perltidy 2015-01-14 16:17:04 -06:00
Jared Johnson
029db84771 Remove some postfix 'if' 2015-01-14 16:05:42 -06:00