From ac9dd50928c214a306f76659b5d55d16baf435af Mon Sep 17 00:00:00 2001 From: Robert Spier Date: Mon, 14 Jun 2004 22:25:52 +0000 Subject: [PATCH] DENY_DISCONNECT and DENYSOFT_DISCONNECT instead of *HARD git-svn-id: https://svn.perl.org/qpsmtpd/trunk@245 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/Constants.pm | 9 ++++++--- lib/Qpsmtpd/SMTP.pm | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/Qpsmtpd/Constants.pm b/lib/Qpsmtpd/Constants.pm index 9e8867f..b1395eb 100644 --- a/lib/Qpsmtpd/Constants.pm +++ b/lib/Qpsmtpd/Constants.pm @@ -2,7 +2,9 @@ package Qpsmtpd::Constants; use strict; require Exporter; -my (@common) = qw(OK DECLINED DONE DENY DENYSOFT DENYHARD DENYSOFTHARD); +my (@common) = qw(OK DECLINED DONE DENY DENYSOFT DENYHARD + DENY_DISCONNECT DENYSOFT_DISCONNECT + ); my (@loglevels) = qw(LOGDEBUG LOGINFO LOGNOTICE LOGWARN LOGERROR LOGCRIT LOGALERT LOGEMERG LOGRADAR); use vars qw($VERSION @ISA @EXPORT); @@ -12,8 +14,9 @@ use vars qw($VERSION @ISA @EXPORT); use constant OK => 900; use constant DENY => 901; # 550 use constant DENYSOFT => 902; # 450 -use constant DENYHARD => 903; # 550 + disconnect -use constant DENYSOFTHARD => 904; # 450 + disconnect +use constant DENYHARD => 903; # 550 + disconnect (deprecated in 0.29) +use constant DENY_DISCONNECT => 903; # 550 + disconnect +use constant DENYSOFT_DISCONNECT => 904; # 450 + disconnect use constant DECLINED => 909; use constant DONE => 910; diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm index 4d90235..1b5bb58 100644 --- a/lib/Qpsmtpd/SMTP.pm +++ b/lib/Qpsmtpd/SMTP.pm @@ -230,13 +230,13 @@ sub mail { $self->log(LOGINFO, "denysoft mail from " . $from->format . " ($msg)"); $self->respond(450, $msg); } - elsif ($rc == DENYHARD) { + elsif ($rc == DENY_DISCONNECT) { $msg ||= $from->format . ', denied'; $self->log(LOGINFO, "deny mail from " . $from->format . " ($msg)"); $self->respond(550, $msg); $self->disconnect; } - elsif ($rc == DENYSOFTHARD) { + elsif ($rc == DENYSOFT_DISCONNECT) { $msg ||= $from->format . ', temporarily denied'; $self->log(LOGINFO, "denysoft mail from " . $from->format . " ($msg)"); $self->respond(450, $msg); @@ -273,13 +273,13 @@ sub rcpt { $msg ||= 'relaying denied'; return $self->respond(450, $msg); } - elsif ($rc == DENYHARD) { + elsif ($rc == DENY_DISCONNECT) { $msg ||= 'delivery denied'; $self->log(LOGINFO, "delivery denied ($msg)"); $self->respond(550, $msg); $self->disconnect; } - elsif ($rc == DENYSOFTHARD) { + elsif ($rc == DENYSOFT_DISCONNECT) { $msg ||= 'relaying denied'; $self->log(LOGINFO, "delivery denied ($msg)"); $self->respond(450, $msg);