Why Chamilo mail stalls or lands in spam
Chamilo sends a steady stream of transactional messages: account creation notices, password resets, course enrollment confirmations, assignment submission alerts, and announcement digests. When those messages stop arriving, the cause is almost never a bug in the LMS. On managed shared hosting running LiteSpeed on AlmaLinux and CloudLinux, the failure usually comes down to how Chamilo hands mail to the transport layer and whether the sending domain is authorized to speak on its own behalf.
By default Chamilo uses PHP's internal mail path through the bundled PHPMailer library. That path works for low volume, but mail injected directly by PHP often carries a sender envelope that does not match your real cPanel or DirectAdmin domain. Receiving servers at Gmail, Outlook, and Yahoo then see a message claiming to be from your domain while the authentication records fail to confirm it, and they quietly route everything to spam or reject it outright. The symptom you notice is inconsistent: some users get mail, others never do, and password resets appear broken.
The second common failure is an outbound SMTP block. Many shared hosts restrict raw connections to remote ports 25, 465, and 587 to curb abuse. If you configure Chamilo to talk to an external relay without confirming the port is open, the connection times out and the LMS silently drops the message. You will only see evidence of this if you look in the right log, which on Chamilo is the application error log plus your account-level PHP log.
Before changing anything, confirm whether mail is leaving the server at all. In cPanel open Email > Track Delivery, or in DirectAdmin open E-Mail Manager > Mail Queue. If you see Chamilo messages queued or deferred with authentication errors, the problem is sender or SMTP configuration. If nothing appears at all, Chamilo never successfully handed the message off, which points to a PHP-level error you will find in main/configuration.php settings or the local error_log.
Configuring authenticated SMTP in Chamilo
The most reliable setup on shared hosting is to create a real mailbox on your own domain and have Chamilo authenticate against the local mail server as that user. This keeps the envelope sender, the authenticated account, and the visible From address all aligned to the same domain, which is exactly what spam filters want to see.
First create the mailbox. In cPanel go to Email > Email Accounts > Create and add something like lms@yourdomain.com with a strong password. In DirectAdmin use E-Mail Manager > E-Mail Accounts > Create Account. Note the password; you will need it in the LMS configuration.
Chamilo stores mail transport settings in main/configuration.php at the root of your installation. Open it with cPanel File Manager (or DirectAdmin File Manager), right-click and choose Edit. Locate or add the mail block and set the constants to use authenticated SMTP against localhost:
// Mail transport configuration in main/configuration.php
$platform_email['SMTP_FROM_EMAIL'] = 'lms@yourdomain.com';
$platform_email['SMTP_FROM_NAME'] = 'Your LMS Name';
$platform_email['SMTP_HOST'] = 'localhost';
$platform_email['SMTP_PORT'] = 587;
$platform_email['SMTP_USER'] = 'lms@yourdomain.com';
$platform_email['SMTP_PASS'] = 'the-mailbox-password';
$platform_email['SMTP_AUTH'] = 1;
$platform_email['SMTP_SECURE'] = 'tls';
$platform_email['SMTP_UNIQUE_SENDER'] = 1;
$platform_email['SMTP_UNIQUE_REPLY_TO'] = 1;
Using localhost sidesteps the outbound port block entirely, because the connection never leaves the server. The SMTP_UNIQUE_SENDER flag forces every outgoing message to use your authenticated From address rather than the student's address, which is what prevents forged-sender rejections. If your host requires SSL on port 465 instead, set SMTP_PORT to 465 and SMTP_SECURE to 'ssl'.
Next confirm the administrator contact address inside the LMS itself. Log in as platform admin, go to Administration > Configuration settings > Platform, and check the Administrator e-mail and Institution fields. These feed the Reply-To and bounce handling. Keep the administrator address on the same domain as the SMTP sender so nothing in the headers contradicts the authenticated account.
After saving, send a test. Trigger a password reset for a test account or create a new user account to force Chamilo to send immediately. Then check Track Delivery in cPanel for a 250 acceptance line against your test recipient.
SPF, DKIM, and DMARC alignment
Authenticated SMTP gets the message out of Chamilo cleanly, but inbox placement depends on DNS records that tell receiving servers your domain authorized the mail. On managed shared hosting these records are usually created for you, but a domain using external DNS (Cloudflare, a registrar's nameservers) often has them missing. Verify each one.
The SPF record authorizes the hosting server's IP to send for your domain. In cPanel open Email > Email Deliverability; it audits SPF, DKIM, and the PTR status and shows a Repair button when something is misaligned. In DirectAdmin open DNS Management for the domain and confirm a TXT record resembling:
yourdomain.com. IN TXT "v=spf1 +a +mx include:yourhost.example +ip4:SERVER_IP ~all"DKIM cryptographically signs outbound mail so the receiver can confirm it was not altered and genuinely came from your domain. Email Deliverability in cPanel generates and publishes the DKIM key automatically; if your domain uses external DNS, cPanel will display the exact TXT record value to copy into that provider's zone. DKIM is the single highest-impact record for landing in the inbox, so do not skip it.
DMARC ties SPF and DKIM together and tells receivers what to do when checks fail. Start with a monitoring policy so legitimate Chamilo mail is never dropped while you confirm alignment:
_dmarc.yourdomain.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com; fo=1"Leave the policy at p=none for a week, review the aggregate reports that arrive at the rua address, and only tighten to p=quarantine once you confirm Chamilo mail passes both SPF and DKIM from the sending domain. Because your SMTP sender, your admin address, and these DNS records all reference the same domain, alignment holds and messages pass DMARC cleanly.
Queue handling, logs, and stubborn delivery issues
Chamilo does not run a persistent mail daemon of its own; it hands each message to the local mail server, which queues and retries delivery. Large announcement broadcasts to an entire course can therefore pause mid-send if your account hits its hourly outbound limit. On shared hosting that limit protects server reputation, so splitting large announcements into smaller groups avoids tripping it. Watch the queue in cPanel Track Delivery or DirectAdmin Mail Queue; deferred messages with a temporarily rejected note usually mean the limit, not a configuration fault.
When mail silently fails, read the logs in order. Chamilo writes PHP errors to an error_log file in the installation directory and under app/logs/ on newer versions; open these in File Manager and search for SMTP or PHPMailer. A line mentioning connection refused on port 587 means your SMTP_HOST is pointing at a blocked external relay, so switch it to localhost. A line mentioning authentication failed means the mailbox password in main/configuration.php is wrong or the mailbox was never created.
If your PHP version is older, outdated TLS libraries can break the SMTP handshake. Open cPanel Select PHP Version (or DirectAdmin PHP Selector) and move the domain to a currently supported PHP 8.1 or 8.2 build, then enable the openssl and mbstring extensions that PHPMailer depends on. You can raise the mail-sending memory headroom per site without touching server files by adding a .user.ini in the Chamilo root:
; .user.ini in the Chamilo installation root
memory_limit = 256M
max_execution_time = 120
Finally, if a specific external recipient never receives mail while others do, check the bounce messages delivered to your lms@yourdomain.com mailbox. Those bounces carry the exact rejection reason from the receiving server and often point to a missing DKIM signature or a stale SPF record, which closes the loop back to the DNS steps above.