Setting Email notification is generating Error Log entries. Why?

I have managed to configure ERPNext to send daily email to various users. But after this setting this up when I checked the Error Log List I found a very long list of errors.

The most recent error log entry has following:

Title: send_mail

Error
-----
Traceback with variables (most recent call last):
  File "apps/frappe/frappe/utils/background_jobs.py", line 160, in execute_job
    method(**kwargs)
      site = 'erp.energenius.in'
      method = <function send_mail at 0x7f74af152f80>
      event = None
      job_name = '<function send_mail at 0x7fdd8108a710>'
      kwargs = {'email_queue_name': 3, 'is_background_task': True}
      user = 'Administrator'
      is_async = True
      retry = 0
      method_name = 'send_mail'
  File "apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 183, in send_mail
    record.send(is_background_task=is_background_task, smtp_server_instance=smtp_server_instance)
      email_queue_name = 3
      is_background_task = True
      smtp_server_instance = None
      record = <EmailQueue: 3>
  File "apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 140, in send
    ctx.smtp_session.sendmail(from_addr=self.sender, to_addrs=recipient.recipient, msg=message)
      self = <EmailQueue: 3>
      is_background_task = True
      smtp_server_instance = None
      ctx = <frappe.email.doctype.email_queue.email_queue.SendMailContext object at 0x7f74af210850>
...
...
...
resp = b'"Your IP: 000.000.00.160 : Your domain xxxxxx.in is not allowed in\nheader From"'
      senderrs = {'admin@xxxxxx.in': (550, b'"Your IP: 000.000.00.160 : Your domain xxx.in is not allowed in\nheader From"')}
smtplib.SMTPRecipientsRefused: {'admin@xxxxxx.in': (550, b'"Your IP: 000.000.00.160 : Your domain xxxxx.in is not allowed in\nheader From"')}

Another error is as follows

Title: Email sending failed

Error
-----
File "/home/erpnext/erp14/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 140, in send
    ctx.smtp_session.sendmail(from_addr=self.sender, to_addrs=recipient.recipient, msg=message)
  File "/usr/lib/python3.10/smtplib.py", line 901, in sendmail
    raise SMTPRecipientsRefused(senderrs)

 Queue Name: 3

What is the problem and how to solve it?

Regards,

Hi,

Would it be possible to test if the error is produced when an email is sent to some but not all of the recipients? Perhaps some are rejecting the emails as spam or somesuch?

1 Like

I would check sending mail to the addresses from a different program to see if the problem is at the other end.

1 Like

@smino and @fvl

Thanks for your suggestion. I will check as suggested.

Regards,