Can't receive mail from person that is already in the Lead list (unique email ID error)

Hello,

I’m currently testing ERPnext to see if we can first use it as our CRM.

Finally I got Microsoft 365 e-mails to work with ERPnext thanks to this forum.

Upon testing I noticed that I wasn’t receiving some e-mails.

The communication list didn’t show any new e-mail.

But the error log showed some sort of duplicate email id error:
raise raise_exception(msg)\nfrappe.exceptions.DuplicateEntryError: Email Address must be unique, it is already used in …

Basically I have a lead with an E-mail address already in the system. Should the lead decide to send another e-mail in the future with a new subject the system will refuse to append the new e-mail to the lead.

Is that the intended behavior?

Thank you!

I want to add something to this issue:

Sometimes we get possible leads to different e-mail inboxes or by phone. I was hoping that those leads can be forwarded by e-mail into the leads inbox. But because it won’t accept an e-mail from the same sender twice, it is not possible.

I have checked the email_id field and UNIQUE is not checked.

Help is greatly appreciated.

Thank you!
Benjamin

I figured out the solution to the problem. Maybe it’ll help others if I post it.

The error log pointed to lead.py with code snippet:

def check_email_id_is_unique(self):
		if self.email_id:
			# validate email is unique
			if not frappe.db.get_single_value("CRM Settings", "allow_lead_duplication_based_on_emails"):

So I was wondering about the lead duplication. And indeed, I found a checkbox in the CRM settings called

Allow Lead Duplication based on Emails

which I checked.

Now it works like a charm.

Best,
Benjamin