phpBB

Code Changes

File: includes/functions_messenger.php

  Unmodified   Added   Modified   Removed
Line 387Line 387
			$this->queue->save();
return;
}

			$this->queue->save();
return;
}

 
	}

/**
* Generates a valid message id to be used in emails
*
* @return string message id
*/
function generate_message_id()
{
global $config;

$domain = 'phpbb.generated';
if ($config['server_name'])
{
$domain = $config['server_name'];
}
else if (!empty($_SERVER['SERVER_NAME']))
{
$domain = $_SERVER['SERVER_NAME'];
}

return md5(unique_id(time())) . '@' . $domain;

	}

/**

	}

/**

Line 415Line 437
		$headers[] = 'Return-Path: <' . $config['board_email'] . '>';
$headers[] = 'Sender: <' . $config['board_email'] . '>';
$headers[] = 'MIME-Version: 1.0';

		$headers[] = 'Return-Path: <' . $config['board_email'] . '>';
$headers[] = 'Sender: <' . $config['board_email'] . '>';
$headers[] = 'MIME-Version: 1.0';

		$headers[] = 'Message-ID: <' . md5(unique_id(time())) . '@' . $config['server_name'] . '>';

		$headers[] = 'Message-ID: <' . $this->generate_message_id() . '>';

		$headers[] = 'Date: ' . date('r', time());
$headers[] = 'Content-Type: text/plain; charset=UTF-8'; // format=flowed
$headers[] = 'Content-Transfer-Encoding: 8bit'; // 7bit

		$headers[] = 'Date: ' . date('r', time());
$headers[] = 'Content-Type: text/plain; charset=UTF-8'; // format=flowed
$headers[] = 'Content-Transfer-Encoding: 8bit'; // 7bit

Line 568Line 590
		if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

		if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

			$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']);

			$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);


if (!$this->jabber->connect())
{


if (!$this->jabber->connect())
{

Line 715Line 737

$lock_fp = $this->lock();



$lock_fp = $this->lock();


 
		// avoid races, check file existence once
$have_cache_file = file_exists($this->cache_file);
if (!$have_cache_file || $config['last_queue_run'] > time() - $config['queue_interval'])
{
if (!$have_cache_file)
{

		set_config('last_queue_run', time(), true);

		set_config('last_queue_run', time(), true);

 
			}





		if (!file_exists($this->cache_file) || filemtime($this->cache_file) > time() - $config['queue_interval'])
{

 
			$this->unlock($lock_fp);
return;
}

			$this->unlock($lock_fp);
return;
}

 

set_config('last_queue_run', time(), true);


include($this->cache_file);



include($this->cache_file);


Line 769Line 798
					}

include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

					}

include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

					$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']);

					$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);


if (!$this->jabber->connect())
{


if (!$this->jabber->connect())
{

Line 1022Line 1051
	}

// Let me in. This function handles the complete authentication process

	}

// Let me in. This function handles the complete authentication process

	if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], $config['smtp_password'], $config['smtp_auth_method']))

	if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], htmlspecialchars_decode($config['smtp_password']), $config['smtp_auth_method']))

	{
$smtp->close_session($err_msg);
return false;

	{
$smtp->close_session($err_msg);
return false;