unify SMTP_HOST and SMTP_PORT as SMTP_SERVER

This commit is contained in:
Andrew Dolgov 2013-04-16 16:40:04 +04:00
parent ea4e11032a
commit b9863a153c
3 changed files with 16 additions and 15 deletions

View file

@ -25,17 +25,20 @@ class ttrssMailer extends PHPMailer {
function __construct() { function __construct() {
$this->SetLanguage("en", "lib/phpmailer/language/"); $this->SetLanguage("en", "lib/phpmailer/language/");
//if SMTP_HOST is specified, use SMTP to send mail directly
if (SMTP_HOST) { if (SMTP_HOST) {
$Host = SMTP_HOST; $pair = explode(":", SMTP_HOST, 2);
$Mailer = "smtp"; $Mailer = "smtp";
$Host = $pair[0];
$Port = $pair[1];
if (!$Port) $Port = 25;
} else {
$Host = '';
$Port = '';
} }
//if SMTP_PORT is specified, assign it. Otherwise default to port 25
if(SMTP_PORT){
$Port = SMTP_PORT;
}else{
$Port = "25";
}
//if SMTP_LOGIN is specified, set credentials and enable auth //if SMTP_LOGIN is specified, set credentials and enable auth
if(SMTP_LOGIN){ if(SMTP_LOGIN){

View file

@ -160,12 +160,10 @@
define('DIGEST_SUBJECT', '[tt-rss] New headlines for last 24 hours'); define('DIGEST_SUBJECT', '[tt-rss] New headlines for last 24 hours');
// Subject line for email digests // Subject line for email digests
define('SMTP_HOST', ''); define('SMTP_SERVER', '');
// SMTP Host to send outgoing mail. Blank - use system MTA. // Hostname:port combination to send outgoing mail (i.e. localhost:25).
// Blank - use system MTA.
define('SMTP_PORT','');
// SMTP port to sent outgoing mail. Default is 25.
define('SMTP_LOGIN', ''); define('SMTP_LOGIN', '');
define('SMTP_PASSWORD', ''); define('SMTP_PASSWORD', '');
// These two options enable SMTP authentication when sending // These two options enable SMTP authentication when sending

View file

@ -1,3 +1,3 @@
<?php # This file has been generated at: Sat Apr 13 17:41:19 MSK 2013 <?php # This file has been generated at: Tue Apr 16 16:38:38 MSK 2013
define('GENERATED_CONFIG_CHECK', 26); define('GENERATED_CONFIG_CHECK', 26);
$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'FEED_CRYPT_KEY', 'SINGLE_USER_MODE', 'SIMPLE_UPDATE_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'FORCE_ARTICLE_PURGE', 'PUBSUBHUBBUB_HUB', 'PUBSUBHUBBUB_ENABLED', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SESSION_CHECK_ADDRESS', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'SMTP_HOST', 'SMTP_PORT', 'SMTP_LOGIN', 'SMTP_PASSWORD', 'CHECK_FOR_NEW_VERSION', 'ENABLE_GZIP_OUTPUT', 'PLUGINS', 'CONFIG_VERSION'); ?> $requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'FEED_CRYPT_KEY', 'SINGLE_USER_MODE', 'SIMPLE_UPDATE_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'FORCE_ARTICLE_PURGE', 'PUBSUBHUBBUB_HUB', 'PUBSUBHUBBUB_ENABLED', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SESSION_CHECK_ADDRESS', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'SMTP_SERVER', 'SMTP_LOGIN', 'SMTP_PASSWORD', 'CHECK_FOR_NEW_VERSION', 'ENABLE_GZIP_OUTPUT', 'PLUGINS', 'CONFIG_VERSION'); ?>