From 48d753ca25ad81c6fabd583806b2976ef8853925 Mon Sep 17 00:00:00 2001 From: Robert Spier Date: Fri, 11 Jun 2004 06:06:30 +0000 Subject: [PATCH] add DENYSOFTHARD status git-svn-id: https://svn.perl.org/qpsmtpd/trunk@240 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/Constants.pm | 8 +++++--- lib/Qpsmtpd/SMTP.pm | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/Qpsmtpd/Constants.pm b/lib/Qpsmtpd/Constants.pm index 2635268..2e9fa6a 100644 --- a/lib/Qpsmtpd/Constants.pm +++ b/lib/Qpsmtpd/Constants.pm @@ -10,11 +10,13 @@ use vars qw($VERSION @ISA @EXPORT); @EXPORT = (@common, @loglevels); use constant OK => 900; -use constant DENY => 901; -use constant DENYSOFT => 902; +use constant DENY => 901; # 550 +use constant DENYSOFT => 902; # 450 +use constant DENYHARD => 903; # 550 + disconnect +use constant DENYSOFTHARD => 904; # 450 + disconnect use constant DECLINED => 909; use constant DONE => 910; -use constant DENYHARD => 903; + # log levels use constant LOGDEBUG => 8; diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm index b862ac1..7be9085 100644 --- a/lib/Qpsmtpd/SMTP.pm +++ b/lib/Qpsmtpd/SMTP.pm @@ -236,6 +236,12 @@ sub mail { $self->respond(550, $msg); $self->disconnect; } + elsif ($rc == DENYSOFTHARD) { + $msg ||= $from->format . ', temporarily denied'; + $self->log(LOGINFO, "denysoft mail from " . $from->format . " ($msg)"); + $self->respond(450, $msg); + $self->disconnect; + } else { # includes OK $self->log(LOGINFO, "getting mail from ".$from->format); $self->respond(250, $from->format . ", sender OK - how exciting to get mail from you!");