Skip to content

Commit cc9d830

Browse files
committed
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
1 parent abc901f commit cc9d830

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

install/install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,10 +1018,10 @@ def install_postfix_dovecot(self):
10181018
command = 'dnf --nogpg install -y https://mirror.ghettoforge.net/distributions/gf/gf-release-latest.gf.el8.noarch.rpm'
10191019
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
10201020

1021-
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
1021+
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql cyrus-sasl-plain -y'
10221022
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
10231023
elif self.distro == openeuler:
1024-
command = 'dnf install postfix -y'
1024+
command = 'dnf install postfix cyrus-sasl-plain -y'
10251025
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
10261026

10271027
else:

plogical/mailUtilities.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,12 @@ def SaveEmailLimitsNew(tempPath):
17071707
@staticmethod
17081708
def configureRelayHost(smtpHost, smtpPort, smtpUser, smtpPassword):
17091709
try:
1710+
## Ensure cyrus-sasl-plain is installed (required for SASL PLAIN auth on RHEL/Alma/CentOS)
1711+
if os.path.exists('/etc/redhat-release'):
1712+
ProcessUtilities.executioner('dnf install -y cyrus-sasl-plain')
1713+
elif os.path.exists('/usr/bin/apt-get'):
1714+
ProcessUtilities.executioner('apt-get install -y libsasl2-modules')
1715+
17101716
postfixPath = '/etc/postfix/main.cf'
17111717

17121718
with open(postfixPath, 'r') as f:

plogical/upgrade.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2857,6 +2857,11 @@ def setupSieve():
28572857
Upgrade.stdOut("Dovecot not installed, skipping Sieve setup.", 0)
28582858
return
28592859

2860+
## Ensure cyrus-sasl-plain is installed (needed for SMTP relay on RHEL/Alma/CentOS)
2861+
if os.path.exists('/etc/redhat-release'):
2862+
command = 'dnf install -y cyrus-sasl-plain'
2863+
ProcessUtilities.executioner(command)
2864+
28602865
import re
28612866

28622867
dovecot_conf = '/etc/dovecot/dovecot.conf'

0 commit comments

Comments
 (0)