YunoHost-Apps / mailman3_ynh

Mailman - The GNU Mailing List Management System packaged for YunoHost.
GNU Affero General Public License v3.0
7 stars 4 forks source link

Cannot use mailing lists with non-primary domain #19

Open g1smo opened 3 years ago

g1smo commented 3 years ago

Describe the bug

When trying to use a secondary domain on our yunohost installation for a mailing list, 550 mailbox not available is replied every time.

Context

Our primary domain is kompot.si and the secondary one lom.je.

Steps to reproduce

Add a secondary domain's site and domain in mailman3 administration panel, create a new mailing list, send email to it.

Expected behavior

Recipients of the mailing list should receive the mail

Logs

/var/log/mail.log relevant section:

Oct  5 03:23:45 kompot-produkcija postfix/cleanup[1656]: D6EF81BE700: message-id=<7f27dc4e-56c6-82c8-ca05-3284ee7eb8e7@kompot.si>
Oct  5 03:23:46 kompot-produkcija postfix/qmgr[1622]: D6EF81BE700: from=<jurij@kompot.si>, size=9345, nrcpt=1 (queue active)
Oct  5 03:23:46 kompot-produkcija postfix/submission/smtpd[1682]: disconnect from 93-103-182-173.dynamic.t-2.net[93.103.182.173] ehlo=2 starttls=1 auth=1 mail=1 rcpt=1 da
ta=1 quit=1 commands=8
Oct  5 03:23:46 kompot-produkcija postfix/lmtp[1685]: D6EF81BE700: to=<hehe@yunohost.org>, orig_to=<hehe@lom.je>, relay=127.0.0.1[127.0.0.1]:8024, delay=0.25, delays=0.19/0.01/0.05/0.01, dsn=5.0.0, status=bounced (host 127.0.0.1[127.0.0.1] said: 550 Requested action not taken: mailbox unavailable (in reply to end of DATA command))
Oct  5 03:23:46 kompot-produkcija postsrsd[1657]: srs_forward: <""> not rewritten: No at sign in sender address
Oct  5 03:23:46 kompot-produkcija postfix/cleanup[1656]: 2668C1BE703: message-id=<20211005012346.2668C1BE703@kompot.si>
Oct  5 03:23:46 kompot-produkcija postfix/bounce[1686]: D6EF81BE700: sender non-delivery notification: 2668C1BE703
Oct  5 03:23:46 kompot-produkcija postfix/qmgr[1622]: 2668C1BE703: from=<>, size=11806, nrcpt=1 (queue active)
Oct  5 03:23:46 kompot-produkcija postfix/qmgr[1622]: D6EF81BE700: removed

Additional information

Running postmap /var/lib/mailman3/data/postfix_domains or sudo -su list mailman aliases return the following warning:

root@kompot-produkcija:/etc/postfix# sudo -su list mailman aliases
postmap: warning: /var/lib/mailman3/data/postfix_domains.db: duplicate entry: "yunohost.org"

/var/lib/mailman3/data/postfix_domains

# AUTOMATICALLY GENERATED BY MAILMAN ON 2021-10-05 01:22:53
#
# This file is generated by Mailman, and is kept in sync with the binary hash
# file.  YOU SHOULD NOT MANUALLY EDIT THIS FILE unless you know what you're
# doing, and can keep the two files properly in sync.  If you screw it up,
# you're on your own.

yunohost.org kompot.si
yunohost.org lom.je

/var/lib/mailman3/data/postfix_lmtp (relevant section)

# Aliases which are visible only in the @yunohost.org domain.
hehe@yunohost.org                       lmtp:[127.0.0.1]:8024
hehe-bounces@yunohost.org               lmtp:[127.0.0.1]:8024
hehe-confirm@yunohost.org               lmtp:[127.0.0.1]:8024
hehe-join@yunohost.org                  lmtp:[127.0.0.1]:8024
hehe-leave@yunohost.org                 lmtp:[127.0.0.1]:8024
hehe-owner@yunohost.org                 lmtp:[127.0.0.1]:8024
hehe-request@yunohost.org               lmtp:[127.0.0.1]:8024
hehe-subscribe@yunohost.org             lmtp:[127.0.0.1]:8024
hehe-unsubscribe@yunohost.org           lmtp:[127.0.0.1]:8024

I can add some additional configuration files.

Multiple mailing lists on our primary kompot.si domain are working flawlessly.

jakobkilian commented 2 years ago

Hey, don't know if it helps but I had a simliar issue: Did you follow the instructions in the Readme at "Configure incoming mail"? In /etc/postfix/main.cf I just had to add hash:/var/lib/mailman3/data/postfix_lmtp to this line: virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf

I'm no expert here, but thought it be the same thing?

g1smo commented 2 years ago

Hey,

Yes, I had to add that to get mailing lists working in the first place:

virtual_mailbox_maps =
        hash:/var/lib/mailman3/data/postfix_lmtp,
        ldap:/etc/postfix/ldap-accounts.cf

I moved postfix_lmtp above ldap accounts, since, otherwise, adding a mail alias for a user could "trump" the mailing list address. Since we're not using a subdomain for lists.

The non-primary domain still doesn't work...

l33 commented 1 year ago

Running postmap /var/lib/mailman3/data/postfix_domains or sudo -su list mailman aliases return the following warning:

root@kompot-produkcija:/etc/postfix# sudo -su list mailman aliases
postmap: warning: /var/lib/mailman3/data/postfix_domains.db: duplicate entry: "yunohost.org"

/var/lib/mailman3/data/postfix_domains

[...]
yunohost.org kompot.si
yunohost.org lom.je

I had a similar setup and the same issue. It seems mailman3 does not like to have multiple mail hosts pointing to identical alias domains. I was able to solve it by using different alias domains for each mail host. In your case that'd be 1.yunohost.org and 2.yunohost.org instead of yunohost.org. I think this is probably a bug in mailman3 but I have not looked into it any deeper.