Improve Qpsmtpd::Transaction::add_recipient syntax
Update Qpsmtpd::Transaction::add_recipient to use slightly clearer
language, and add 'if $rcpt' to prevent undef recipients from
being added -- in this case, the '@_ and' syntax allowing this set
method to set undef is undesirable, since you shouldn't be adding undef as
a recipient.
Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Qpsmtpd::Connection::notes() and Qpsmtpd::Transaction::notes() have
identicaly functionality; however, the POD documentation for Connection
notes is fairly brief while the documentation for Transaction notes is
longer and more helpful. This updates the Connection notes documention
to be consistent with its Transaction counterpart.
Qpsmtpd Connection and Transaction objects support notes() methods which
are conventionally used to pass data between plugins. This adds the
same functionality to Address objects. This should make it easier for
plugins to begin supporting message handling based on per-user
configuration directives.
Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
This reverts commit ea86b9fdb2.
Jared said...
I originally considered these functionally identical, but they are
not. The new code, called with, say, $txn->notes('discard',undef),
would result in evaluation as if it were a 'get' method rather than
setting the 'discard' note to undef. That seems quite dangerous. I
suggest either reverting the language back to the '@_ and' model, or
else doing something like:
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>
I've got many non-standard plugins and for a given
fatal error it is non-trivial to determine which of
them was to blame.
Perhaps this patch would be useful? (Against SVN,
not git, but I think that shouldn't matter too much..)
Steve
--
Stop blog&forum spam
http://blogspam.net/
The code feeds the results of $session->config('me') to
sprintf as part of the format string. In practice, this is
probably not a problem since hostnames don't contain percent
signs. However, it triggers a taint warning in perl 5.10,
making cram-md5 auth unusable.
This patch rewrites the sprintf to insert the 'me' value
using a %s format specifier.
(always worked on the second call due to the cache, but would return undef on the first call)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@955 958fd67b-6ff1-0310-b445-bb7760255be9
Support case where no connect hook is defined (thus continue_read() never gets called)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@882 958fd67b-6ff1-0310-b445-bb7760255be9
Before this, the SMTP responses contained the reference stringification
instead of the real message, when a plugin denied the mail at the DATA
stage:
554 ARRAY(0x9362f10)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@881 958fd67b-6ff1-0310-b445-bb7760255be9
Previous fix does not work for other cases, for example: packet ends
with CRLFdot, next packet starts with CRLF.
Danga::Client will send now full text lines to the callback.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@878 958fd67b-6ff1-0310-b445-bb7760255be9
... 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
- add back in after 0.42 is out? if yes: start implementing in -prefork
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@809 958fd67b-6ff1-0310-b445-bb7760255be9
then derive ids for connections and transactions from that via
simple counters.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@785 958fd67b-6ff1-0310-b445-bb7760255be9
- the reporters poposed fix would have caused two messages for the client on
return(DENY, ...) or a really unknown command.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@772 958fd67b-6ff1-0310-b445-bb7760255be9
Can't locate object method "new" via package "Qpsmtpd::Plugin::logging::warn"
(perhaps you forgot to load "Qpsmtpd::Plugin::logging::warn"?)
if plugin cannot be found in @plugin_dirs
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@762 958fd67b-6ff1-0310-b445-bb7760255be9
What happens is if you pause the connection (needed if you YIELD for something)
then the line-reading loop exits, and never gets back there unless the client
sends more data. If the client is an abuser (i.e. pipelines) then you might
never get back to the read loop.
(yes, this was a bitch to track down :-))
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@730 958fd67b-6ff1-0310-b445-bb7760255be9
Add _auth field to PollServer.
Make sure that check_earlytalker works with PollServer.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@711 958fd67b-6ff1-0310-b445-bb7760255be9
Heavily based on:
From: Nick Leverton <nj@leverton.org>
To: qpsmtpd@perl.org
Subject: SMTPA
Date: Thu, 4 Jan 2007 12:08:16 +0000
Message-Id: <200701041208.17018@leverton.icritical.com>
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@703 958fd67b-6ff1-0310-b445-bb7760255be9
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
(intention is to check bits in that don't break anything, so we can
always return to a stable base)
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@676 958fd67b-6ff1-0310-b445-bb7760255be9
Make child process pretty name optional for qpsmtpd-prefork.
Ignore rather than crash for uninstalled plugins.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@675 958fd67b-6ff1-0310-b445-bb7760255be9
plugin_dir is configured. Slightly worsens duplication of code with
plugin_dir() to continue avoiding infinite recursion.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@674 958fd67b-6ff1-0310-b445-bb7760255be9
Leverton <nj|@|leverton.org>. The inner _load_plugins() routine is changed to
load only a single plugin given a search path, and the (two) calls to it pass
in the configured list of plugin dirs. The non-module case of _load_plugin()
simply loops on the plugin dir list until a matching plugin file is found;
the first match stops the search for that plugin, regardless of success or
failure in loading it.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@671 958fd67b-6ff1-0310-b445-bb7760255be9
follow RFC's for multiline responses.
Patch from Brian Szymanski <ski-qpsmtpd@allafrica.com>
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@664 958fd67b-6ff1-0310-b445-bb7760255be9
[stupid] MUA, but isn't implemented with existing auth plugins. Based on
patch from Brian Szymanski.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@660 958fd67b-6ff1-0310-b445-bb7760255be9
Add SSL encryption method to FROM: header line.
Add new tls_before_auth configuration to hide AUTH until TLS is established.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@645 958fd67b-6ff1-0310-b445-bb7760255be9
Greatly simplify Danga::Client due to no more need for line mode client
Update to latest Danga::Socket
Fix check_earlytalker to use new API
Fix Danga::DNS to use new API
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@643 958fd67b-6ff1-0310-b445-bb7760255be9
Fix "help" command when there's no "smtpgreeting" configured (the default)
(Thanks to Thomas Ogrisegg)
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@642 958fd67b-6ff1-0310-b445-bb7760255be9
prepare for 0.32 -- plan release for next thursday
r4446@g5: ask | 2006-02-17 11:00:48 -0800
tag 0.32rc1
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@615 958fd67b-6ff1-0310-b445-bb7760255be9
that you have to explicitely read from <STDIN> in order for IO::Socket::SSL
to correctly translate the data (i.e. reading from <> isn't sufficient).
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@612 958fd67b-6ff1-0310-b445-bb7760255be9
Also made auth_vpopmail_sql be quieter about problems authenticating.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@607 958fd67b-6ff1-0310-b445-bb7760255be9
SMTP.pm (the Auth.pm POD will get renamed to README.authentication).
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@605 958fd67b-6ff1-0310-b445-bb7760255be9
Patch by Hanno Hecker <hah@uu-x.de>.
Adds the RFC 1893 status codes to the messages which are returned to the
sending client.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@602 958fd67b-6ff1-0310-b445-bb7760255be9
By default no flags are set (old behaviour). Known flags for cleanup are
FLAG_FILTER, FLAG_BCC_OK and FLAG_MAP_OK, see POD for details.
Patch by: Hanno Hecker <hah@uu-x.de>
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@600 958fd67b-6ff1-0310-b445-bb7760255be9
qpsmtpd-forkserver. This patch merges Peter's patch (with the possibilty
to DENY/DENSOFT the connection) and my first attempt. The --max-from-ip
check was moved from core to the hosts_allow plugin.
Patch by: Hanno Hecker <hah@uu-x.de>
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@599 958fd67b-6ff1-0310-b445-bb7760255be9
* lib/Qpsmtpd/Connection.pm
Abstract out parameters which can be reused (e.g. TLS) or can be
set when creating the Connection object via start().
* plugins/tls
Simplify code to use $self->clone() construct and also suppress
IO::Socket::SSL debug noise, now that this is working.
* plugins/tls_cert
New file to automate creating self-signed certificates for TLS.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@597 958fd67b-6ff1-0310-b445-bb7760255be9
Attempt to fix callback occurring immediately by calling it via AddTimer
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@590 958fd67b-6ff1-0310-b445-bb7760255be9
more use of the "fd:#" code everywhere.
* lib/Qpsmtpd.pm
Default log method use '$self->fd()' instead of '$self->{fd}'.
Include a sub fd() method for inheritance purposes.
* lib/Qpsmtpd/PollServer.pm
Inherit log() from Qpsmtpd.pm (via SMTP.pm).
* lib/Qpsmtpd/Plugin.pm
Appropriate code allow plugins to inherit fd().
* plugins/dnsbl
Use log() instead of warn().
* plugins/logging/adaptive
plugins/logging/warn
Include the 'fd:#' to the log line if defined.
* qpsmtpd
Reorder things slightly so we can use log().
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@589 958fd67b-6ff1-0310-b445-bb7760255be9
Too many individual changes to document. Trust me... ;-)
Lightly tested (i.e. it accepts and delivers mail with minimal plugins).
NOTES/LIMITATIONS:
logging/adaptive currently eats some log messages.
auth_vpopmail_sql is currently broken (needs continuations?).
'make test' fails in dnsbl (no Test::Qpsmtpd::input_sock() method).
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@588 958fd67b-6ff1-0310-b445-bb7760255be9
rather than ->transaction() when passing to hook)
Merge some other changes from 0.31.1 branch
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@582 958fd67b-6ff1-0310-b445-bb7760255be9
Support a finished() callback as the readable() thing didn't work.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@577 958fd67b-6ff1-0310-b445-bb7760255be9
from plugins/count_unrecognized_commands kicks in.
Several buffered lines are read and processed by
Danga::Client::process_read_buf() without checking if the socket was
closed. The attached patch seems to fix it.
-- Brian Grossman
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@571 958fd67b-6ff1-0310-b445-bb7760255be9
RFC-2821 Section 4.5.1 specifically requires <postmaster> (without
domain name) as a legal RCPT TO: address.
* t/qpsmtpd-address.t
Test the above.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@560 958fd67b-6ff1-0310-b445-bb7760255be9
Add POD to describe how to use the objects. Make the addr_cmp
method private (no need to expose it).
* t/qpsmtpd-address.t
Include tests of overloaded comparison, including sorting.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@559 958fd67b-6ff1-0310-b445-bb7760255be9
Don't overload '<=>' operator casually. Swap host/user portion
when comparing (makes it easy to sort by domain).
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@558 958fd67b-6ff1-0310-b445-bb7760255be9
Since we are already overloading stringify, we might as well
overload comparisons as well (this may be too simplistic a test).
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@557 958fd67b-6ff1-0310-b445-bb7760255be9
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
Fix fairly egregious error. If the size_threashold is smaller than
the body while writing, the file handle would be closed prematurely.
Ouch. I don't like it here from a stylistic point of view, but at
least it will actually work now.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@553 958fd67b-6ff1-0310-b445-bb7760255be9