summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-07-14 16:34:34 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-07-14 16:34:34 +0000
commit03cfead1d42ca546e148516fd5750af7a47ea278 (patch)
tree03c9d80076808ea2b46a076d17af66b148a06199 /roundcubemail/program
parent66ed3c7429872c8927b436cc9ff510e521a10e50 (diff)
- added 'smtp_debug' option
git-svn-id: https://svn.roundcube.net/trunk@2754 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/include/rcube_smtp.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/roundcubemail/program/include/rcube_smtp.inc b/roundcubemail/program/include/rcube_smtp.inc
index db681af05..9e1e66426 100644
--- a/roundcubemail/program/include/rcube_smtp.inc
+++ b/roundcubemail/program/include/rcube_smtp.inc
@@ -92,6 +92,9 @@ function smtp_mail($from, $recipients, &$headers, &$body, &$response, &$error)
$SMTP_CONN = new Net_SMTP($smtp_host, $smtp_port, $helo_host);
+ if($RCMAIL->config->get('smtp_debug'))
+ $SMTP_CONN->setDebug(true, 'smtp_debug_handler');
+
// try to connect to server and exit on failure
$result = $SMTP_CONN->connect($smtp_timeout);
if (PEAR::isError($result))
@@ -247,6 +250,12 @@ function smtp_disconnect()
}
}
+/* this is our own debug handler for the SMTP connection */
+function smtp_debug_handler(&$smtp, $message)
+ {
+ write_log('smtp', preg_replace('/\r\n$/', '', $message));
+ }
+
/**
* Take an array of mail headers and return a string containing