CONTENTS


Lastmodified 2024-05-17 (金) 17:58:14


FreeBSD 13.0-RELEASE-p1 (GENERIC) へ /usr/ports/mail/mailman3 をインストール・移行・稼働したい。

現状:

ja-mailman:2.1.14.j7_6,1 
Apache/2.4.48 (FreeBSD) 
Postfix(3.6.1)

https://lab.uberspace.de/guide_mailman-3.html

Mailman3.1.1

py37-mailman-3.3.1

cd /usr/ports/mail/mailman3
make install clean

Installing py37-mailman-3.3.1...
pkg-static: py37-mailman-3.3.1 conflicts with ja-mailman-2.1.14.j7_6,1 (installs files into the same place).  Problematic file: /usr/local/etc/rc.d/mailman
*** Error code 1 [#x209bdf8]

Stop.
make: stopped in /usr/ports/mail/mailman3
root@smb212:/usr/ports/mail/mailman3:21_06_01:17:56 # pkg delete  ja-mailman-2.1.14.j7_6,1
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        ja-mailman: 2.1.14.j7_6,1

Number of packages to be removed: 1

The operation will free 31 MiB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling ja-mailman-2.1.14.j7_6,1...
You may need to manually remove /usr/local/mailman/Mailman/mm_cfg.py if it is no longer needed.
---> Starting deinstall script
---> Crontab for "mailman" modified, not removed: please deinstall
---> it manually if you no longer wish to use Mailman. E.g.:
--->     /usr/bin/crontab -u "mailman" -r
---> Preserving the "last_mailman_version" file
cd /usr/ports/mail/mailman3
make install clean
===>  Installing for py37-mailman-3.3.1
===>  Checking if py37-mailman is already installed
===>   Registering installation for py37-mailman-3.3.1
Installing py37-mailman-3.3.1...
===> Creating groups.
Using existing group 'mailman'.
===> Creating users
Using existing user 'mailman'.
===> Creating homedir(s)
To initialise Mailman's runtime directories, log files and database
for the first time, run

  service mailman info

You can then start Mailman by running:

  service mailman start

===>  Cleaning for py37-aiosmtpd-1.2_1
===>  Cleaning for py37-atpublic-1.0
          :                  :
===>  Cleaning for py37-mailman-3.3.1
===>  Cleaning for py38-mailman-3.3.1
 # service mailman info
Traceback (most recent call last):
  File "/usr/local/bin/mailman", line 10, in <module>
    from importlib.metadata import distribution
ModuleNotFoundError: No module named 'importlib.metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/mailman", line 13, in <module>
    from importlib_metadata import distribution
ModuleNotFoundError: No module named 'importlib_metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/mailman", line 15, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3242, in <module>
    @_call_aside
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'gunicorn' distribution was not found and is required by mailman

ModuleNotFoundError: No module named 'importlib.metadata'ということなので、

# portinstall devel/py-importlib-metadata

# service mailman info
Traceback (most recent call last):
  File "/usr/local/bin/mailman", line 33, in <module>
    sys.exit(load_entry_point('mailman==3.3.1', 'console_scripts', 'mailman')())
  File "/usr/local/bin/mailman", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/local/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 96, in load
    module = import_module(match.group('module'))
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/site-packages/mailman/bin/mailman.py", line 22, in <module>
    from mailman.config import config
  File "/usr/local/lib/python3.7/site-packages/mailman/config/__init__.py", line 20, in <module>
    from mailman.config.config import Configuration
  File "/usr/local/lib/python3.7/site-packages/mailman/config/config.py", line 27, in <module>
    from importlib_resources import path, read_text
ModuleNotFoundError: No module named 'importlib_resources'

# portinstall devel/py-importlib-resources

# service mailman info
Usage: mailman [OPTIONS] COMMAND [ARGS]...
Try 'mailman -h' for help.

Error: Invalid value for '-C' / '--config': File '/usr/local/mailman/etc/mailman.cfg' does not exist.

/usr/local/mailman 以下も何もインストールされておらず空っぽ。

1083 9:32 mkdir -p /usr/local/mailman/etc/

1084 9:33 touch /usr/local/mailman/etc/mailman.cfg

 # service mailman info
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 272, in endElementNS
    self.context.end()
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/config.py", line 345, in end
    self.stack.pop().finish()
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/config.py", line 452, in finish
    args = toargs(context, *self.argdata)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/config.py", line 794, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/fields.py", line 100, in fromUnicode
    v = vt.fromUnicode(s)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/fields.py", line 73, in fromUnicode
    value = self.context.resolve(name)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/config.py", line 151, in resolve
    mod = __import__(mname, *_import_chickens)
  File "/usr/local/lib/python3.7/site-packages/mailman/model/autorespond.py", line 25, in <module>
    from mailman.utilities.datetime import today
  File "/usr/local/lib/python3.7/site-packages/mailman/utilities/datetime.py", line 27, in <module>
    from mailman.testing import layers
  File "/usr/local/lib/python3.7/site-packages/mailman/testing/layers.py", line 49, in <module>
    from pkg_resources import resource_filename
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3242, in <module>
    @_call_aside
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'gunicorn' distribution was not found and is required by mailman

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/mailman", line 33, in <module>
    sys.exit(load_entry_point('mailman==3.3.1', 'console_scripts', 'mailman')())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 781, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 700, in make_context
    self.parse_args(ctx, args)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1212, in parse_args
    rest = Command.parse_args(self, ctx, args)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1048, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1630, in handle_parse_result
    value = invoke_param_callback(self.callback, ctx, self, value)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 123, in invoke_param_callback
    return callback(ctx, param, value)
  File "/usr/local/lib/python3.7/site-packages/mailman/bin/mailman.py", line 94, in initialize_config
    initialize(value)
  File "/usr/local/lib/python3.7/site-packages/mailman/core/initialize.py", line 217, in initialize
    initialize_1(config_path)
  File "/usr/local/lib/python3.7/site-packages/mailman/core/initialize.py", line 104, in initialize_1
    xmlconfig.string(read_text('mailman.config', 'configure.zcml'))
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 513, in string
    processxmlfile(f, context)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 295, in processxmlfile
    parser.parse(src)
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/ports/lang/python37/work/Python-3.7.10/Modules/pyexpat.c", line 471, in EndElement
  File "/usr/local/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 281, in endElementNS
    None, sys.exc_info()[2])
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/_compat.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 272, in endElementNS
    self.context.end()
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/config.py", line 345, in end
    self.stack.pop().finish()
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/config.py", line 452, in finish
    args = toargs(context, *self.argdata)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/config.py", line 794, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/fields.py", line 100, in fromUnicode
    v = vt.fromUnicode(s)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/fields.py", line 73, in fromUnicode
    value = self.context.resolve(name)
  File "/usr/local/lib/python3.7/site-packages/zope/configuration/config.py", line 151, in resolve
    mod = __import__(mname, *_import_chickens)
  File "/usr/local/lib/python3.7/site-packages/mailman/model/autorespond.py", line 25, in <module>
    from mailman.utilities.datetime import today
  File "/usr/local/lib/python3.7/site-packages/mailman/utilities/datetime.py", line 27, in <module>
    from mailman.testing import layers
  File "/usr/local/lib/python3.7/site-packages/mailman/testing/layers.py", line 49, in <module>
    from pkg_resources import resource_filename
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3242, in <module>
    @_call_aside
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "<string>", line 19.2-23.6
    DistributionNotFound: The 'gunicorn' distribution was not found and is required by mailman

https://qiita.com/HidKamiya/items/619ca56cee9a5005d5c4

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250362

https://translate.google.com/translate?hl=ja&sl=en&u=https://dan.langille.org/2020/11/&prev=search&pto=aue

# pkg install py37-gunicorn

すると、GNU Mailman 3.3.1 (Tom Sawyer)出ました。( ´ ▽ ` )ノ

root@smb212:/usr/local/mailman:21_06_11:11:52 # mailman info
GNU Mailman 3.3.1 (Tom Sawyer)
Python 3.7.10 (default, Jun 11 2021, 10:27:01)
[Clang 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c
config file: None
db url: sqlite:////usr/local/mailman/data/mailman.db
devmode: DISABLED
REST root url: http://localhost:8001/3.1/
REST credentials: restadmin:restpass

https://dan.langille.org/2020/11/25/missing-dependencies-from-mail-mailman3/

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250362

# ll
total 59
drwxr-xr-x   2 root  mailman   2 Jun 11 11:53 archives/
drwxr-xr-x   2 root  mailman   2 Jun 11 11:53 cache/
drwxr-xr-x   2 root  mailman   3 Jun 11 11:53 data/
drwxr-xr-x   2 root  mailman   3 Jun 11 11:53 etc/
drwxr-xr-x   2 root  mailman   3 Jun  8 09:33 etc_/
drwxr-xr-x   2 root  mailman   2 Jun 11 11:53 lists/
drwxr-xr-x   2 root  mailman   2 Jun 11 11:53 locks/
drwxr-xr-x   2 root  mailman   7 Jun 11 11:53 logs/
drwxr-xr-x   2 root  mailman   2 Jun 11 11:53 messages/
drwxr-xr-x  14 root  mailman  14 Jun 11 11:53 queue/
drwxr-xr-x   2 root  mailman   2 Jun 11 11:53 templates/
# chown -R mailman:mailman /usr/local/mailman/
# service mailman start
Starting Mailman's master runner
Generating MTA alias maps

mailman runner は起動できた( ´▽`)ノ

#top -a
3690 mailman       1  20    0    81M    67M select   1   0:03   0.01% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3689 mailman       1  20    0    81M    67M select   1   0:03   0.01% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3679 mailman       1  20    0    81M    67M select   1   0:03   0.01% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3686 mailman       1  20    0    81M    67M select   0   0:03   0.01% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3685 mailman       1  20    0    81M    67M select   0   0:03   0.01% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3681 mailman       1  20    0    81M    67M select   1   0:03   0.01% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3682 mailman       1  20    0    81M    67M select   1   0:03   0.01% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3687 mailman       1  20    0    87M    73M select   0   0:03   0.01% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3684 mailman       1  20    0    81M    67M select   0   0:03   0.01% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3683 mailman       2  20    0    86M    67M select   0   0:02   0.00% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3680 mailman       1  20    0    83M    69M select   1   0:02   0.00% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3669 mailman       1  52    0    81M    67M pause    1   0:01   0.00% /usr/local/bin/python3.7 /usr/local/bin/master -C /usr/local/lib/python3.7/site-packages
3688 mailman       1  20    0    81M    67M select   0   0:01   0.00% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3783 mailman       1  20    0    87M    73M select   0   0:00   0.00% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
3780 mailman       1  20    0    87M    73M select   0   0:00   0.00% /usr/local/bin/python3.7 /usr/local/bin/runner -C /usr/local/lib/python3.7/site-packages
:/usr/local/mailman # ll
total 230
drwxr-xr-x   8 mailman  mailman     13 Jun 22 11:40 .git/
-rw-r--r--   1 mailman  mailman    110 Jun 22 11:40 .gitignore
-rw-r--r--   1 mailman  mailman   1527 Jun 22 11:40 .gitlab-ci.yml
-rw-r--r--   1 mailman  mailman    166 Jun 22 11:40 .readthedocs.yml
-rw-r--r--   1 mailman  mailman  35148 Jun 22 11:40 COPYING
-rw-r--r--   1 mailman  mailman    527 Jun 22 11:40 MANIFEST.in
-rw-r--r--   1 mailman  mailman   3281 Jun 22 11:40 README.rst
drwxr-xr-x   2 mailman  mailman      4 Jun 22 11:40 _ext/
drwxr-xr-x   2 mailman  mailman      2 Jun 22 11:40 archives/
drwxr-xr-x   2 mailman  mailman      2 Jun 22 11:40 cache/
-rw-r--r--   1 mailman  mailman   7998 Jun 22 11:40 conf.py
drwxr-xr-x   2 mailman  mailman      5 Jun 22 11:40 contrib/
-rwxr-xr-x   1 mailman  mailman   2786 Jun 22 11:40 copybump.py*
-rw-r--r--   1 mailman  mailman    437 Jun 22 11:40 coverage.ini
drwxr-xr-x   2 mailman  mailman      3 Jun 22 11:40 cron/
drwxr-xr-x   2 mailman  mailman     12 Jun 29 11:13 data/
drwxr-xr-x   2 mailman  mailman      3 Jun 26 09:13 etc/
-rwxr-xr-x   1 mailman  mailman    231 Jun 22 11:40 generate_mo.sh*
drwxr-xr-x   2 mailman  mailman      2 Jun 22 11:40 lists/
drwxr-xr-x   2 mailman  mailman      4 Jun 29 15:34 locks/
drwxr-xr-x   2 mailman  mailman      7 Jun 22 11:40 logs/
-rwxr-xr-x   1 mailman  mailman    243 Jun 22 14:10 manage.py*
-rw-rw----   1 mailman  mailman      5 Jun 29 11:13 master.pid
drwxr-xr-x   2 mailman  mailman      2 Jun 22 11:40 messages/
drwxr-xr-x   2 mailman  mailman      8 Jun 22 11:40 port_me/
drwxr-xr-x  14 mailman  mailman     14 Jun 22 11:40 queue/
-rw-r--r--   1 mailman  mailman     66 Jun 22 11:40 requirements-docs.txt
-rw-r--r--   1 mailman  mailman     44 Jun 22 11:40 setup.cfg
-rw-r--r--   1 mailman  mailman   4826 Jun 22 11:40 setup.py
drwxr-xr-x   3 mailman  mailman      4 Jun 22 11:40 src/
-rw-r--r--   1 mailman  mailman    752 Jun 22 11:40 template.py
drwxr-xr-x   2 mailman  mailman      2 Jun 22 11:40 templates/
-rw-r--r--   1 mailman  mailman   1387 Jun 22 11:40 tox.ini
-rw-r--r--   1 mailman  mailman    377 Jun 22 11:40 unittest.cfg
-rwxr-xr-x   1 mailman  mailman    660 Jun 22 11:40 update-pot.sh*
-rw-r--r--   1 mailman  mailman   1856 Jun 22 11:40 update_po.py
-rw-r--r--   1 mailman  mailman   1292 Jun 22 14:11 urls.py
drwxr-xr-x   3 root     mailman      3 Jun 22 14:26 var/
-rw-r--r--   1 mailman  mailman   1173 Jun 22 14:11 wsgi.py

https://forums.freebsd.org/threads/mailman-3.61050/#js-post-351355

https://ximalas.info/2020/12/01/migrating-to-mailman-3/

Postorius

https://translate.google.co.jp/translate?hl=ja&sl=en&u=https://docs.mailman3.org/en/latest/migration.html&prev=search&pto=aue

qrunner は走ったので、次はWebインターフェースを

# portinstall www/py-postorius
[Reading data from pkg(8) ... - 434 packages found - done]
** Found already installed package(s) of 'www/py-postorius': py37-postorius-1.3.3_1

既にインストールされている。が、どう設定すればよいのだろう?


Total access 1171:本日 1:昨日 0

Counter: 1171, today: 1, yesterday: 0

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS