RHEL 8.7 + Postgreyでエラー

RHEL 8.7にアップデートしたら、なんかPostfixくんがメールを受信しなくなった。/var/log/maillogを見るとエラー出てる。

Nov 15 17:26:07 www postfix/smtpd[30419]: discarding EHLO keywords: CHUNKING
Nov 15 17:26:07 www postfix/spawn[29473]: warning: command /usr/bin/python3 exit status 1
Nov 15 17:26:07 www postfix/smtpd[30432]: warning: premature end-of-input on private/policy while reading input attribute name
Nov 15 17:26:07 www postfix/spawn[29467]: warning: command /usr/bin/python3 exit status 1
Nov 15 17:26:07 www postfix/smtpd[30414]: warning: premature end-of-input on private/policy while reading input attribute name
Nov 15 17:26:07 www postfix/spawn[30441]: warning: command /usr/bin/python3 exit status 1
Nov 15 17:26:07 www postfix/smtpd[30416]: warning: premature end-of-input on private/policy while reading input attribute name
Nov 15 17:26:07 www postfix/spawn[28907]: warning: command /usr/bin/python3 exit status 1
Nov 15 17:26:07 www postfix/smtpd[30419]: warning: premature end-of-input on private/policy while reading input attribute name
Nov 15 17:26:07 www postfix/spawn[29473]: warning: command /usr/bin/python3 exit status 1
Nov 15 17:26:07 www postfix/smtpd[30409]: warning: premature end-of-input on private/policy while reading input attribute name

んー、policydか???ということで、/usr/libexec/postfix/policyd-spfを実行してみる。

# /usr/libexec/postfix/policyd-spf
Traceback (most recent call last):
  File "/usr/libexec/postfix/policyd-spf", line 11, in <module>
    load_entry_point('spf-engine==2.9.3', 'console_scripts', 'policyd-spf')()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
    return self.resolve()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.6/site-packages/spf_engine/__init__.py", line 54, in <module>
    import authres
ModuleNotFoundError: No module named 'authres'

「authresモジュールが無いから、わし、よう仕事せえへん」言うてる。

>>> help("modules")

Please wait a moment while I gather a list of all available modules...

834 INFO: Opening SELinux policy "//etc/selinux/targeted/policy/policy.31"
926 INFO: Successfully opened SELinux policy "//etc/selinux/targeted/policy/policy.31"
DNS                 binhex              itertools           semanage
OpenSSL             bisect              josepy              seobject
PyInstaller         blessed             json                sepolgen
SSSDConfig          bs4                 keyword             sepolicy
__future__          builtins            lib2to3             setools
_ast                bz2                 libcomps            setroubleshoot
_asyncio            cProfile            libdnf              setuptools
_audit              cairo               librepo             shelve
_bisect             calendar            libxml2             shlex
_blake2             certbot             libxml2mod          shutil
_bootlocale         cffi                linecache           signal
_bz2                cgi                 locale              sim_plugin
_cffi_backend       cgitb               logging             site
_codecs             chardet             lsm                 six
_codecs_cn          chunk               lxml                slip
_codecs_hk          cloud_what          lzma                smtpd
_codecs_iso2022     cmath               macpath             smtplib
_codecs_jp          cmd                 macurl2path         sndhdr
_codecs_kr          code                magic               socket
_codecs_tw          codecs              mailbox             socketserver
_collections        codeop              mailcap             socks
_collections_abc    collections         marshal             sockshandler
_compat_pickle      colorsys            math                sos
_compression        compileall          mimetypes           spf
_crypt              concurrent          mmap                spf_engine
_csv                configargparse      modulefinder        spwd
_ctypes             configobj           multiprocessing     sqlite3
_curses             configparser        netrc               sre_compile
_curses_panel       contextlib          networkx            sre_constants
_datetime           copy                nftables            sre_parse
_dbm                copyreg             nis                 ssl
_dbus_bindings      crypt               nntplib             stat
_dbus_glib_bindings cryptography        ntpath              statistics
_decimal            cssselect           nturl2path          string
_dummy_thread       csv                 numbers             stringprep
_elementtree        ctypes              opcode              struct
_functools          curses              operator            subprocess
_gdbm               datetime            optparse            subscription_manager
_gv                 dateutil            os                  sunau
_hashlib            dbm                 ossaudiodev         symbol
_heapq              dbus                parsedatetime       symtable
_hmacopenssl        decimal             parser              sys
_imp                decorator           pathlib             sysconfig
_io                 difflib             pdb                 syslog
_json               dis                 perf                syspurpose
_locale             distro              pexpect             systemd
_lsprof             distutils           pickle              tabnanny
_lzma               dmidecode           pickletools         tarfile
_markupbase         dmidecodemod        pip                 telnetlib
_multibytecodec     dnf                 pipes               tempfile
_multiprocessing    dnfpluginscore      pkg_resources       termios
_opcode             doctest             pkgutil             test
_operator           drv_libxml2         platform            text_unidecode
_osx_support        dummy_threading     plistlib            textwrap
_pickle             easy_install        ply                 this
_posixsubprocess    editor              podman              threading
_pydecimal          email               poplib              time
_pyinstaller_hooks_contrib encodings           posix               timeit
_pyio               ensurepip           posixpath           token
_random             enum                pprint              tokenize
_selinux            errno               procfs              trace
_semanage           ethtool             profile             traceback
_sha3               faker               pstats              tracemalloc
_signal             faulthandler        psutil              tracer
_sitebuiltins       fcntl               psycopg2            tty
_socket             filecmp             pty                 tuned
_sqlite3            fileinput           ptyprocess          types
_sre                firewall            pwd                 typing
_ssl                fnmatch             py_compile          typing_extensions
_stat               formatter           pyclbr              udica
_string             fractions           pycparser           unbound
_strptime           ftplib              pydbus              unboundmodule
_struct             functools           pydoc               unicodedata
_symtable           gc                  pydoc_data          unittest
_sysconfigdata_dm_linux_x86_64-linux-gnu genericpath         pyexpat             urllib
_sysconfigdata_m_linux_x86_64-linux-gnu getopt              pygtkcompat         urllib3
_testmultiphase     getpass             pyinotify           uu
_thread             gettext             pyrfc3339           uuid
_threading_local    gi                  pytoml              validate
_tracemalloc        glob                pytz                vdo
_unbound            gpg                 pyudev              venv
_version            grp                 queue               warnings
_warnings           gv                  quopri              wave
_weakref            gzip                random              wcwidth
_weakrefset         hashlib             rct                 weakref
_yaml               hawkey              re                  webbrowser
abc                 heapq               readchar            webencodings
acme                hmac                readline            wheel
aifc                html                reprlib             wsgiref
altgraph            html5lib            requests            xdg
antigravity         http                requests_toolbelt   xdrlib
argparse            idna                resource            xml
array               imaplib             rhsm                xmlrpc
ast                 imghdr              rhsm_debug          xxlimited
asynchat            imp                 rhsmlib             xxsubtype
asyncio             importlib           rlcompleter         yaml
asyncore            importlib_metadata  rpm                 yapf
atexit              iniparse            runpy               yapftests
audioop             inquirer            sched               zipapp
audit               insights_client     schedutils          zipfile
auparse             inspect             secrets             zipimport
base64              io                  select              zipp
bdb                 ipaddress           selectors           zlib
binascii            isc                 selinux             

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".

無いな…。

# dnf --enablerepo=epel -y install python3-authres
# systemctl restart postgrey
# systemctl restart postfix

さて、原因は何かというと、上述のエラーの最後にある__init__.pyが読み込もうとしているauthresモジュールが無いとのことだから、

File "/usr/lib/python3.6/site-packages/spf_engine/__init__.py", line 54, in <module>
    import authres
ModuleNotFoundError: No module named 'authres'

この__init__.pyはどのパッケージからインストールされているかというと、

# rpm -qf /usr/lib/python3.6/site-packages/spf_engine/__init__.py 
pypolicyd-spf-2.9.3-1.el8.noarch

なので、pypolicyd-spfならSPECファイルのRequiresに追加するか、

--- pypolicyd-spf.spec.old	2022-11-15 17:48:32.191632367 +0900
+++ pypolicyd-spf.spec	2022-11-15 17:48:59.231345858 +0900
@@ -12,7 +12,7 @@
 Patch0:         pypolicyd-spf-2.9.3-service.patch
 
 BuildArch:      noarch
-Requires:       postfix, python3-pyspf
+Requires:       postfix, python3-pyspf, python3-authres
 BuildRequires:  python3-devel
 BuildRequires:  python3-setuptools
 BuildRequires:  systemd

python3-pyspfのSPECファイルのRequiresに追加すべき。

というところまで解析したところで、bugzillaを見る。あるじゃんwww

タイトルとURLをコピーしました