我只是想用 Postfix+Nginx+Postgres 运行 GNU Mailman3。这是最新的 GNU/Linux Debian 稳定版,所以我刚刚apt-get
安装mailman3-full
并对配置文件进行了一些标准更改。Nginx 部分很好,SSL 工作正常,我可以从我的网络浏览器访问 Postorius 和 Hyperkitty。但是当尝试以管理员身份登录时,我收到以下错误:
ERROR 2022-02-25 21:39:55,302 118475 django.request Internal Server Error: /accounts/login/
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/django/utils/decorators.py", line 45, in _wrapper
return bound_method(*args, **kwargs)
File "/usr/lib/python3/dist-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/allauth/account/views.py", line 146, in dispatch
return super(LoginView, self).dispatch(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/allauth/account/views.py", line 74, in dispatch
response = super(RedirectAuthenticatedUserMixin, self).dispatch(
File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 97, in dispatch
return handler(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/allauth/account/views.py", line 102, in post
response = self.form_valid(form)
File "/usr/lib/python3/dist-packages/allauth/account/views.py", line 159, in form_valid
return form.login(self.request, redirect_url=success_url)
File "/usr/lib/python3/dist-packages/allauth/account/forms.py", line 195, in login
ret = perform_login(
File "/usr/lib/python3/dist-packages/allauth/account/utils.py", line 175, in perform_login
send_email_confirmation(request, user, signup=signup, email=email)
File "/usr/lib/python3/dist-packages/allauth/account/utils.py", line 346, in send_email_confirmation
email_address.send_confirmation(request, signup=signup)
File "/usr/lib/python3/dist-packages/allauth/account/models.py", line 62, in send_confirmation
confirmation.send(request, signup=signup)
File "/usr/lib/python3/dist-packages/allauth/account/models.py", line 169, in send
get_adapter(request).send_confirmation_mail(request, self, signup)
File "/usr/lib/python3/dist-packages/allauth/account/adapter.py", line 464, in send_confirmation_mail
self.send_mail(email_template, emailconfirmation.email_address.email, ctx)
File "/usr/lib/python3/dist-packages/allauth/account/adapter.py", line 136, in send_mail
msg.send()
File "/usr/lib/python3/dist-packages/django/core/mail/message.py", line 306, in send
return self.get_connection(fail_silently).send_messages([self])
File "/usr/lib/python3/dist-packages/django/core/mail/backends/smtp.py", line 110, in send_messages
sent = self._send(message)
File "/usr/lib/python3/dist-packages/django/core/mail/backends/smtp.py", line 126, in _send
self.connection.sendmail(from_email, recipients, message.as_bytes(linesep='\r\n'))
File "/usr/lib/python3.9/smtplib.py", line 885, in sendmail
raise SMTPRecipientsRefused(senderrs)
smtplib.SMTPRecipientsRefused: {'root@localhost': (550, b'5.1.1 <root@localhost>: Recipient address rejected: User unknown in local recipient table')}
[pid: 118475|app: 0|req: 35/35] 2001:xxxx:xxxx:xxxx:xxxx:xxxx () {62 vars in 1133 bytes} [Fri Feb 25 21:39:55 2022] POST /accounts/login/ => generated 1156 bytes in 173 msecs (HTTP/1.1 500) 5 headers in 182 bytes (1 switches on core 1)
在 Postfix 日志文件中:
Feb 25 21:39:55 vps-xxx postfix/smtpd[122820]: connect from localhost[::1]
Feb 25 21:39:55 vps-xxx postfix/smtpd[122820]: NOQUEUE: reject: RCPT from localhost[::1]: 550 5.1.1 <root@localhost>: Recipient address rejected: User unknown in local recipient table; from=<root@MYDOMAIN> to=<root@localhost> proto=ESMTP helo=<vps-xxx>
Feb 25 21:39:55 vps-xxx postfix/smtpd[122820]: disconnect from localhost[::1] ehlo=1 mail=1 rcpt=0/1 rset=1 quit=1 commands=4/5
我想:也许我的本地收件人表不知何故坏了?但我可以使用以下方式发送邮件mail
:
$ mail -r 'root@localhost' -s 'just a test' 'root@localhost'
它工作得很好:
Feb 25 21:44:12 vps-xxx postfix/pickup[124104]: 9ABB540516: uid=1000 from=<root@localhost>
Feb 25 21:44:12 vps-xxx postfix/cleanup[124763]: 9ABB540516: message-id=<20220225214412.9ABB540516@MYDOMAIN>
Feb 25 21:44:12 vps-xxx opendkim[14611]: 9ABB540516: no signing table match for 'root@localhost'
Feb 25 21:44:12 vps-xxx opendkim[14611]: 9ABB540516: no signature data
Feb 25 21:44:12 vps-xxx postfix/qmgr[118558]: 9ABB540516: from=<root@localhost>, size=412, nrcpt=1 (queue active)
Feb 25 21:44:12 vps-xxx postfix/local[124765]: 9ABB540516: to=<root@localhost>, relay=local, delay=0.04, delays=0.03/0.01/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Feb 25 21:44:12 vps-xxx postfix/qmgr[118558]: 9ABB540516: removed
我root
确实可以在 's Maildir 中看到它。
有任何想法吗?
如果我没记错root@localhost
的话,是我admin
在dpkg-reconfigure
. 我以前从未使用过 GNU Mailman3,但我猜这封电子邮件一定是登录通知或类似的东西(您也可以通过send_email_confirmation
函数名称猜测它)。如果我输入了错误的密码,一切都很好(我只是在 Web UI 中得到一个很好的错误),所以只有当密码正确时才会发生这种情况。
谢谢!