From fb40f3778412beefd7d5fed510cb3edb32220874 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 07 Oct 2011 04:43:07 -0400
Subject: [PATCH] - Ignore DSN request when it isn't supported by SMTP server (#1487800)

---
 program/include/rcube_smtp.php          |   10 +++-------
 CHANGELOG                               |    1 +
 program/localization/en_US/messages.inc |    1 -
 program/localization/pl_PL/messages.inc |    1 -
 4 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index c3910f3..98a1222 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Ignore DSN request when it isn't supported by SMTP server (#1487800)
 - Make sure LDAP name fields aren't arrays (#1488108)
 - Fixed imap test to non-default port when using ssl (#1488118)
 - Force all files to be overwritten when updating (#1488117)
diff --git a/program/include/rcube_smtp.php b/program/include/rcube_smtp.php
index 73c30d2..5c2dd92 100644
--- a/program/include/rcube_smtp.php
+++ b/program/include/rcube_smtp.php
@@ -214,14 +214,10 @@
     if ($opts['dsn']) {
       $exts = $this->conn->getServiceExtensions();
 
-      if (!isset($exts['DSN'])) {
-        $this->error = array('label' => 'smtpdsnerror');
-        $this->response[] = "DSN not supported";
-        return false;
+      if (isset($exts['DSN'])) {
+        $from_params      = 'RET=HDRS';
+        $recipient_params = 'NOTIFY=SUCCESS,FAILURE';
       }
-
-      $from_params      = 'RET=HDRS';
-      $recipient_params = 'NOTIFY=SUCCESS,FAILURE';
     }
 
     // RFC2298.3: remove envelope sender address
diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc
index 047349f..e3d914d 100644
--- a/program/localization/en_US/messages.inc
+++ b/program/localization/en_US/messages.inc
@@ -128,7 +128,6 @@
 $messages['smtpfromerror'] = 'SMTP Error ($code): Failed to set sender "$from" ($msg).';
 $messages['smtptoerror'] = 'SMTP Error ($code): Failed to add recipient "$to" ($msg).';
 $messages['smtprecipientserror'] = 'SMTP Error: Unable to parse recipients list.';
-$messages['smtpdsnerror'] = 'SMTP Error: No support for Delivery Status Notifications.';
 $messages['smtperror'] = 'SMTP Error: $msg';
 $messages['emailformaterror'] = 'Invalid e-mail address: $email';
 $messages['toomanyrecipients'] = 'Too many recipients. Reduce the number of recipients to $max.';
diff --git a/program/localization/pl_PL/messages.inc b/program/localization/pl_PL/messages.inc
index 784db2b..8d1e1ed 100644
--- a/program/localization/pl_PL/messages.inc
+++ b/program/localization/pl_PL/messages.inc
@@ -117,7 +117,6 @@
 $messages['smtpfromerror'] = 'Błąd SMTP ($code): Nie można ustawić nadawcy "$from" ($msg).';
 $messages['smtptoerror'] = 'Błąd SMTP ($code): Nie można dodać odbiorcy "$to" ($msg).';
 $messages['smtprecipientserror'] = 'Błąd SMTP: Parsowanie listy odbiorców nie powiodło się.';
-$messages['smtpdsnerror'] = 'Błąd SMTP: Statusy dostarczenia (DSN) nie są obsługiwane przez serwer.';
 $messages['smtperror'] = 'Błąd SMTP: $msg';
 $messages['emailformaterror'] = 'Błędny adres e-mail: $email';
 $messages['toomanyrecipients'] = 'Zbyt wielu odbiorców. Zmniejsz ich liczbę do $max.';

--
Gitblit v1.9.1