10

I am using Django 1.7 and for authentication I am using Django allauth. For sending email, I started using zoho smtp server. It is able to send normal & transactional mails but it cannot send signup conversation email. It shows the error:

SMTPDataError at /accounts/signup/
(553, b'Relaying disallowed as webmaster@localhost')

The traceback is :

69.             return self.dispatch(request, *args, **kwargs)
File "C:\Python34\lib\site-packages\django\utils\decorators.py" in _wrapper
  29.             return bound_func(*args, **kwargs)
File "C:\Python34\lib\site-packages\django\views\decorators\debug.py" in sensitive_post_parameters_wrapper
  76.             return view(request, *args, **kwargs)
File "C:\Python34\lib\site-packages\django\utils\decorators.py" in bound_func
  25.                 return func.__get__(self, type(self))(*args2, **kwargs2)
File "C:\Users\sp\industryo\allauth\account\views.py" in dispatch
  167.         return super(SignupView, self).dispatch(request, *args, **kwargs)
File "C:\Users\sp\industryo\allauth\account\views.py" in dispatch
  62.                                             **kwargs)
File "C:\Users\sp\industryo\allauth\account\views.py" in dispatch
  145.                                                           **kwargs)
File "C:\Python34\lib\site-packages\django\views\generic\base.py" in dispatch
  87.         return handler(request, *args, **kwargs)
File "C:\Users\sp\industryo\allauth\account\views.py" in post
  78.             response = self.form_valid(form)
File "C:\Users\sp\industryo\allauth\account\views.py" in form_valid
  183.                                self.get_success_url())
File "C:\Users\sp\industryo\allauth\account\utils.py" in complete_signup
  162.                          signal_kwargs=signal_kwargs)
File "C:\Users\sp\industryo\allauth\account\utils.py" in perform_login
  123.             send_email_confirmation(request, user, signup=signup)
File "C:\Users\sp\industryo\allauth\account\utils.py" in send_email_confirmation
  291.                                                     signup=signup)
File "C:\Users\sp\industryo\allauth\account\models.py" in send_confirmation
  60.         confirmation.send(request, signup=signup)
File "C:\Users\sp\industryo\allauth\account\models.py" in send
  137.                                 ctx)
File "C:\Users\sp\industryo\allauth\account\adapter.py" in send_mail
  100.         msg.send()
File "C:\Python34\lib\site-packages\django\core\mail\message.py" in send
  286.         return self.get_connection(fail_silently).send_messages([self])
File "C:\Python34\lib\site-packages\django\core\mail\backends\smtp.py" in send_messages
  99.                 sent = self._send(message)
File "C:\Python34\lib\site-packages\django\core\mail\backends\smtp.py" in _send
  115.             self.connection.sendmail(from_email, recipients, message.as_bytes(linesep='\r\n'))
File "C:\Python34\lib\smtplib.py" in sendmail
  800.             raise SMTPDataError(code, resp)

Exception Type: SMTPDataError at /accounts/signup/
Exception Value: (553, b'Relaying disallowed as webmaster@localhost')

What is the issue here? How can I solve this problem?

Rohit
  • 475
  • 1
  • 7
  • 16

1 Answers1

16

Change DEFAULT_FROM_EMAIL in your settings. The error message is because your email provider does not accept the default value, webmaster@localhost.

Alasdair
  • 298,606
  • 55
  • 578
  • 516
  • That worked perfectly. But I have one question. Earlier i was using gmail smtp server and it was working fine. This problem showed up only when i started using zoho. what can be the possible reason? – Rohit Oct 28 '15 at 20:51
  • It's up to whoever runs the SMTP server to decide which emails they accept. Just because Zoho rejects an email from `webmaster@localhost` doesn't mean all SMTP servers will. – Alasdair Oct 28 '15 at 21:29
  • Zoho brought me here also, Though i'm still surprised that it worked locally. Maybe it was something other than webmaster@localhost – danidee Mar 07 '17 at 13:17
  • I am somewhat late to the party. But I am facing the same issue. I am using Zoho SMTP to send "Account activation email and password reset email and have added the default_from_email as my email id. Now I have created a contact form on my website, in that case I am adding the email id of the user as from "email" at that instance I am getting the following error on submitting the form `SMTPDataError (553, b'Relaying disallowed as abc@xyz.com')` – Udit Hari Vashisht Jan 29 '19 at 11:44