Matt Simerson
b289d38f53
more cleanups
2014-09-17 22:22:44 -07:00
Matt Simerson
c55fa030f8
Address: remove useless undef
...
and added tests to validate that they really are useless
2014-09-17 22:22:44 -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
ba1a6a1885
remove YIELD cruft introduced by rebase
2014-09-17 13:09:47 -07:00
Matt Simerson
519bb12503
simplify config->from_file by not requiring full
...
file path. Instead, figure it out the same way as the 4 of the 5 caller do (by calling config_dir). Allow the 2nd arg to be the file name.
2014-09-17 13:03:46 -07:00
Matt Simerson
1e5d249224
added tests for run_hooks & run_hooks_no_respond
2014-09-17 13:03:46 -07:00
Matt Simerson
9a38850f13
added test for run_continuation
2014-09-17 13:03:46 -07:00
Matt Simerson
0499317912
Qpsmtpd: style changes in hook_responder
2014-09-17 13:02:44 -07:00
Matt Simerson
9cd8b165a0
qpsmtpd.t: added tests for hook_responder
2014-09-17 13:01:29 -07:00
Matt Simerson
1e82ae1bc7
async removed
...
1. the known users of async don't upgrade
2. async becomes a win when concurrent connections exceed a few hundred simultaneous
3. anyone that needs async should be looking at Haraka instead
4. the perl async dependencies aren't maintained
2014-09-17 11:38:40 -07:00
flimzy
9fdb6b17d6
Merge pull request #107 from msimerson/version
...
add --tags to 'git describe'
2014-09-17 06:36:39 -05:00
flimzy
3ef0188f72
Merge pull request #111 from msimerson/pod
...
POD fixups
2014-09-17 06:28:36 -05:00
Matt Simerson
1ebe5ea6ec
put git version detection code into a sub
2014-09-17 00:08:33 -07:00
Matt Simerson
4a48c4584d
add --tags to 'git describe'
...
'git describe' calculates the version since the last **annotated** diff. Adding --tags shows the most recent tags (v0.94, for example) regardless if they're annotated or not.
2014-09-16 23:58:49 -07:00
Matt Simerson
5155e5c32f
POD fixups
2014-09-16 23:27:19 -07:00
Jared Johnson
d029c89113
Merge pull request #108 from msimerson/hooks
...
Q::hooks(), accept a hook name argument
2014-09-16 23:38:21 -05:00
Matt Simerson
d5481df3dd
Q::hooks(), accept a hook name argument
...
and return a useful result
2014-09-16 21:22:36 -07:00
Matt Simerson
7230de2ddc
SMTP: don't create new Transaction at disconnect
...
the current result of passing a DENY* response is a new transaction. That seems wrong.
2014-09-16 17:56:58 -07:00
Jared Johnson
58dc68b190
Demote warning to LOGDEBUG
...
it's not really very interesting when a map file doesn't exist for an optional config parameter
2014-09-16 15:12:42 -05:00
Matt Simerson
a473c2732d
updated Config::defaults() to behave as before
...
and added additional tests for it
2014-09-16 09:52:05 -07:00
Matt Simerson
b0c3d715cc
moved config() from Qpsmtpd -> Q::Config.pm
2014-09-16 09:26:55 -07:00
Jonathan Hall
48bd0f3e0c
Kill some tab characters; and adopt PBP-suggested formatting for :? operator.
2014-09-16 07:11:54 -05:00
Matt Simerson
b153c0ab99
more tests for Qpsmtpd::Config
...
* fix for cache clearing that didn't work
* imported a sample .cdb file for testing
2014-09-16 00:54:47 -07: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
79d2b99211
Qpsmtpd: remove PLUGIN_DIR label, replace implicit
...
if statements with chained 'and' with if block (2x)
2014-09-15 19:00:07 -07:00
Matt Simerson
f8e2fdb966
more tests for Qpsmtpd.pm
2014-09-15 18:54:10 -07:00
Matt Simerson
710894cd49
moved Qpsmtpd::Utils -> Base.pm
2014-09-15 18:53:30 -07:00
Matt Simerson
7ca511d8a3
move extra $rc test into block
...
where it could have been set
2014-09-15 16:01:57 -07:00
Matt Simerson
851e1b54ee
META updates, tidy, PBP tweaks
...
* update manifest
* perltidy
* replace postfix if/unless with brackets
* reduce useless indention by exiting sooner
2014-09-15 15:57:12 -07:00
Jared Johnson
c6da8610dc
Fix crasher
...
Add missing 'use' and use get/set method for cleaner storage of QP object
2014-09-15 17:06:48 -05:00
Jared Johnson
e9c56dc268
Avoid passing Qpsmtpd object refs around
...
Use an instantiator in Qpsmtpd.pm for creating Qpsmtpd::Address objects instead
2014-09-15 17:06:48 -05:00
Jonathan Hall
6ed109914c
POD updates, corrections, and clarifications.
2014-09-15 17:06:48 -05:00
Jared Johnson
2caa191334
Avoid warnings on undef hook_config returns values
2014-09-15 17:06:48 -05:00
Jared Johnson
18bfc45d0b
Fall back correctly between config methods
...
hook_user_config no falls back to global hook_config followed by
file-based config followed by %defaults
2014-09-15 17:01:39 -05:00
Jared Johnson
5b8138971a
Don't use config cache for hook_config plugins
...
Conflig plugins can do their own caching: there's no telling what might change
their return values over the life of the config cache.
2014-09-15 17:01:39 -05:00
Jared Johnson
b22d037c39
Add hook_user_config
...
This adds a hook_user_config for plugins designed to return per-user
configuration directives. Qpsmtpd::Address::config() triggers a
hook_user_config plugin.
2014-09-15 16:53:09 -05:00
Matt Simerson
7396dbbf5f
more tests for Qpsmtpd.pm
2014-09-15 11:53:28 -07:00
Matt Simerson
ca96ddf4eb
added Utils->is_valid_ip, IPv6 ready
...
resolves Issue #82
2014-09-11 13:34:32 -07:00
Matt Simerson
fabbdae960
tests for Qpsmtpd/SMTP
...
* order the ‘use’ pragmas
* compact the new() method
* move fault() tests into t/qpsmtpd-smtp.t
2014-09-11 10:46:29 -07:00
Jonathan Hall
8b1ff67604
Update fault()'s output to inidcate the possibly meaninglessness of the reported system error.
2014-09-11 11:58:31 -05:00
Matt Simerson
60877da4ed
added Utils::is_localhost and t/qpsmtpd-utils.t
...
resolves Issue #89
2014-09-10 13:52:56 -07:00
Matt Simerson
197be1515c
remove empty DESTROY()
2014-09-10 11:04:34 -07:00
Matt Simerson
625905a193
remove DashProfiler
...
was commented out. In the future, profiler code should be kept in it's own branch, and then merged against smtpd/master when being used.
2014-09-10 11:04:34 -07:00
Matt Simerson
e8d5229801
Merge pull request #73 from smtpd/qpsmtpd.t
...
added tests for lib/Qpsmtpd.pm (Issue #67 )
2014-09-10 10:53:54 -07:00
Jonathan Hall
6622c01e8e
Fix pf2qp.pl magic.
2014-09-09 14:38:22 -05:00
Matt Simerson
c9a780576f
added tests for lib/Qpsmtpd.pm (Issue #67 )
2014-09-08 22:58:27 -07:00
Matt Simerson
c02c9c2358
Merge pull request #50 from priyadi/received_line_fix
...
Add our headers (Received & Authentication-Results) earlier, just after DATA
2014-06-03 21:42:48 -07:00
Priyadi Iman Nurcahyo
c4452a5856
Add our headers (Received & Authentication-Results) earlier, just after DATA
2014-06-04 03:59:52 +00:00
Dongsik Park
27a0557982
config parameter passing bug fix.
2014-05-21 10:18:19 +09:00
Matt Simerson
fd4cc6f8ab
Qpsmtpd: version bump to 0.94
2013-12-18 00:11:16 -05:00
Matt Simerson
2416d1e940
Plugin.pm: made is_naughty is now a getter too
2013-12-17 23:43:26 -05:00
Matt Simerson
a26d46ed87
move Auth-Results header to Original-Auth-Results
...
this was in a sub, commented out as a TODO to delete them. Instead of deleting, move the Authentication-Results header on incoming messages to the Original-A-R.
2013-12-17 14:16:34 -08:00
Matt Simerson
b085388cda
TcpServer: optimize DNS lookups for PTR
...
a. don't use search path (/etc/resolv.conf)
b. explicitely specify PTR in query request
2013-12-01 03:45:12 -05:00
Matt Simerson
4a61ef1ad9
define positioning of Authentication-Results header
2013-08-05 15:05:38 -07:00
Matt Simerson
4d489ea6ef
tested and working Authentication-Results
...
changed the method of saving results. Instead of appending to/from a header, plugins save results to a connection note.
Qpsmtpd::SMTP.pm has a new method that inserts the Authentication-Results header
The smtp-auth information has been removed from the Received header
Authentication-Results providing plugins have been updated to store results in connection note
2013-08-05 15:05:38 -07:00
Matt Simerson
4ae16219bd
added Authentication-Results header, with provider
...
dkim, dmarc, fcrdns (iprev), spf, and smtp-auth
2013-08-05 15:05:38 -07:00
Matt Simerson
b126c3c7f8
store envelope from and to in connection notes
2013-08-05 15:05:38 -07:00
Matt Simerson
247c5a2bea
is_naughty is a setter now too
2013-08-05 15:05:38 -07:00
Matt Simerson
3a0900f0ae
SMTP.pm: reduce auth details from Received header.
...
based on patch from Devin Carraway
http://www.nntp.perl.org/group/perl.qpsmtpd/2012/08/msg9954.html
2013-08-05 15:05:38 -07:00
Matt Simerson
82effb409a
Qpsmtpd: untaint config data passed to plugins
...
if QP passes in tainted data, such as a hostname that subsequently gets used to open a connection using IO::Socket, the plugin die because the information is tainted. Fix it once here, instead of in each plugin.
2013-08-05 15:05:37 -07:00
Matt Simerson
4c6f5aedfd
Qpsmtpd.pm: split config args on /\s+/, was / /
2013-08-05 15:05:37 -07:00
Matt Simerson
bbc6e895cc
distinguish rejecting versus tolerated failures
2013-08-05 15:05:36 -07:00
Matt Simerson
dbcc3d40b4
split is_immune into itself + is_naughty
...
is_immune tests designates to plugins they should always skip processing.
That's typical for naughty connections, but this change provides the ability to handly naughty connections differently than (whitelisted/relayclients/known good) senders.
2013-08-05 15:05:36 -07:00
Matt Simerson
c3b8df645c
Plugin: override dns_timeout by passing in a value
2013-08-05 15:05:15 -07:00
Matt Simerson
5b06929e95
find . -name '*.pm' -exec perltidy -b {} \;
2013-08-05 15:05:15 -07:00
Matt Simerson
2f3127359d
moved triplicated init_resolver into Plugin.pm
2013-08-05 15:05:13 -07:00
Matt Simerson
5b74b9c1d3
Q:Plugin.pm: abstracted out store_deferred_reject
2013-08-05 15:05:13 -07:00
Matt Simerson
9ed3843b53
adjust_karma now increments properly
2013-08-05 15:05:11 -07:00
Matt Simerson
266f5d2efc
v0.91 bump for release
2013-08-05 15:05:10 -07:00
Matt Simerson
a5803d10f5
updated more split '' syntax to split //
2013-08-05 15:05:10 -07:00
Matt Simerson
d80b117bff
replace all instances of split '' with split //
...
newer versions of perl don't accept split '' syntax any longer
2013-08-05 15:05:10 -07:00
Matt Simerson
24ad1184ca
SMTP.pm: fixed invalid operator
...
which produced this warning:
Useless use of string eq in void context at lib/Qpsmtpd/SMTP.pm line 639.
2013-08-05 15:05:09 -07:00
Matt Simerson
9a8bc0286c
added missing semicolon
2013-08-05 15:04:51 -07:00
Matt Simerson
01d7c7e228
karma: added adjust_karma method
...
makes it easier to set karma in plugins
2013-08-05 15:04:12 -07:00
Matt Simerson
1bfebd0bfd
TcpServer, improve IPv6 support, by Michael Holzt
2013-08-05 15:02:17 -07:00
Matt Simerson
ce18cf78ae
allow messages with no body: Robin's patch
...
This is Robin's patch from here: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch?view=markup
2013-08-05 15:01:53 -07:00
Matt Simerson
9e665ba2b7
added missing semicolon
2013-08-05 15:01:53 -07:00
Matt Simerson
2fc909b809
karma: added adjust_karma method
...
makes it easier to set karma in plugins
2013-08-05 15:01:52 -07:00
Matt Simerson
7a045474f9
Qpsmtpd.pm: bump version
2013-08-05 15:01:51 -07:00
Matt Simerson
96dd90f808
TcpServer: assign default value during declaration
2013-08-05 15:01:50 -07:00
Matt Simerson
6a7598e3bf
SMTP.pm: test if unrec cmd is set (suppress warning)
...
and decrease log message priority in rcpt_response
2013-08-05 15:01:49 -07:00
Matt Simerson
3b9479a497
Transaction.pm: added debugging messages for DESTROY
2013-08-05 15:01:47 -07:00
Matt Simerson
d5ccedd37e
Plugin.pm: more descriptive variable names
...
append optional log_mess to log entry (more description)
subsequent attempts to set naughty don't overwrite the first
set the naughty rejection type to be the reject type of the plugin that marked the connection naughty
get_reject_type can be passed an explicit default
2013-08-05 15:01:47 -07:00
Matt Simerson
c1df6c2e1f
Qpsmtpd.pm: less default logging at LOGINFO
2013-08-05 15:01:47 -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
041f64a474
renamed reaper -> naughty
2012-06-04 03:34:59 -04:00
Matt Simerson
0d2a9bf887
Plugin.pm: added is_immune
2012-06-04 03:34:48 -04:00
Matt Simerson
0826b86dde
fix typo
2012-06-04 03:34:47 -04:00
Matt Simerson
efbaf2ec6f
added loglevel option for plugins
...
Plugins can now use a 'loglevel' argument in config/plugins entry
Includes user instructions prepended to docs/logging.pod
Already works for all plugins that use named arguments
2012-05-21 05:34:37 -04:00
Matt Simerson
beca1e5e41
Q::Transaction, fix spelling error
...
s/Depreceated/Deprecated/
2012-05-20 23:40:08 -07:00
Matt Simerson
ae3fe2e4d5
cleanups for Auth::validate_password commit
...
one for testing to work again
and one to remove MD5 dependency in Plugin.pm
2012-05-20 23:37:16 -07:00
Matt Simerson
35e1ce9883
consolidate auth logic into Qpsmtpd::Auth
...
These 3 auth plugins all have a data store they fetch the reference
password or hash from. They then match the attemped password or hash
against the reference. This consolidates the latter portion (validating
the password/hash) into Auth.pm.
* less duplicated code in the plugins.
* Pass validation consistently handled for these 3 plugins.
* less work to create new auth plugins
Also caches the CRAM-MD5 ticket. It could also cache user/pass info if
this was desirable.
2012-05-20 23:37:06 -07:00
Matt Simerson
a6e664ce83
Altered SASL method to include the mechanism in log entries.
...
removed auth method from return calls in all auth plugins. The caller knows the mechanism already. In the code, the difference looks like this:
before:
or return (DENY, "authcvm/$method");
after:
or return (DENY, "authcvm");
Added debug level log entries in auth_vpopmaild
Conflicts:
plugins/auth/auth_vpopmail_sql
2012-05-06 16:20:25 -07:00
Matt Simerson
5285774285
refactored Qpsmtpd::Auth::SASL
...
unit tests for new methods are in t/auth.t
added PLAIN and LOGIN tests in auth_flat_file
Most tests are disabled unless an interactive terminal is detected and $ENV{QPSMTPD_DEVELOPER} is set.
2012-05-06 16:17:02 -07:00
Matt Simerson
983dc82203
confine duplicate Auth log entry to LOGDEBUG
2012-05-06 16:12:20 -07:00
Matt Simerson
312d983ff7
Command.pm, promoted strictures to 1st line of code
2012-05-06 16:06:54 -07:00
Matt Simerson
c44db8c9e2
removed TODO, p0f v3 doesn't need that extra info
2012-05-06 16:01:57 -07:00
Matt Simerson
c3626f2123
in log entries, print hook name first
...
so log entries look like this:
86553 (connect) ident::geoip: US, United States
86553 (connect) ident::p0f: Windows 7 or 8
86553 (connect) check_earlytalker: remote host said nothing spontaneous, proceeding
instead of this:
86553 ident::geoip: (connect): US, United States
86553 ident::p0f: (connect) Windows 7 or 8
86553 check_earlytalker: (connect): remote host said nothing spontaneous, proceeding
Conflicts:
plugins/logging/warn
2012-05-06 16:00:58 -07:00
Matt Simerson
6031e49da8
improved readability of default logging logic
2012-05-06 15:59:49 -07:00
Matt Simerson
d80a347afe
SMTP.pm, add missing ; and remove useless if
2012-05-06 15:50:57 -07:00