Opened 3 years ago
Closed 3 years ago
#1486754 closed Bugs (fixed)
Oversize messages rejected by PEAR's Net_SMTP's server SIZE capability detection do not show proper error message
| Reported by: | brandond | Owned by: | |
|---|---|---|---|
| Priority: | 3 | Milestone: | 0.4-stable |
| Component: | SMTP connection | Version: | 0.4-beta |
| Severity: | major | Keywords: | net_smtp esmtp size limit |
| Cc: |
Description
If the SMTP server sends an ESMTP SIZE capability, Net_SMTP checks the body size against this limit before transmitting the DATA command. If the body would violate the advertised size limit, it sends a QUIT to the server and returns immediately.
When this happens, roundcube checks the SMTP status code, which is in this case the server saying goodbye:
221 2.0.0 servername closing connection
Roundcube should include 221 in the list of status codes that trigger reporting of the PEAR error code instead of the full message from the server:
--- rcube_smtp.php.orig 2010-05-25 15:28:02.000000000 -0700
+++ rcube_smtp.php 2010-05-25 15:24:58.000000000 -0700
@@ -242,7 +242,7 @@
if (PEAR::isError($result = $this->conn->data($data, $text_headers)))
{
$err = $this->conn->getResponse();
- if (count($err)>1 && $err[0] != 354 && $err[0] != 250 )
+ if (count($err)>1 && $err[0] != 354 && $err[0] != 250 && $err[0] != 221 )
$msg = sprintf('[%d] %s', $err[0], $err[1]);
else
$msg = $result->getMessage();
Without this change, the user sees an unhelpful "server closing connection" error instead of the very helpful "Message size exceeds server limit" warning from Net_SMTP.
Change History (1)
comment:1 Changed 3 years ago by alec
- Resolution set to fixed
- Status changed from new to closed

Fixed in [14a4ac55].