From 43aef48532348b5b453421ecbc421a2c98839dfc Mon Sep 17 00:00:00 2001 From: John Peacock Date: Mon, 18 Jul 2005 00:36:49 +0000 Subject: [PATCH] Correctly handle the case where smtpgreeting exists (append ESMTP) as well as the case where it doesn't (display original Qpsmtpd greeting). git-svn-id: https://svn.perl.org/qpsmtpd/trunk@511 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/SMTP.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm index 98c72ed..4a84a30 100644 --- a/lib/Qpsmtpd/SMTP.pm +++ b/lib/Qpsmtpd/SMTP.pm @@ -114,9 +114,18 @@ sub connect_respond { return $rc; } elsif ($rc != DONE) { - $self->respond(220, $self->config('smtpgreeting') ." ESMTP" || - ($self->config('me') ." ESMTP qpsmtpd " . $self->version . - " ready; send us your mail, but not your spam.")); + my $greets = $self->config('smtpgreeting'); + if ( $greets ) { + $greets .= " ESMTP"; + } + else { + $greets = $self->config('me') + . " ESMTP qpsmtpd " + . $self->version + . " ready; send us your mail, but not your spam."; + } + + $self->respond(220, $greets); return DONE; } }