Commit Graph

74 Commits

Author SHA1 Message Date
Devin Carraway
deb3380d06 Apply slight variation on patch from Peter Holzer to allow specification of
an explicit $QPSMTPD_CONFIG variable to specify where the config lives,
overriding $QMAIL/control and /var/qmail/control if set.  The usual "last
location with the file wins" rule still applies.


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@529 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-29 08:05:42 +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
Matt Sergeant
c78dad0a3b Revert to proper versions
git-svn-id: https://svn.perl.org/qpsmtpd/branches/v031@481 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-07 20:10:03 +00:00
Matt Sergeant
a1324b5ddb Version 0.31 branch
git-svn-id: https://svn.perl.org/qpsmtpd/branches/v031@480 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-07 19:48:19 +00:00
Ask Bjørn Hansen
df5a2e9d95 bump version to 0.31-dev
From: 	  hjp@hjp.at
	Subject: 	PATCH: Return 421 if we are going to disconnect
	Date: 	July 3, 2005 1:23:21 PM PDT
	To: 	  qpsmtpd@perl.org

RFC 2821 says we should return 421, if we disconnect, not 450 or 451.

	hp



git-svn-id: https://svn.perl.org/qpsmtpd/trunk@459 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-04 14:39:29 +00:00
Ask Bjørn Hansen
3b7bfe9bce update the MANIFEST
various small tweaks

the README really could use some updating; yikes!


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@457 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-02 02:08:37 +00:00
Ask Bjørn Hansen
9eda52cd2c update changes file for 0.30.
bump version number.

plan to release this on tuesday


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@455 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-02 00:20:21 +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
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
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
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
3c5d0d93e4 bump version number up
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@384 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-04 19:18:30 +00:00
Ask Bjørn Hansen
db546fe91c prepare 0.29
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@379 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-03 02:30:16 +00:00
John Peacock
ec7aff1415 * lib/Qpsmtpd.pm
Use package lexical to cache spool dir location instead of storing in
    Transaction or other high level object


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@376 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-01 14:33:26 +00:00
John Peacock
bb36c60b6a Abstracted spool_dir creation and added temp_file() and temp_dir() subs to
make it easier for plugins to manage temporary workspace.  Also add POD and
tests for the new functions.  Still need to add tests to the temp_*() calls
from a plugin.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@369 958fd67b-6ff1-0310-b445-bb7760255be9
2005-02-22 02:47:39 +00:00
Robert Spier
0a2fc866de - logging tweaks..
- move some things to more appropriate levels
   - make 'running plugin' more interesting


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@348 958fd67b-6ff1-0310-b445-bb7760255be9
2004-11-27 06:46:21 +00:00
Matt Sergeant
4c44510191 Move plugin compile code into the Plugin module
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@341 958fd67b-6ff1-0310-b445-bb7760255be9
2004-11-18 19:47:10 +00:00
Matt Sergeant
11c12711ee Fix deny plugin which stopped working.
Call deny plugin for _DISCONNECT constants.
Make Plugin.pm %hooks a global rather than lexical so we can do evil things later.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@320 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-19 18:49:05 +00:00
Matt Sergeant
9224e436bb Plugin testing framework.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@313 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-08 16:26:33 +00:00
Robert Spier
ec5e23a28a Allow for multiple instances of a single plugin by using plugin:0
notation


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@308 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-07 05:35:16 +00:00
Robert Spier
4d4baac96e Nick Leverton noticed I left out a very important 'ref'. Thanks Nick!
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@306 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-06 17:36:57 +00:00
Matt Sergeant
606519b06c Fix for hooks not running with previous patch, caused by qpsmtpd objects not
asking each plugin to register. There is slightly more overhead this way,
but it feels more correct, and we can fix the overhead later in a more clean
way.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@300 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-05 16:28:08 +00:00
Robert Spier
5128bd0718 new plugin output tracking
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@296 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-04 03:16:10 +00:00
Robert Spier
bdd20fed4d indentation and whitespace cleanup
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@295 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-04 00:57:16 +00:00
Robert Spier
e8bf8286fc reindent undef check
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@294 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-04 00:51:02 +00:00
Matt Sergeant
e6e2091ee0 Attempt to clean up circular refs problems
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@292 958fd67b-6ff1-0310-b445-bb7760255be9
2004-08-31 01:58:57 +00:00
Ask Bjørn Hansen
a979f8344f fix the CDB support so we can work without it (but with a big warning)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@275 958fd67b-6ff1-0310-b445-bb7760255be9
2004-07-18 11:02:08 +00:00
Matt Sergeant
0e5b4e63ec Add unshift parameter to register_hook, allowing you to put the hook at the
start of the queue


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@244 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-11 20:01:17 +00:00
Ask Bjørn Hansen
3db688e52c 0.28
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@235 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-05 10:09:30 +00:00
Matt Sergeant
9c700b18e1 New for 0.28: Log levels and $Include for config/plugins
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@217 958fd67b-6ff1-0310-b445-bb7760255be9
2004-03-05 12:46:24 +00:00
Ask Bjørn Hansen
f59721ed1b start on 0.28-dev ...
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@216 958fd67b-6ff1-0310-b445-bb7760255be9
2004-03-05 09:26:36 +00:00
Ask Bjørn Hansen
6e3ebe8ea3 0.27.0
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@214 958fd67b-6ff1-0310-b445-bb7760255be9
2004-03-05 09:17:38 +00:00
Matt Sergeant
03b8cda2b5 Don't keep the _qp around - just pass it in to each hook.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@179 958fd67b-6ff1-0310-b445-bb7760255be9
2003-11-02 11:13:08 +00:00
Matt Sergeant
29bbbece90 Check for register() function after fixing plugin name (major speedup for
persistent environments as previously queue/qmail-queue would be recompiled
for every mail)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@177 958fd67b-6ff1-0310-b445-bb7760255be9
2003-10-23 08:48:56 +00:00
Ask Bjørn Hansen
2a76892570 don't use Data::Dumper
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@172 958fd67b-6ff1-0310-b445-bb7760255be9
2003-09-15 10:50:27 +00:00
Ask Bjørn Hansen
e006f74d23 Use $ENV{QMAIL} to override /var/qmail for where to find the
control/ directory.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@169 958fd67b-6ff1-0310-b445-bb7760255be9
2003-08-30 15:14:56 +00:00
Matt Sergeant
bae4a84b99 Fixed defaults bug (freeside)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@166 958fd67b-6ff1-0310-b445-bb7760255be9
2003-07-24 12:43:46 +00:00
Ask Bjørn Hansen
9f857f845e 0.27-dev
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@163 958fd67b-6ff1-0310-b445-bb7760255be9
2003-07-08 03:10:48 +00:00
Matt Sergeant
0c99d11f8b Don't reload plugins if already loaded (stops warnings under pperl)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@157 958fd67b-6ff1-0310-b445-bb7760255be9
2003-06-23 08:14:25 +00:00
Ask Bjørn Hansen
d99eea00d6 release 0.26
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@155 958fd67b-6ff1-0310-b445-bb7760255be9
2003-06-11 08:38:57 +00:00
Ask Bjørn Hansen
1eafaba4e9 don't try to open configuration files that does not exist.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@151 958fd67b-6ff1-0310-b445-bb7760255be9
2003-06-10 10:06:31 +00:00
Ask Bjørn Hansen
9b150dfcf1 Fix bug hiding the error message when an existing configuration file
isn't readable.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@145 958fd67b-6ff1-0310-b445-bb7760255be9
2003-04-23 03:36:36 +00:00
Ask Bjørn Hansen
3c80ae667f remove $plugin defined twice warning
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@137 958fd67b-6ff1-0310-b445-bb7760255be9
2003-04-15 17:50:45 +00:00
Ask Bjørn Hansen
c10b6fb375 Support morercpthosts.cdb
config now takes an extra "type" parameter.  If it's "map" then a
  reference to a tied hash will be returned.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@131 958fd67b-6ff1-0310-b445-bb7760255be9
2003-03-25 12:50:07 +00:00
Ask Bjørn Hansen
bf885c2fe8 release 0.25
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@129 958fd67b-6ff1-0310-b445-bb7760255be9
2003-03-18 10:02:12 +00:00
Ask Bjørn Hansen
1e68979d60 0.26-dev
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@128 958fd67b-6ff1-0310-b445-bb7760255be9
2003-03-18 09:59:21 +00:00
Ask Bjørn Hansen
5eec66f3e2 add deny hook (Rasjid Wilcox)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@111 958fd67b-6ff1-0310-b445-bb7760255be9
2003-01-20 11:02:20 +00:00
Ask Bjørn Hansen
6aac8fc692 release 0.20
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@106 958fd67b-6ff1-0310-b445-bb7760255be9
2002-12-09 09:08:44 +00:00
Ask Bjørn Hansen
9d5610a80a 0.20-dev
allow plugin configuration via the plugins config

store _hooks globally so they'll work from the transaction object too


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@95 958fd67b-6ff1-0310-b445-bb7760255be9
2002-11-06 06:40:35 +00:00