On Sat, 2021-12-25 at 13:34 -0800, Mark Sapiro wrote:
On 12/25/21 12:42 PM, William Oliver wrote:
Is there a "make-the-freaking-virtual- map-database" command in mailman3, or is this postfix thing? Should I just touch the thing and create an empty file? I'm a little scared to... The error message makes me think that it should be populated with something...
Did you add an Alias Domain (different from the Mail Host domain) to the entry for your domain? This is what triggers the creation of postfix_vmap.
Well, I hope youi had/have/will have a great holiday. I just finished our dinner and I am now amusing myself by pretending to enjoy the Hallmark movies my wife is watching and debugging my mailman3 installation when she's not looking. It was either "The twelve cats of Christmas" or "Die Hard." I put my foot down and said we were watching Die Hard. So of course we are watching a movie about 12 kittens in a fire truck.
In any case, I added a line for "virtual_alias_domains" in my main.cf for postfix. But it doesn't do anything, apparently, except generate another error line (see the syslog output below). So, just for a lark, I created an empty /opt/mailman/mm/var/data/postfix_vmap file and ran postmap on it to create a postfix_vmap.db file.
Now, it no longer complains about there not being a postfix_vmap.db file. Instead it complains about it being empty. Here's what my mailmanweb.log has to say:
smtplib.SMTPRecipientsRefused: {'redacted@libertyfp.org': (550, b'5.1.1 <redacted@libertyfp.org>: Recipient address rejected: User unknown in virtual alias table')}
I redacted the name because this is supposed to be the admin account -- and it fails on login.
So, here's syslog:
Dec 25 19:08:49 libertyfp postfix/smtpd[44664]: connect from localhost[::1] Dec 25 19:08:49 libertyfp postfix/trivial-rewrite[44670]: warning: do not list domain libertyfp.org in BOTH virtual_alias_domains and virtual_mailbox_domains Dec 25 19:08:49 libertyfp postfix/trivial-rewrite[44670]: warning: do not list domain libertyfp.org in BOTH virtual_alias_domains and virtual_mailbox_domains Dec 25 19:08:49 libertyfp postfix/smtpd[44664]: NOQUEUE: reject: RCPT from localhost[::1]: 550 5.1.1 <redacted@libertyfp.org>: Recipient address rejected: User unknown in virtual alias table; from=<redacted2@libertyfp.org> to=<redacted@libertyfp.org> proto=ESMTP helo=<mail.libertyfp.org> Dec 25 19:08:49 libertyfp postfix/smtpd[44672]: connect from localhost[::1] Dec 25 19:08:49 libertyfp postfix/trivial-rewrite[44670]: warning: do not list domain libertyfp.org in BOTH virtual_alias_domains and virtual_mailbox_domains Dec 25 19:08:49 libertyfp postfix/smtpd[44672]: NOQUEUE: reject: RCPT from localhost[::1]: 550 5.1.1 <redacted@libertyfp.org>: Recipient address rejected: User unknown in virtual alias table; from=<root@localhost.local> to=<redacted@libertyfp.org> proto=ESMTP helo=<mail.libertyfp.org> Dec 25 19:08:49 libertyfp postfix/smtpd[44672]: disconnect from localhost[::1] ehlo=1 auth=1 mail=1 rcpt=0/1 rset=1 quit=1 commands=5/6
where "redacted2" is the name in settings.py for EMAIL_HOST_USER and DEFAULT_FROM_EMAIL and "redacted" is the address for "Mailman Suite Admin"
I don't know where "root@localhost.local" comes from.
OK, it didn't work when I just had virtual_mailbox_domains defined, and it didn't work when I had both defined, so I commented out virtual_mailbox_domains and just left virtual_alias_domains.
That didn't help, either, though it got rid of the warnings in syslog:
Dec 25 19:43:33 libertyfp postfix/smtpd[55192]: connect from localhost[::1] Dec 25 19:43:33 libertyfp postfix/smtpd[55192]: NOQUEUE: reject: RCPT from localhost[::1]: 550 5.1.1 <redacted@libertyfp.org>: Recipient address rejected: User unknown in virtual alias table; from=<redacted2@libertyfp.org> to=<redacted@libertyfp.org> proto=ESMTP helo=<mail.libertyfp.org> Dec 25 19:43:34 libertyfp postfix/smtpd[55199]: connect from localhost[::1] Dec 25 19:43:34 libertyfp postfix/smtpd[55199]: NOQUEUE: reject: RCPT from localhost[::1]: 550 5.1.1 <redacted@libertyfp.org>: Recipient address rejected: User unknown in virtual alias table; from=<root@localhost.local> to=<reacted@libertyfp.org> proto=ESMTP helo=<mail.libertyfp.org> Dec 25 19:43:34 libertyfp postfix/smtpd[55199]: disconnect from localhost[::1] ehlo=1 auth=1 mail=1 rcpt=0/1 rset=1 quit=1 commands=5/6
Here's my postfix configuration: alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases always_add_missing_headers = yes command_directory = /usr/sbin compatibility_level = 2 daemon_directory = /usr/lib/postfix/sbin data_directory = /var/lib/postfix debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 default_destination_concurrency_limit = 15 default_destination_recipient_limit = 30 header_checks = regexp:/etc/postfix/header_checks home_mailbox = Maildir/ inet_interfaces = all inet_protocols = all local_recipient_maps = proxy:unix:passwd.byname $alias_maps hash:/opt/mailman/mm/var/data/postfix_lmtp mail_owner = postfix mailq_path = /usr/bin/mailq mydomain = libertyfp.org myhostname = mail.libertyfp.org mynetworks = 127.0.0.0/8 10.0.0.0/24 mynetworks_style = host myorigin = $mydomain newaliases_path = /usr/bin/newaliases owner_request_special = no relay_domains = hash:/opt/mailman/mm/var/data/postfix_domains sendmail_path = /usr/sbin/postfix smtp_tls_mandatory_protocols = !SSLv2, !SSLv3 smtpd_banner = $myhostname ESMTP smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_tls_cert_file = /etc/letsencrypt/live/libertyfp.org/fullchain.pem smtpd_tls_key_file = /etc/letsencrypt/live/libertyfp.org/privkey.pem smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3 smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes transport_maps = hash:/opt/mailman/mm/var/data/postfix_lmtp unknown_local_recipient_reject_code = 550 virtual_alias_domains = libertyfp.org virtual_alias_maps = hash:/opt/mailman/mm/var/data/postfix_vmap virtual_gid_maps = static:20000 virtual_mailbox_base = /home/vmail virtual_mailbox_maps = hash:/etc/postfix/virtual-mailbox virtual_uid_maps = static:20000
Here's my settings.py:
# Mailman Web configuration file. # /etc/mailman3/settings.py
from mailman_web.settings.base import * from mailman_web.settings.mailman import *
#: Default list of admins who receive the emails from error logging. ADMINS = ( ('Mailman Suite Admin', 'redacted2@libertyfp.org'), )
# Postgresql database setup. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'mailman', 'USER': 'mailman', # TODO: Replace this with the password. 'PASSWORD': 'passwd', 'HOST': 'localhost', 'PORT': '5432', } }
# 'collectstatic' command will copy all the static files here.
# Alias this location from your webserver to /static
STATIC_ROOT = '/opt/mailman/web/static'
# Make sure that this directory is created or Django will fail on start. LOGGING['handlers']['file']['filename'] = '/opt/mailman/web/logs/mailmanweb.log'
#: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts ALLOWED_HOSTS = [ "localhost", # Archiving API from Mailman, keep it. "www.libertyfp.org", "libertyfp.org", "mail.libertyfp.org", "list.libertyfp.org", "127.0.0.1", "2.56.57.28" # "lists.your-domain.org", # Add here all production domains you have. ]
#: Current Django Site being served. This is used to customize the web host #: being used to serve the current website. For more details about Django #: site, see: https://docs.djangoproject.com/en/dev/ref/contrib/sites/ SITE_ID = 1
# Set this to a new secret value. SECRET_KEY = 'passwd'
# Set this to match the api_key setting in # /opt/mailman/mm/mailman-hyperkitty.cfg (quoted here, not there). MAILMAN_ARCHIVER_KEY = 'passwd'
HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', 'PATH': os.path.join(BASE_DIR, "fulltext_index"), }, }
# To be added to Django's settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'localhost' EMAIL_PORT = 25 EMAIL_HOST_USER = 'redacted@libertyfp.org' EMAIL_HOST_PASSWORD = 'passwd'
DEFAULT_FROM_EMAIL = 'redacted2@libertyfp.org'
SITE_ID = 2
Here's my mailman.cfg:
/etc/mailman3/mailman.cfg [paths.here] var_dir: /opt/mailman/mm/var
[mailman] layout: here # This address is the "site owner" address. Certain messages which must be # delivered to a human, but which can't be delivered to a list owner (e.g. a # bounce from a list owner), will be sent to this address. It should point to # a human. site_owner: redacted@libertyfp.org
[database] class: mailman.database.postgresql.PostgreSQLDatabase url: postgres://redacted2:passwd@localhost/mailman
[archiver.prototype] enable: yes
# For the HyperKitty archiver. [archiver.hyperkitty] class: mailman_hyperkitty.Archiver enable: yes configuration: /opt/mailman/mm/mailman-hyperkitty.cfg # And, create the /opt/mailman/mm/mailman-hyperkitty.cfg file containing # these settings uncommented #[general] #base_url: http://127.0.0.1:8000/archives/ #api_key: Secret_Hyperkitty_API_Key
[shell] history_file: $var_dir/history.py
[shell] history_file: $var_dir/history.py
[mta] verp_confirmations: yes verp_personalized_deliveries: yes verp_delivery_interval: 1 incoming: mailman.mta.postfix.LMTP outgoing: mailman.mta.deliver.deliver lmtp_host: mail.libertyfp.org lmtp_port: 8024 smtp_host: mail.libertyfp.org smtp_port: 25 configuration: python:mailman.config.postfix recipient_delimiter = + unknown_local_recipient_reject_code = 550 owner_request_special = no
Here's uwsgi.ini
# /etc/mailman3/uwsgi.ini # [uwsgi] # Port on which uwsgi will be listening. #http-socket = 127.0.0.1:8000 http-socket = 0.0.0.0:8000
# If running uwsgi from the virtual environment ... virtualenv = /opt/mailman/venv/
module=mailman_web.wsgi:application
# Add to python import path. pythonpath = /etc/mailman3/
# The default settings module. env = DJANGO_SETTINGS_MODULE=settings
# Setup default number of processes and threads per process. master = true processes = 2 threads = 2
# Setup the django_q related worker processes. attach-daemon = /opt/mailman/venv/bin/mailman-web qcluster
# Setup the request log. req-logger = file:/opt/mailman/web/logs/uwsgi.log
# Log qcluster commands separately. logger = qcluster file:/opt/mailman/web/logs/uwsgi-qcluster.log log-route = qcluster uwsgi-daemons
# Last log and it logs the rest of the stuff. logger = file:/opt/mailman/web/logs/uwsgi-error.log
And, last but not least here's mailman-hyperkitty.cfg: [general] base_url: http://127.0.0.1:8000/archives/ api_key: passwd