Try ERPNext Buy Support Partners Foundation Foundation Members

Email sending problems after update

Hi there,

Please help me out.

I got an ERPnext server with a custom domain and 3 addon domain in the Email Domain section.
When I want to send a mail it’s always go into failure and in error log I got the following meassege:

Title
frappe.email.queue.flush

Error

‘NoneType’ object has no attribute ‘strip’
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py”, line 408, in send_one
smtpserver.sess.sendmail(email.sender, recipient.recipient, encode(message))
File “/usr/lib/python3.5/smtplib.py”, line 856, in sendmail
(code, resp) = self.mail(from_addr, esmtp_opts)
File “/usr/lib/python3.5/smtplib.py”, line 533, in mail
self.putcmd(“mail”, “FROM:%s%s” % (quoteaddr(sender), optionlist))
File “/usr/lib/python3.5/smtplib.py”, line 153, in quoteaddr
if addrstring.strip().startswith(’<’):
AttributeError: ‘NoneType’ object has no attribute ‘strip’

What is the problem? I can’t figure out. And the mails are still don’t work.
I have recreated the domains and the mail accounts too, but still no luck.

Regards.

An email seems to have no value specified in its sender field?

In the database inspect the tabEmail Queue table to confirm that is the case, and delete that email from the table.

frappe@ubuntu:~/frappe-bench$ bench mariadb
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6873
Server version: 10.2.22-MariaDB-10.2.22+maria~xenial-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [d56cb677eaab3383]> desc `tabEmail Queue`;
+----------------------+--------------+------+-----+----------+-------+
| Field                | Type         | Null | Key | Default  | Extra |
+----------------------+--------------+------+-----+----------+-------+
| name                 | varchar(140) | NO   | PRI | NULL     |       |
| creation             | datetime(6)  | YES  |     | NULL     |       |
| modified             | datetime(6)  | YES  |     | NULL     |       |
| modified_by          | varchar(140) | YES  |     | NULL     |       |
| owner                | varchar(140) | YES  |     | NULL     |       |
| docstatus            | int(1)       | NO   |     | 0        |       |
| parent               | varchar(140) | YES  | MUL | NULL     |       |
| parentfield          | varchar(140) | YES  |     | NULL     |       |
| parenttype           | varchar(140) | YES  |     | NULL     |       |
| idx                  | int(8)       | NO   |     | 0        |       |
| status               | varchar(140) | YES  | MUL | Not Sent |       |
| reference_doctype    | varchar(140) | YES  |     | NULL     |       |
| _liked_by            | text         | YES  |     | NULL     |       |
| _user_tags           | text         | YES  |     | NULL     |       |
| sender               | varchar(140) | YES  |     | NULL     |       |
| communication        | varchar(140) | YES  | MUL | NULL     |       |
| _assign              | text         | YES  |     | NULL     |       |
| reference_name       | varchar(140) | YES  |     | NULL     |       |
| priority             | int(11)      | NO   |     | 1        |       |
| send_after           | datetime(6)  | YES  |     | NULL     |       |
| _comments            | text         | YES  |     | NULL     |       |
| error                | longtext     | YES  |     | NULL     |       |
| message              | longtext     | YES  |     | NULL     |       |
| recipient            | varchar(140) | YES  |     | NULL     |       |
| unsubscribe_param    | varchar(140) | YES  |     | NULL     |       |
| expose_recipients    | varchar(140) | YES  |     | NULL     |       |
| show_as_cc           | text         | YES  |     | NULL     |       |
| unsubscribe_method   | varchar(140) | YES  |     | NULL     |       |
| message_id           | varchar(140) | YES  | MUL | NULL     |       |
| add_unsubscribe_link | int(1)       | NO   |     | 1        |       |
| attachments          | longtext     | YES  |     | NULL     |       |
| retry                | int(11)      | NO   |     | 0        |       |
+----------------------+--------------+------+-----+----------+-------+
32 rows in set (0.15 sec)

MariaDB [d56cb677eaab3383]> select name,sender from `tabEmail Queue`;
+------------+----------------------------------------------------------------
| name       | sender                                                         
+------------+----------------------------------------------------------------

Thank you. I’ll check this solution.
But how is this possible when I only send out emails from existing email address?
I mean, i have setup only one email to send emails out.

Another big question is, why are the outgoing mail accounts as incoming. They haven’t turned on incoming. It’s a miracle…

Be back after check your Database related solution.

Regards Gary

To find out the why best to debug and learn, the experimental process - hypothesis, trial and error test and observe…