[SOLVED] -Creating custom_config.inc.php for email breaks TL

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
68K
Advanced user
Posts: 22
Joined: Wed Sep 02, 2009 10:49 am

[SOLVED] -Creating custom_config.inc.php for email breaks TL

Post by 68K »

Hello -

I want to configure SMTP email on TestLink 1.9.1.
When I configure email (pasted below is the contents of custom_config.inc.php) then email features in TestLink are working BUT it causes a problem with the Add/Remove Test Cases feature - the test suite tree fails to render; there is just one node for the project; and nothing happens when you click on it.
I tried deleting browser cookies but it made no difference.
I searched mantis already but did not find any existing report of this problem.

My custom_config.inc.php is below. It only contains SMTP config - why does it break the test suite tree in Add/Remove Test Cases?

Code: Select all

<?php// ----------------------------------------------------------------------------
/* [SMTP] */

/**
 * @var string SMTP server name or IP address ("localhost" should work in the most cases)
 * Configure using custom_config.inc.php
 * @uses lib/functions/email_api.php
 */
$g_smtp_host        = '192.168.1.1';  # SMTP server MUST BE configured

# Configure using custom_config.inc.php
$g_tl_admin_email     = 'jstocks@gmail.com'; # for problem/error notification
$g_from_email         = 'TestLink';  # email sender
$g_return_path_email  = 'jstocks@gmail.com';

/**
 * Email notification priority (low by default)
 * Urgent = 1, Not Urgent = 5, Disable = 0
 **/
$g_mail_priority = 5;

/**
 * Taken from mantis for phpmailer config
 * select the method to mail by:
 * PHPMAILER_METHOD_MAIL - mail()
 * PHPMAILER_METHOD_SENDMAIL - sendmail
 * PHPMAILER_METHOD_SMTP - SMTP
 */
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;

/** Configure only if SMTP server requires authentication */
$g_smtp_username    = '';  # user
$g_smtp_password    = '';  # password

/**
 * This control the connection mode to SMTP server. 
 * Can be '', 'ssl','tls'
 * @global string $g_smtp_connection_mode
 */
$g_smtp_connection_mode = '';

/**
 * The smtp port to use.  The typical SMTP ports are 25 and 587.  The port to use
 * will depend on the SMTP server configuration and hence others may be used.
 * @global int $g_smtp_port
 */
$g_smtp_port = 25;   
?>
GunnarD

Re: Creating custom_config.inc.php for email breaks TestLink

Post by GunnarD »

At the first line put a space or newline between php and //

Something like this:

Code: Select all

    <?php
    // ----------------------------------------------------------------------------
    /* [SMTP] */

    /**
     * @var string SMTP server name or IP address ("localhost" should work in the most cases)
     * Configure using custom_config.inc.php
     * @uses lib/functions/email_api.php
     */
    $g_smtp_host        = '192.168.1.1';  # SMTP server MUST BE configured

    # Configure using custom_config.inc.php
    $g_tl_admin_email     = 'jstocks@gmail.com'; # for problem/error notification
    $g_from_email         = 'TestLink';  # email sender
    $g_return_path_email  = 'jstocks@gmail.com';

    /**
     * Email notification priority (low by default)
     * Urgent = 1, Not Urgent = 5, Disable = 0
     **/
    $g_mail_priority = 5;

    /**
     * Taken from mantis for phpmailer config
     * select the method to mail by:
     * PHPMAILER_METHOD_MAIL - mail()
     * PHPMAILER_METHOD_SENDMAIL - sendmail
     * PHPMAILER_METHOD_SMTP - SMTP
     */
    $g_phpMailer_method = PHPMAILER_METHOD_SMTP;

    /** Configure only if SMTP server requires authentication */
    $g_smtp_username    = '';  # user
    $g_smtp_password    = '';  # password

    /**
     * This control the connection mode to SMTP server.
     * Can be '', 'ssl','tls'
     * @global string $g_smtp_connection_mode
     */
    $g_smtp_connection_mode = '';

    /**
     * The smtp port to use.  The typical SMTP ports are 25 and 587.  The port to use
     * will depend on the SMTP server configuration and hence others may be used.
     * @global int $g_smtp_port
     */
    $g_smtp_port = 25;   
    ?>
68K
Advanced user
Posts: 22
Joined: Wed Sep 02, 2009 10:49 am

Re: Creating custom_config.inc.php for email breaks TestLink

Post by 68K »

Hi Gunnar -

That fixes the issue - thank you! :)

I didn't suspect that line; as I thought if it was wrong then the config would be broken. The email feature working suggested that the custom config had been accepted OK.
I should be more careful with details like this!

Thanks for the swift reply!
Post Reply