[svn:qpsmtpd] r704 - branches/0.3x/lib/Qpsmtpd

[email protected] Sat, 6 Jan 2007 12:22:02 -0800 (PST)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
Author: robert
Date: Sat Jan  6 12:22:01 2007
New Revision: 704

Modified:
   branches/0.3x/lib/Qpsmtpd/SMTP.pm

Log:
mct noticed that we weren't properly testing for ESMTP.


Modified: branches/0.3x/lib/Qpsmtpd/SMTP.pm
==============================================================================
--- branches/0.3x/lib/Qpsmtpd/SMTP.pm	(original)
+++ branches/0.3x/lib/Qpsmtpd/SMTP.pm	Sat Jan  6 12:22:01 2007
@@ -658,17 +658,18 @@
   $self->transaction->header($header);
 
   my $smtp = $self->connection->hello eq "ehlo" ? "ESMTP" : "SMTP";
+  my $esmtp = substr($smtp,0,1) eq "E";
   my $authheader;
   my $sslheader;
 
   if (defined $self->connection->notes('tls_enabled')
       and $self->connection->notes('tls_enabled')) {
-    $smtp eq "ESMTP" and $smtp .= "S"; # RFC3848
+    $smtp .= "S" if $esmtp; # RFC3848
     $sslheader = "(".$self->connection->notes('tls_socket')->get_cipher()." encrypted) ";
   }
 
   if (defined $self->{_auth} and $self->{_auth} == OK) {
-    $smtp eq "ESMTP" and $smtp .= "A"; # RFC3848
+    $smtp .= "A" if $esmtp; # RFC3848
     $authheader = "(smtp-auth username $self->{_auth_user}, mechanism $self->{_auth_mechanism})\n";
   }