Browse Source

Update e-mail tester script to only show if the test directory is there (representative of a development platform or platform managed by a developer). Add documentation - refs CT#8308

Yannick Warnier 8 years ago
parent
commit
d4f7a9cda6
3 changed files with 8 additions and 2 deletions
  1. 1 1
      app/config/mail.conf.dist.php
  2. 3 1
      main/admin/index.php
  3. 4 0
      main/inc/lib/message.lib.php

+ 1 - 1
app/config/mail.conf.dist.php

@@ -10,7 +10,7 @@ $platform_email['SMTP_FROM_EMAIL'] = (isset($administrator['email']) ? $administ
 $platform_email['SMTP_FROM_NAME'] = (isset($administrator['name']) ? $administrator['name'] : 'Admin');
 $platform_email['SMTP_HOST'] = 'localhost';
 $platform_email['SMTP_PORT'] = 25;
-$platform_email['SMTP_MAILER'] = 'sendmail'; // mail, sendmail or smtp
+$platform_email['SMTP_MAILER'] = 'mail'; // mail, sendmail or smtp (Windows probably only supports smtp)
 $platform_email['SMTP_AUTH'] = 0;
 $platform_email['SMTP_USER'] = '';
 $platform_email['SMTP_PASS'] = '';

+ 3 - 1
main/admin/index.php

@@ -337,7 +337,9 @@ if (api_is_platform_admin()) {
 
     $items[] = array('url' => 'archive_cleanup.php', 'label' => get_lang('ArchiveDirCleanup'));
     $items[] = array('url' => 'resource_sequence.php', 'label' => get_lang('ResourcesSequencing'));
-    $items[] = ['url' => 'email_tester.php', 'label' => get_lang('EMailTester')];
+    if (is_dir(api_get_path(SYS_TEST_PATH))) {
+        $items[] = ['url' => 'email_tester.php', 'label' => get_lang('EMailTester')];
+    }
 
     if (api_get_configuration_value('db_manager_enabled') == true && api_is_global_platform_admin()) {
         $host = $_configuration['db_host'];

+ 4 - 0
main/inc/lib/message.lib.php

@@ -1890,6 +1890,10 @@ class MessageManager
 
     /**
      * Get the error log from failed mailing
+     * This assumes a complex setup where you have a cron script regularly copying the mail queue log
+     * into app/cache/mail/mailq.
+     * This can be done with a cron command like (check the location of your mail log file first):
+     * @example 0,30 * * * * root cp /var/log/exim4/mainlog /var/www/chamilo/app/cache/mail/mailq
      * @return array|bool
      */
     public static function failedSentMailErrors()