Django 创建帐户以 550 结尾
Django Create Account ends in 550
在 Django 应用程序上 (geonode 2.4) 我正在尝试注册一个新用户:me@gmail.com
。这结束于 ERROR SMTPRecipientsRefused sombody@yahoo.com (550, unknown User)
.
相同的设置适用于本地虚拟机(具有相同的 SMTP 服务器)!
设置
- Ubuntu 14.04
- Django 1.6.11
- 帐户应用程序:geonode-user-accounts
(从 pinax-django-user-accounts 分叉)
SMTP local_settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_USE_SSL = True
EMAIL_HOST = 'mail.example.com'
EMAIL_HOST_USER = 'user@mail.example.com'
EMAIL_HOST_PASSWORD = 'pass'
EMAIL_PORT = 25 ## tested telnet to 587 but it seems only 25 is open
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
THEME_ACCOUNT_CONTACT_EMAIL = 'admin@example.com'
问题
我不明白为什么当我尝试注册我@gmail.com时,Django 会抱怨 sombody@yahoo.com? – 它不应该关心已经注册的用户。我该如何调试?
回溯
SMTPRecipientsRefused at /account/signup/
{u'sombody@yahoo.com': (550, 'Unknown user')}
Request Method: POST
Request URL: http://geonode.barbatti.org/account/signup/
Django Version: 1.6.11
Exception Type: SMTPRecipientsRefused
Exception Value:
{u'max.muster@barbatti.de': (550, 'Unknown user')}
Exception Location: /usr/lib/python2.7/smtplib.py in sendmail, line 747
Python Executable: /usr/bin/python
Python Version: 2.7.6
Python Path:
['/var/www/geonode',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/pymodules/python2.7',
'/var/www']
Server time: Tue, 16 May 2017 09:52:13 -0500
Traceback Switch to copy-and-paste view
/usr/lib/python2.7/dist-packages/django/core/handlers/base.py in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/views/generic/base.py in view
return self.dispatch(request, *args, **kwargs) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/views/generic/base.py in dispatch
return handler(request, *args, **kwargs) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/account/views.py in post
return super(SignupView, self).post(*args, **kwargs) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/views/generic/edit.py in post
return self.form_valid(form) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/account/views.py in form_valid
notification.send(staff, "account_approve", {"from_user": self.created_user}) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/notification/models.py in send
return send_now(*args, **kwargs) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/notification/models.py in send_now
backend.deliver(user, sender, notice_type, extra_context) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/notification/backends/email.py in deliver
send_mail(subject, body, settings.DEFAULT_FROM_EMAIL, [recipient.email]) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/core/mail/__init__.py in send_mail
connection=connection).send() ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/core/mail/message.py in send
return self.get_connection(fail_silently).send_messages([self]) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py in send_messages
sent = self._send(message) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py in _send
self.connection.sendmail(from_email, recipients, message.as_bytes()) ...
▶ Local vars
/usr/lib/python2.7/smtplib.py in sendmail
raise SMTPRecipientsRefused(senderrs) ...
我找到了,这里发生的是
ACCOUNT_APPROVAL_REQUIRED = True
已设置。上面提到的yahoo address是admin,需要通知审批。 Smtp 拒绝地址并抛出 550。
在 Django 应用程序上 (geonode 2.4) 我正在尝试注册一个新用户:me@gmail.com
。这结束于 ERROR SMTPRecipientsRefused sombody@yahoo.com (550, unknown User)
.
相同的设置适用于本地虚拟机(具有相同的 SMTP 服务器)!
设置
- Ubuntu 14.04
- Django 1.6.11
- 帐户应用程序:geonode-user-accounts (从 pinax-django-user-accounts 分叉)
SMTP local_settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_USE_SSL = True
EMAIL_HOST = 'mail.example.com'
EMAIL_HOST_USER = 'user@mail.example.com'
EMAIL_HOST_PASSWORD = 'pass'
EMAIL_PORT = 25 ## tested telnet to 587 but it seems only 25 is open
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
THEME_ACCOUNT_CONTACT_EMAIL = 'admin@example.com'
问题
我不明白为什么当我尝试注册我@gmail.com时,Django 会抱怨 sombody@yahoo.com? – 它不应该关心已经注册的用户。我该如何调试?
回溯
SMTPRecipientsRefused at /account/signup/
{u'sombody@yahoo.com': (550, 'Unknown user')}
Request Method: POST
Request URL: http://geonode.barbatti.org/account/signup/
Django Version: 1.6.11
Exception Type: SMTPRecipientsRefused
Exception Value:
{u'max.muster@barbatti.de': (550, 'Unknown user')}
Exception Location: /usr/lib/python2.7/smtplib.py in sendmail, line 747
Python Executable: /usr/bin/python
Python Version: 2.7.6
Python Path:
['/var/www/geonode',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/pymodules/python2.7',
'/var/www']
Server time: Tue, 16 May 2017 09:52:13 -0500
Traceback Switch to copy-and-paste view
/usr/lib/python2.7/dist-packages/django/core/handlers/base.py in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/views/generic/base.py in view
return self.dispatch(request, *args, **kwargs) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/views/generic/base.py in dispatch
return handler(request, *args, **kwargs) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/account/views.py in post
return super(SignupView, self).post(*args, **kwargs) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/views/generic/edit.py in post
return self.form_valid(form) ...
▶ Local vars
/usr/local/lib/python2.7/dist-packages/account/views.py in form_valid
notification.send(staff, "account_approve", {"from_user": self.created_user}) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/notification/models.py in send
return send_now(*args, **kwargs) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/notification/models.py in send_now
backend.deliver(user, sender, notice_type, extra_context) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/notification/backends/email.py in deliver
send_mail(subject, body, settings.DEFAULT_FROM_EMAIL, [recipient.email]) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/core/mail/__init__.py in send_mail
connection=connection).send() ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/core/mail/message.py in send
return self.get_connection(fail_silently).send_messages([self]) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py in send_messages
sent = self._send(message) ...
▶ Local vars
/usr/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py in _send
self.connection.sendmail(from_email, recipients, message.as_bytes()) ...
▶ Local vars
/usr/lib/python2.7/smtplib.py in sendmail
raise SMTPRecipientsRefused(senderrs) ...
我找到了,这里发生的是
ACCOUNT_APPROVAL_REQUIRED = True
已设置。上面提到的yahoo address是admin,需要通知审批。 Smtp 拒绝地址并抛出 550。