Fix SMTP relay on AlmaLinux/RHEL: install cyrus-sasl-plain package

Postfix SASL PLAIN auth fails with "No worthy mechs found" on
RHEL/AlmaLinux because cyrus-sasl-plain is not installed by default.
- Add cyrus-sasl-plain to postfix install in install.py
- Auto-install in configureRelayHost() for existing servers
- Add to upgrade.py setupSieve() for existing installations
This commit is contained in:
usmannasir
2026-03-06 18:36:41 +05:00
parent abc901f1c8
commit cc9d830507
3 changed files with 13 additions and 2 deletions

View File

@@ -1018,10 +1018,10 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
command = 'dnf --nogpg install -y https://mirror.ghettoforge.net/distributions/gf/gf-release-latest.gf.el8.noarch.rpm'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql cyrus-sasl-plain -y'
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
elif self.distro == openeuler:
command = 'dnf install postfix -y'
command = 'dnf install postfix cyrus-sasl-plain -y'
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
else:

View File

@@ -1707,6 +1707,12 @@ LogFile /var/log/clamav/clamav.log
@staticmethod
def configureRelayHost(smtpHost, smtpPort, smtpUser, smtpPassword):
try:
## Ensure cyrus-sasl-plain is installed (required for SASL PLAIN auth on RHEL/Alma/CentOS)
if os.path.exists('/etc/redhat-release'):
ProcessUtilities.executioner('dnf install -y cyrus-sasl-plain')
elif os.path.exists('/usr/bin/apt-get'):
ProcessUtilities.executioner('apt-get install -y libsasl2-modules')
postfixPath = '/etc/postfix/main.cf'
with open(postfixPath, 'r') as f:

View File

@@ -2857,6 +2857,11 @@ CREATE TABLE `websiteFunctions_backupsv2` (`id` integer AUTO_INCREMENT NOT NULL
Upgrade.stdOut("Dovecot not installed, skipping Sieve setup.", 0)
return
## Ensure cyrus-sasl-plain is installed (needed for SMTP relay on RHEL/Alma/CentOS)
if os.path.exists('/etc/redhat-release'):
command = 'dnf install -y cyrus-sasl-plain'
ProcessUtilities.executioner(command)
import re
dovecot_conf = '/etc/dovecot/dovecot.conf'