When you send an email, you email client (normally Roundcube), has to pass authentication checks.
Roundcube does not need authentication from the SMTP server as it is running on the same computer, but EHCP force has been set up that way.
When Roundcube attempts to send an email, it uses the same credentials that you used to log in, however the SMTP server would be happy to send your email from Roundcube without it specifying a user name and password.
For SMTP auth (sending emails), EHCP force uses the Simple Authentication and Security Layer Authentication Daemon.
We tend to called this daemon saslauthd.
You should be aware that saslauthd is old and very flaky, and these days no longer widely used.
So, if you still cannot send emails, the first thing we can do is tell Roundcube not to specify a user name or password when sending, this can be done by entering these two simple commands in PuTTY using your PC.
sudo sed -i "s/'%u';/'';/g" /etc/roundcube/config.inc.php
sudo sed -i "s/'%p';/'';/g" /etc/roundcube/config.inc.php

Now, regardless of what saslauthd is doing you will always be able to send emails via Roundcube.
In order to fix saslauthd, the old smtp auth fixing scrips is still available to use.
To download the script, enter this command using you PC and PuTTY.
wget https://downloads.ghostnetwork.co.uk/scripts/ehcpforce/2404/smtpauthfixv2.sh

Give the script permission to execute using this command.
sudo chmod +x smtpauthfixv2.sh

In order to run the script, use this command.
sudo bash smtpauthfixv2.sh


If everything goes to plan, this is what you should see.

The script first tests the saslauthd service, and then assuming it is not working it performs the required fixes.
Finally it should report that the script was successful to the user.
Issues that may occur with the SMTP auth fix Script.
The chances are, you will not have any problems with the script, however if you do here are some of the things that can go wrong.
1. The apt system is locked out by another process.
On some very rare occasions there can be a problem where the script appears to get stuck, this is a problem with the apt system getting locked out by another process, it is very rare though.
Please allow at least 8 minutes before you take any action.
If after about 8 minutes the script still has not completed, you can press control and z to stop the script, then reboot your server using this command.
sudo shutdown -r now (only run this command, if you have problems, as above)
When the system reboots, again using PuTTY enter this command.
sudo dpkg --configure -a (only run this command, if you have problems, as above)
The system should then tell you what the problem is.
If it asks you about a configuration file, you should select the appropriate option to keep the existing file, then run the script again.
2. The saslauthd service is already running.
If the script tells you that SMTP is ok, it means that the saslauthd service is probably running.
If the script tells you SMTP auth is ok, but you still find you are unable to send emails, then you can run the script again in “force” mode.
This will force to script to fix SMTP auth even though saslauthd appears to be ok, to do this use this command in PuTTY.
sudo bash smtpauthfixv2.sh force (only run this command, if you have problems, as above)
3. An unknown error with SMTP auth.
There is a very high probability that the script will have no problem fixing SMTP auth, however if the script does not fix it, as a last resort you can run the script in “courier” mode.
This would mean that the script would resort to the Courier authdaemon, and remove saslauthd from your server.
To run the script in Courier authdaemon mode, enter this command in PuTTY.
sudo bash smtpauthfixv2.sh courier (only run this command, if you have problems, as above)
That’s it, we are done here.