summaryrefslogtreecommitdiff
path: root/program/include/rcube_smtp.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-07-14 16:34:34 +0000
committeralecpl <alec@alec.pl>2009-07-14 16:34:34 +0000
commit19862b5586343205dc381339bfea46915dd498d3 (patch)
treed0ee98fb27c078959c36fe6ea34a0f1ca7e4444c /program/include/rcube_smtp.inc
parentec31b6f9f30d293078725e4d94ad40f1c5495daa (diff)
- added 'smtp_debug' option
Diffstat (limited to 'program/include/rcube_smtp.inc')
-rw-r--r--program/include/rcube_smtp.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/program/include/rcube_smtp.inc b/program/include/rcube_smtp.inc
index db681af05..9e1e66426 100644
--- a/program/include/rcube_smtp.inc
+++ b/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