diff --git a/frappe/email/receive.py b/frappe/email/receive.py index 1ddf69afcb..8ad99777d9 100644 --- a/frappe/email/receive.py +++ b/frappe/email/receive.py @@ -219,6 +219,9 @@ class EmailServer: uidnext = int(self.parse_imap_response("UIDNEXT", message[0]) or "1") frappe.db.set_value("Email Account", self.settings.email_account, "uidnext", uidnext) + if uid_validity is None: + frappe.flags.initial_sync = True + if not uid_validity or uid_validity != current_uid_validity: # uidvalidity changed & all email uids are reindexed by server frappe.db.set_value(