Python-Fehler in der Postfix Policyd-spf-Konfiguration: „Warnung: Problem bei der Kommunikation mit dem Server private/policyd-spf“

Python-Fehler in der Postfix Policyd-spf-Konfiguration: „Warnung: Problem bei der Kommunikation mit dem Server private/policyd-spf“

Implementierung pypolicyd-spfder Unterstützung in Postfix 3.3.1 aufRHEL 8, folgender Fehler ist aufgetreten in /var/log/maillog:

spawn[xxxx]: fatal: spawn_comand: execvp /usr/bin/python: No such file or directory
postfix/spawn[xxxx]: warning: command /usr/bin/python exit status 1
spawn[xxxx]: fatal: spawn_comand: execvp /usr/bin/python: No such file or directory
postfix/spawn[xxxx]: warning: command /usr/bin/python exit status 1
postfix/smtpd[xxxx]: warning: problem talking to server private/policyd-spf: Connection reset by peer

Es kann kein Pfadproblem sein, da der BenutzerPostfixhat keinen Pfad:

$ getent passwd postfix
postfix:x:89:89::/var/spool/postfix:/sbin/nologin

Wo beheben Sie das?

Antwort1

PROBLEM:

Auf den ersten Blick schien es sich um ein Pfadproblem zu handeln, aber das war nicht der Fall.Policyd-spfbenötigt einRICHTIGabsoluter Pfad zum Auffinden von Python darinPostfixin der master.cfKonfiguration.

Der Weg, den ich ursprünglich gegangen war,Ich glaube, ich habe es aus einem HowTo irgendwo im Internet kopiert- in der master.cfIntegration war:

policyd-spf unix - n n - 0 spawn user=nobody argv=/usr/bin/python /usr/libexec/postfix/policyd-spf

War nah dran, hat aber nichts genützt: Der angegebene Pfad zu Python argventhielt nicht die Versionsnummer, daher wurden Fehler ausgegeben.

LÖSUNG:

Erste: Finden Sie heraus, wo Python lebt. InRHEL 8.1, Ich verstehe:

whereis python
python: /usr/bin/python3.6 /usr/bin/python3.6m /usr/lib/python3.6 /usr/lib64/python3.6 /usr/include/python3.6m /usr/share/man/man1/python.1.gz

Zweite: Liefern Sie eineRichtigabsoluter Pfad zu Python imPolicyd-spfKonfiguration in /etc/postfix/master.conf:

policyd-spf unix - n n - 0 spawn user=nobody argv=/usr/bin/python3.6 /usr/libexec/postfix/policyd-spf

Endlich, starten Sie Postfix neu:

systemctl restart postfix

ABSCHLUSS:

Jagen Sie nicht Ihrem Schwanz hinterher, wenn Sie Pfadprobleme untersuchen, und dies ist kein Problem, das spezifisch ist fürRHEL 8entweder. Der Fehler wird im absoluten Pfad zu Python vergraben, der imPolicyd-spfKonfiguration inmaster.cf

verwandte Informationen