+ // RFC3461: Delivery Status Notification
+ if ($opts['dsn']) {
+ $exts = $this->conn->getServiceExtensions();
+
+ if (!isset($exts['DSN'])) {
+ $this->error = array('label' => 'smtpdsnerror');
+ $this->response[] = "DSN not supported";
+ return false;
+ }
+
+ $from_params = 'RET=HDRS';
+ $recipient_params = 'NOTIFY=SUCCESS,FAILURE';
+ }
+
+ // RFC2298.3: remove envelope sender address
+ if (preg_match('/Content-Type: multipart\/report/', $text_headers)
+ && preg_match('/report-type=disposition-notification/', $text_headers)
+ ) {
+ $from = '';
+ }
+