ampache-dev | 27 Oct 01:06 2010
Picon

Ampache SVN - r2464 - in trunk: config lib/class

Author: flowerysong
Date: 2010-10-26 16:06:55 -0700 (Tue, 26 Oct 2010)
New Revision: 2464

Modified:
   trunk/config/ampache.cfg.php.dist
   trunk/lib/class/ampachemail.class.php
Log:
Fix authenticated SMTP and add secure (TLS/SSL) SMTP.

Modified: trunk/config/ampache.cfg.php.dist
===================================================================
--- trunk/config/ampache.cfg.php.dist	2010-10-24 21:55:51 UTC (rev 2463)
+++ trunk/config/ampache.cfg.php.dist	2010-10-26 23:06:55 UTC (rev 2464)
 <at>  <at>  -612,6 +612,11  <at>  <at> 
 ;DEFAULT: 25
 ;mail_port = 25

+;Secure SMTP
+;POSSIBLE VALUES: ssl tls
+;DEFAULT: none
+;mail_secure_smtp = tls
+
 ;Enable SMTP authentication
 ;DEFAULT: false
 ;mail_auth = true

Modified: trunk/lib/class/ampachemail.class.php
===================================================================
--- trunk/lib/class/ampachemail.class.php	2010-10-24 21:55:51 UTC (rev 2463)
+++ trunk/lib/class/ampachemail.class.php	2010-10-26 23:06:55 UTC (rev 2464)
 <at>  <at>  -163,10 +163,13  <at>  <at> 
 				$mail->Host = $mailhost;
 				$mail->Port = $mailport;
 				if($mailauth == true) {
-					$mail->SMTPAuth(true);
+					$mail->SMTPAuth = true;
 					$mail->Username = $mailuser;
 					$mail->Password = $mailpass;
 				}
+				if ($mailsecure = Config::get('mail_secure_smtp')) {
+					$mail->SMTPSecure = ($mailsecure == 'ssl') ? 'ssl' : 'tls';
+				}
 			break;
 			case 'sendmail':
 				$mail->IsSendmail();


Gmane