mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-09 22:00:14 +01:00
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:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user