On Wed, 11 Jan 2006 12:15:37 -0500
John Peacock <[EMAIL PROTECTED]> wrote:
> Hanno Hecker wrote:
> > this is the enhanced version of what I showed Matt on IRC yesterday.
> > It adds the RFC 1893 status codes to the messages which are returned
> > to the sending client.
>
> After some prodding (Hi Ask!), I'm going back and seeing what patches
> have been submitted and not applied. This a big one which looks like
> it should be applied, but I have a couple of information-hiding
> questions.
>
> Hanno has done a great job of abstracting out all of the error
> messages and supporting Enhanced Status Codes, but a couple of times
> the proposed replacement in existing plugins eliminates information
> we are currently providing. For example, this chunk:
>
> --- qpsmtpd-0.31-dev/plugins/check_badrcptto 2005-11-01
> 13:34:52.000000000 +0100
> +++ qpsmtpd-dev/plugins/check_badrcptto 2005-11-01 14:49:02.000000000
> +0100
> @@ -9,9 +9,9 @@
> for my $bad (@badrcptto) {
> $bad = lc $bad;
> $bad =~ s/^\s*(\S+)/$1/;
> - return (DENY, "mail to $bad not accepted here")
> + return ($self->qp->dsn->no_such_user(DENY))
> if $bad eq $from;
Hmm, I see you don't have the latest version. It looks now like
+++ qpsmtpd-dev/plugins/check_badrcptto 2005-11-02 16:21:06.000000000
+0100 @@ -1,4 +1,5 @@
# this plugin checks the badrcptto config (like
badmailfrom for rcpt address)
+use Qpsmtpd::DSN;
sub hook_rcpt {
my ($self, $transaction, $recipient) = @_;
@@ -9,9 +10,9 @@
for my $bad (@badrcptto) {
$bad = lc $bad;
$bad =~ s/^\s*(\S+)/$1/;
- return (DENY, "mail to $bad not accepted here")
+ return Qpsmtpd::DSN->no_such_user("mail to $bad not accepted here")
if $bad eq $from;
[...snip...]
i.e. nothing changes in the core, and every plugin which wants to use
these status codes has to "use" Qpsmtpd::DSN.
This version also accepts
- just a return code (DENY, DENYSOFT, OK/DECLINED): default message is
used
- just a message: default return code is used
- nothing: default return code and message
- return code and message
Hanno
qp-dsn-nocore-w_def_args.diff.gz
Description: Binary data
