Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chamilo 1.11.12 not sending Mails #3625

Open
atarallo opened this issue Nov 12, 2020 · 10 comments
Open

Chamilo 1.11.12 not sending Mails #3625

atarallo opened this issue Nov 12, 2020 · 10 comments

Comments

@atarallo
Copy link

Description
We're testing Chamilo 1.11.12 on Centos 8.2 with PHP 7.2. The SMTP configuration was copied exactly from our production site. Our production site runs Chamilo 1.11.10 on Centos 7.8 with PHP 7.1. On both cases we use SMTP as mail transport, connecting to our corporate email server.

We tested Conectivity (Telnet) and we can send authenticated emails from the comand line of the test server. We discovered on the logs of php/fpm te following errors:

 _[DD-Nov-2020 HH:MM:ss Timezone] ERROR: mail not sent to user, surname (user@domain)  because of SMTP connect() failed. http://github.com/PHPMailer/wiki/Troubleshooting_

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Course, an email notification should be sent

  2. Create a new Announcement.

Expected behavior
An email should be received when courses or announces are created

Desktop (please complete the following information):

  • OS: Linux and Windows 7/10
  • Browser Chrome

**Server

  • OS: Centos 8.2
  • Version of Chamilo: 1.11.12
  • Version of PHP: 7.2

Additional context
We've comparing both production and testing. Notices that PHPmailer is present, but in different paths of the installation of chamilo. It seems to us that is not the same version or different/missing files

@atarallo
Copy link
Author

We did further investigation. And managed to get mail notifications working.

On file: ${CHAMILO_ROOT_DIR}/vendor/phpmailer/phpmailer/src/PHPMailer.php changed to:

                             public $SMTPAutoTLS = false;  // It was set true

On file ${CHAMILO_ROOT_DIR}/app/config/mail.conf.php we did some changes, was no taking the name and email of the administrator to send notifications.

$platform_email['SMTP_FROM_EMAIL'] = (isset($administrator['email']) ? $administrator['email'] : '[email protected]');

$platform_email['SMTP_FROM_NAME'] = (isset($administrator['name']) ? $administrator['name'] : ' Chamilo administrator NAME');

We're willling to help to fix this bugs. We invested a lot of time investigating this. And deep dived on chamilo code, more than we intended to.

@spacecabbie
Copy link

Hi thanks for the feedback but I think you missed this entry in the documents:
https://docs.chamilo.org/admin-guide/appendix/frequently_asked_questions/sending_e-mails_from_the_platform_doesnt_work
So If you are using a external SMTP server then you need to set up its settings like explain above editing in vendor is not recommended since it wil be overwritten with updates. If you use a local smtp server or sendmail then this is quite odd and I recommend to look into /var/log/exim/mainlog

@ywarnier
Copy link
Member

@atarallo we've updated the (previously very old) version of PHPMailer in 1.11.12, which might have caused the issue on your server. I do agree with @spacecabbie that there is a chance your SMTP_AUTH setting in mail.conf.php was set to 1 although the SMTP server did not require authentication and did not use TLS.
Is there any chance you could confirm that in the next few days so we can move forward with finding a better config for all?

SMTPAutoTLS is only used once in the PHPMailer.php library, on this line:

                    //Automatically enable TLS encryption if:
                    // * it's not disabled
                    // * we have openssl extension
                    // * we are not already using SSL
                    // * the server offers STARTTLS
                    if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) {
                        $tls = true;
                    }

Which only sets $tls to true if $secure is different from ssl, $secure being obtained from $this->SMTPSecure which is defined (through api_mail_html() in Chamilo) as the $platform_email['SMTP_SECURE'] setting from mail.conf.php.

So in short, if you set $platform_email['SMTP_SECURE'] to anything else than ssl, then it considers it is tls, not without first checking if the SMTP server answers something about STARTTLS...

Anyway, I think there could be something added to the default mail.conf.php as extra documentation, but I would need more information about the exact configuration of your own mail.conf.php in order to add the right documentation.

@atarallo
Copy link
Author

Hi !!!

As stated before, the file mail.conf.php was copied from the production server. The $platform_email['SMTP_SECURE'] is commented. This puzzled us, the onsite admin further investigated and found the "hack" of changing the value in PHPMailer to make mails go out.

We also found that $platform_email['SMTP_FROM_EMAIL'] does not take $administrator[´email] even though its defined, Same situation with $platform_email['SMTP_FROM_MAIL'] .

This is not the first bug we found when installing this version of chamillo. We found duplicated functions as commented in bug #3523

Feel free to ask if need further details, I have to forward to the site admins.

@R0sy
Copy link

R0sy commented May 17, 2021

Hello, I have the same problem, could you help me by indicating how to solve it, in advance thank you very much for the contribution.

@atarallo
Copy link
Author

atarallo commented May 18, 2021 via email

@R0sy
Copy link

R0sy commented May 18, 2021

Good morning, in my case I have the same problem regarding the sending of notifications by email, since it only sends them to the administrator's email but if it is tried with other users, the message does not arrive, the version of chamilo installed is 1.11. 12 on a server with Ubuntu operating systems.
It doesn't even send the username and password.
I hope you can help me with my problem, below I share the log that appears when I try to send a message:

May 18 16:20:01 sm-msp-queue [8824]: My unqualified host name (ip-192-168-10-24) unknown; sleeping for retry
May 18 16:21:01 sm-msp-queue [8824]: unable to qualify my own domain name (ip-192-168-10-24) - using short name

@Gazzxy
Copy link

Gazzxy commented Jul 22, 2021

can there just be a way to Edit the mailer settings in the admin page? this is literally the only thing we run on our server where I have to go rummaging around for files to have it maybe work and its highly frustrating.

@ywarnier
Copy link
Member

@Gazzxy this is in the roadmap for future releases. It's annoying for us too, but the files management, the languages management and the fact that we don't accept structural changes between minor versions has slowed this down considerably.

@Gazzxy
Copy link

Gazzxy commented Jul 22, 2021

heh fair enough... am at the stage where it looks right... sounds right.. but don't think its working.. and well its too hot in this office so ran outa the ability to care for today :(

christianbeeznest added a commit to christianbeeznest/chamilo-lms that referenced this issue Jan 14, 2025
christianbeeznest added a commit that referenced this issue Jan 14, 2025
Exercise: Add multi-delete with checkboxes in reporting page - refs #3625
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants