Commit Graph

483 Commits

Author SHA1 Message Date
Matt Sergeant
be6b0e203c Fix a number of duh's in new code
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@446 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-22 18:56:58 +00:00
Matt Sergeant
bc3f52a380 Push enable/disable read call into lib/Qpsmtpd.pm
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@445 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-22 18:25:16 +00:00
Matt Sergeant
5853c3a011 Cleanup Timer code
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@444 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-22 18:24:34 +00:00
John Peacock
51b035ad62 Switch sense of adaptive logging. Immediately echo log lines <= max level
and save log lines <= min level.  IIF a message is accepted for delivery,
 then echo out the saved log lines (typically just FROM and TO) with the prefix
 for multilog filtering into independent log files.

 Update POD in logging/adaptive to describe changed behavior as well as give
 an example log/run file to filter the messages accordingly.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@443 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-22 14:42:09 +00:00
John Peacock
9664eb9469 Change remaining plugins to use LOGXXXX constants instead of bare numbers.
Change plugins/dnsbl to permit AUTH'd or other relay clients even if IP
is on a blacklist.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@442 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-22 14:08:57 +00:00
Matt Sergeant
cb047d9aa9 Timer support added to Danga::Socket
check_earlytalker updated to use timers
Few other code cleanups to make sure check-earlytalker is fully working


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@441 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-21 20:02:14 +00:00
Matt Sergeant
b54c8ec46c Use flatten code instead of the over complex bucket manipulation
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@440 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-20 21:03:41 +00:00
Matt Sergeant
b906f67123 Ported to support Apache::Qpsmtpd
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@439 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-20 18:46:38 +00:00
Matt Sergeant
9ba9d68f72 check_loop plugin by Keith Ivey
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@438 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-20 14:56:36 +00:00
Matt Sergeant
014efa87c4 Don't delete the buckets
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@437 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-18 18:58:30 +00:00
Matt Sergeant
a4517bdfa4 Continuation support
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@436 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-18 18:22:16 +00:00
Matt Sergeant
6ed494275b Support a flag for how many connections to accept in the accept loop
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@435 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-18 18:20:49 +00:00
Matt Sergeant
8b85efcfe8 There's a hole in my bucket, dear Liza, dear Liza.
There's a hole in my bucket, dear Liza, a hole.

Go fix it, dear Henry, dear Henry, dear Henry.
Go fix it, dear Henry, dear Henry, fix it.

With what shall I fix it, dear Liza ... with what?
With a patch from Joe Schaefer, dear Henry ... with a patch.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@434 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-17 13:33:57 +00:00
Matt Sergeant
b323b33f60 More cleanup
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@433 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-15 20:34:34 +00:00
John Peacock
4360370e7e A new auth plugin by Gordon Rowell <gordonr@gormand.com.au>
Interfaces with Bruce Guenther's Credential Validation Module (CVM)

 *   plugins/auth/auth_cvm_unix_local
     Only DENY if the credentials were accepted but incorrect (bad password?)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@432 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-10 12:11:26 +00:00
John Peacock
8b50b6dd46 Two new plugins from Gordon Rowell <gordonr@gormand.com.au>
*   plugins/check_badrcptto_patterns
     Match bad RCPTO address with regex
 
 *   plugins/check_norelay
     Carve out holes from larger relay blocks


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@431 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-09 16:36:43 +00:00
Matt Sergeant
9fbf25a708 More of the same.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@430 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-08 22:25:28 +00:00
Matt Sergeant
1f036fee90 Move the stats code purely into the plugin so that this can be extended
easier.


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@429 958fd67b-6ff1-0310-b445-bb7760255be9
2005-06-08 22:24:00 +00:00
John Peacock
662003437d * qpsmtpd-forkserver
Create a single Qpsmtpd::TcpServer object in the parent process and
     then rely on fork to let each child have it's own copy
     
 *   lib/Qpsmtpd/Plugin.pm
     Add new pre-connection and post-connection hooks
     
 *   README.plugins
     Document the above new hooks

 *   lib/Qpsmtpd.pm
     No longer have local value for trace_level() the first time through, which 
     was masking the global value (due to stupid search/replace error).
     Don't call log() from trace_level() since it is only ever called from
     within the varlog() sub when no logging plugin is registered.

 *   plugins/dnsbl
     Config line option to use DENY_DISCONNECT instead of DENY (since any IP
     on a blacklist should not have a chance to send anything for now).
     Add POD to document the new disconnect behavior

 *   lib/Qpsmtpd.pm
     Compatibility changes so test files continue to work
 
 *   t/Test/Qpsmtpd.pm
     Compatibility sub for core subs which call varlog() directly


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@428 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-25 20:07:58 +00:00
Matt Sergeant
25f2b302d7 Enforce stricture
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@427 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-25 16:36:14 +00:00
Matt Sergeant
42e49d493a Don't set an alarm if in connect mode.
Make fault() not return anything otherwise we get a "1" output in the stream


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@426 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-23 14:17:43 +00:00
Matt Sergeant
56451a722f First, since EventLoop goes off and does other things, any PostLoopCallback
can signal "our" EventLoop to return.  To ensure we wait the full time, we
must loop around until the end condition is truly satisfied.



git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@425 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-23 13:06:08 +00:00
Matt Sergeant
3b9c5b69fd Move PLC managment into close() and call close() in DESTROY
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@424 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-23 12:59:57 +00:00
Matt Sergeant
26c40f989b Fix for in-memory code writing headers twice
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@423 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-20 12:39:29 +00:00
Matt Sergeant
ec9ddc09d2 Fix for in-memory code copying headers twice
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@422 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-20 12:39:05 +00:00
Matt Sergeant
9432e1bac1 Use SOMAXCONN which makes connections MUCH happier on high load servers
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@421 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-19 15:39:53 +00:00
Matt Sergeant
62aebd2a3e Make number of accepts we perform lower if MAXCONNIP is used
Make connection hook get called after we do all the accept()s


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@420 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-17 11:48:02 +00:00
Matt Sergeant
e3a5d6c3c6 Make post loop callbacks a local var so we don't have to iterate through as
much


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@419 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-12 23:04:53 +00:00
Matt Sergeant
37c96a1773 Cache the hooks
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@418 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-12 22:08:37 +00:00
Matt Sergeant
e743c5903c Cache the peer_ip
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@417 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-12 22:08:20 +00:00
Matt Sergeant
c0c5078f82 Fix warning
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@416 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-12 12:58:13 +00:00
Matt Sergeant
7633e038c1 Use class logging where we can so we get proper log levels
Accept all new incoming connections not just one


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@415 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-12 12:57:05 +00:00
Matt Sergeant
726128aef6 Fixed typo in post_loop_callback name
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@414 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-09 13:49:40 +00:00
Matt Sergeant
8dad7435e5 Large number of patches from Brian Grossman to fix a number of bugs
Implement connection timeout


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@413 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-09 13:43:40 +00:00
Matt Sergeant
12d9fa8311 Fix deny incrementing to use proper variables
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@412 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-09 13:41:10 +00:00
Ask Bjørn Hansen
6ca4bc388c Fix off-by-one line numbers in warnings from plugins (thanks to
Brian Grossman).

  update changes file with all (?) changes since 0.29


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@411 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-05 07:44:34 +00:00
Matt Sergeant
46cda05112 Much improved config server, especially the stats
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@410 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-28 21:38:43 +00:00
Matt Sergeant
a75f4a53e0 Fixes for early_talker under high_perf code
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@409 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-28 21:38:02 +00:00
Matt Sergeant
cefae57394 Call PostEventLoop at end of Epoll event loop (same as poll() and kqueue)
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@408 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-28 21:37:01 +00:00
Matt Sergeant
536e1723c1 Added rudimentary configuration server when running in non-forking poll mode
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@407 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-26 02:46:45 +00:00
John Peacock
a5b362f9ff * lib/Qpsmtpd.pm
Remove needless restriction on temp_file()


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@406 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-18 14:40:33 +00:00
John Peacock
270f9c9a70 * plugins/auth/auth_ldap_bind
Correct DECLINE to DECLINED


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@405 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-12 20:48:53 +00:00
John Peacock
58ded6369d * lib/Qpsmtpd/Auth.pm
Fix some totally egregious spelling errors
 
 *  plugins/auth/auth_ldap_bind
    New plugin to authenticate against an LDAP database
    Thanks to Elliot Foster <elliotf@gratuitous.net>


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@404 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-12 19:59:52 +00:00
John Peacock
1be0263025 * plugins/logging/adaptive
Skip empty log lines in both accept and reject case


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@403 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-06 18:34:02 +00:00
Matt Sergeant
bfe7e6cb63 Flat file auth plugin
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@402 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-30 20:50:34 +00:00
John Peacock
89fd516d8e Revamp Qpsmtpd::Constants so it is possible to retrieve the text
representation from the numeric (for logging purposes).  Add new logging
plugin, logging/adaptive, which logs at different levels depending on
whether the message was accepted/rejected.
 
 *  lib/Qpsmtpd/Constants.pm
    use hashes for storing return_codes and log_levels
    export accessor methods to retrieve the text representations
 
 *  lib/Qpsmtpd.pm
    Rename log_level() to trace_level() so as to not conflict with the same
    name in Qpsmtpd::Constants.
    Call return_code() to display the text form when logging
 
 *  plugins/logging/adaptive
    Better documentation
    Support named parameters and prefix
    Call return_code() to display the text form when logging
 
 *  plugins/logging/warn
    Include POD

 *  README.logging
    First pass at documenting the logging plugin API

 *  config.sample/loglevel
    New numbering scheme to map directly to syslog levels


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@401 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-29 20:15:53 +00:00
Matt Sergeant
172fee0798 Fix for corruption problem under Apache
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@400 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-27 17:54:35 +00:00
John Peacock
f72647a44c * lib/Qpsmtpd.pm
(_load_plugins): split plugin_line using awk style "magic" whitespace


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@399 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-25 12:30:37 +00:00
John Peacock
e331f6b248 Add plugable logging support include sample plugin which replicates the
existing core code.  Add OK hook.

*  lib/Qpsmtpd.pm
   (init_logger): replaced with log_level()
   (load_logging): NEW - load logging plugins without calling log()
   (log_level): NEW - set/get global $LogLevel scalar
   (log): now just a wrapper for varlog(); called only by core code
   (varlog): initializes logging if not already done, calls logging plugins
     in turn and falls back to interal logging unless plugins OK or DECLINED
   (_load_plugins): only display "Loading plugin" when actually loading one
   (run_hooks): load logging plugins without calling log(); add OK hook as
     else of the DENY* case
   (spool_dir): use global $Spool_dir scalar to cache location

*  lib/Qpsmtpd/Plugin.pm
   (%hooks): add "logging" and "ok"
   (register_hook): add local _hook to object cache
   (log): call varlog() with additional parameters hook and plugin_name
     except for logging hook
   (compile): add accessor sub for local _hook scalar

*  lib/Qpsmtpd/SMTP.pm
   (mail, rcpt): change loglevel to LOGALERT instead of LOGWARN for from/to

*  qpsmtpd-forkserver
   (REAPER): use package ::log() instead of warn()
   (main): defer calling log until $plugin_loader has been initialized
   (log): call logging using the $plugin_loader object

*  plugins/logging/warn
   NEW: sample plugin which replicates the core logging functionality

*  plugins/logging/devnull
   NEW: sample plugin which logs nothing (for testing multiple logging
     plugin functionality)

*  config.sample/logging
   sample configuration file for logging plugins

*  plugins/virus/uvscan
   plugins/virus/clamav
   Increase loglevel for non-serious warnings to LOGWARN from LOGERROR


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@398 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-24 21:16:35 +00:00
Ask Bjørn Hansen
aef508cb7b Don't check the HELO host for rfc-ignorant compliance (maybe this should be an option?)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@397 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-24 19:17:46 +00:00