Commit Graph

70 Commits

Author SHA1 Message Date
Priyadi Iman Nurcahyo
f8c49b6067 Authentication-Results header fix on data_post 2014-12-23 18:53:13 +00: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
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
971e6ab0e8 perltidy -b lib/Qpsmtpd/Plugin.pm 2014-11-14 15:24:30 -06:00
Jared Johnson
3ffee33d33 Remove extraneous semicolons
They confuse my editor
2014-11-11 16:59:40 -06:00
Matt Simerson
38d5523b35 Base: consistent DNS handling 2014-11-06 11:15:18 -08: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
1e5d249224 added tests for run_hooks & run_hooks_no_respond 2014-09-17 13:03:46 -07:00
Matt Simerson
f8e2fdb966 more tests for Qpsmtpd.pm 2014-09-15 18:54:10 -07: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
2416d1e940 Plugin.pm: made is_naughty is now a getter too 2013-12-17 23:43:26 -05: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
247c5a2bea is_naughty is a setter now too 2013-08-05 15:05:38 -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
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
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
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
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
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
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
Karl Y. Pradene
059771d31d End of headers hook: data_headers_end
Hook after receiving all headers lines. Defaults to nothing,
just continue processing. At this step, sender does not wait for a reply,
but we can stop him from sending remaining data by disconnecting.

(Cleaned up by Robert for english and coding style.)

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Signed-off-by: Robert Spier <robert@perl.org>
2009-02-10 02:49:38 -05:00
Radu Greab
90e60d3d4f Allow plugins to use the post-fork hook.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@877 958fd67b-6ff1-0310-b445-bb7760255be9
2008-05-01 06:11:22 +00:00
Matt Sergeant
214e7e0ec0 More crazy performance stuff
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@845 958fd67b-6ff1-0310-b445-bb7760255be9
2008-02-08 21:26:25 +00:00
Hanno Hecker
2f3a326e11 Pluggable hook "noop" with example plugin (noop_counter) and doc update.
... now check_earlytalker can be expanded to VRFY and NOOP (see RFC 1854, #2.1)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@836 958fd67b-6ff1-0310-b445-bb7760255be9
2008-01-24 18:43:34 +00:00
Hanno Hecker
bb75098a84 add missing entry "vrfy" in @hooks, to make hook_vrfy() work
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@834 958fd67b-6ff1-0310-b445-bb7760255be9
2008-01-19 15:09:07 +00:00
Hanno Hecker
bf88f1ee99 Pluggable help, based on patch by Jose Luis Martinez
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@825 958fd67b-6ff1-0310-b445-bb7760255be9
2007-12-07 09:12:15 +00:00
Hanno Hecker
a5c22bcb7c Fix Qpsmtpd::Plugins::isa_plugin() with multiple plugin dirs (Gavin Carr)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@783 958fd67b-6ff1-0310-b445-bb7760255be9
2007-08-31 05:26:04 +00:00
Matt Sergeant
ef7d885929 Allow plugin tests to be in subdir (as with plugins).
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@737 958fd67b-6ff1-0310-b445-bb7760255be9
2007-05-17 22:02:32 +00:00
Matt Sergeant
062e73b7bf Support for pluggable received headers
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@731 958fd67b-6ff1-0310-b445-bb7760255be9
2007-04-09 14:45:11 +00:00
Hanno Hecker
d54a960f9a undo r700 (skip plugin)
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@701 958fd67b-6ff1-0310-b445-bb7760255be9
2007-01-01 12:47:46 +00:00
Hanno Hecker
39a9271213 New "skip plugin API" + example plugin skip_plugins, see perldoc
Qpsmtpd::Plugins for more info. This can be used to disable (and re-
enable) loaded plugins for the current connection.


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@700 958fd67b-6ff1-0310-b445-bb7760255be9
2006-12-31 11:07:32 +00:00
Ask Bjørn Hansen
bf2419df33 r3744@embla: ask | 2006-06-28 13:04:50 -0700
Support "module" plugins ("My::Plugin" in the config/plugins file)
 


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@648 958fd67b-6ff1-0310-b445-bb7760255be9
2006-06-28 20:05:04 +00:00
John Peacock
8fcb46177b Add Qpsmtpd::Command to gather all parsing logic in one place (Hanno
Hecker)


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@631 958fd67b-6ff1-0310-b445-bb7760255be9
2006-04-07 18:58:02 +00:00
John Peacock
82a32ed558 Automatically disconnect DENY'd server if it doesn't go willingly.
Implement queue_pre and queue_post hooks.

git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@626 958fd67b-6ff1-0310-b445-bb7760255be9
2006-03-01 16:46:55 +00:00
John Peacock
5959cc1c32 * lib/Qpsmtpd/Auth.pm
lib/Qpsmtpd/SMTP.pm
    Take the AUTH method and put it in SMTP.pm where it belongs.

* lib/Qpsmtpd.pm
  lib/Qpsmtpd/Plugin.pm
    Expose the auth_user/auth_mechanism property to plugin writers.

git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@556 958fd67b-6ff1-0310-b445-bb7760255be9
2005-10-31 17:12:37 +00:00
John Peacock
3707751b42 This fixes the redefined warnings.
All plugins don't have register() any more, but they all have plugin_name().

git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@505 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-14 11:05:11 +00:00
John Peacock
35f45f208b These changes to trunk were missed when 0.31 was branched.
r588@jpeacock (orig r490):  jpeacock | 2005-07-09 07:03:53 -0400
  r547@jpeacock:  jpeacock | 2005-07-02 07:20:17 -0400
  Replace pithy comment with something more neutral.
  Thanks Gordon Rowell <gordonr@gormand.com.au>
  r548@jpeacock:  jpeacock | 2005-07-02 07:24:21 -0400
  Example patterns for badrcptto plugin - Gordon Rowell <gordonr@gormand.com.au>
  r586@jpeacock:  jpeacock | 2005-07-09 06:54:47 -0400
  Don't use varlog() directly unless you are passing all parameters.
  Don't try to log() anything during loading of logging plugins.
  r587@jpeacock:  jpeacock | 2005-07-09 06:59:57 -0400
  Cannot use new-style hooking with logging plugins (yet).
 
 r590@jpeacock (orig r491):  jpeacock | 2005-07-10 06:56:55 -0400
  r589@jpeacock:  jpeacock | 2005-07-10 06:54:32 -0400
  Track hooks as array and hash.
  Re-revert changes to logging plugins to use new-style hooking.
  logging/adaptive assumed that register() has been called before hook_logging.
 


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@503 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-14 02:31:01 +00:00
Robert Spier
90daeb3786 r483@dog: rspier | 2005-07-06 21:17:00 -0700
The great plugin renaming in the name of inheritance and standardization commit.
 
 1. new concept of standard hook_ names.
 2. Plugin::init
 3. renamed many subroutines in plugins (and cleaned up register subs)
 4. updated README.plugins
 


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@479 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-07 04:17:39 +00:00