Django创建帐户以550结尾

时间:2017-05-17 09:43:19

标签: django pinax

在Django应用程序(geonode 2.4)上的

我正在尝试注册一个新用户:me@gmail.com。结束于ERROR SMTPRecipientsRefused sombody@yahoo.com (550, unknown User)

相同的安装程序适用于本地虚拟机(具有相同的SMTP服务器)!

SETUP

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'

问题

我不明白当我尝试注册me@gmail.com时,为什么Django会抱怨sombody@yahoo.com? - 它不应该关心已经注册的用户。我该如何调试?

TRACEBACK

   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) ...

1 个答案:

答案 0 :(得分:1)

我发现了,这里发生的是

ACCOUNT_APPROVAL_REQUIRED = True

已设定。提到的雅虎地址是管理员,应该通知他们批准。 Smtp正在拒绝地址并投掷550.