[hotfix] stop frappe sending automatic responses from non user generated emails (#2674)

This commit is contained in:
robert schouten 2017-02-03 16:59:21 +08:00 committed by Rushabh Mehta
parent 3848c657ca
commit 268e7ad644
2 changed files with 7 additions and 0 deletions

View file

@ -361,6 +361,12 @@ class EmailAccount(Document):
communication.reference_doctype = parent.doctype
communication.reference_name = parent.name
# check if message is notification and disable notifications for this message
isnotification = email.mail.get("isnotification")
if isnotification:
if "notification" in isnotification:
communication.unread_notification_sent = 1
def set_sender_field_and_subject_field(self):
'''Identify the sender and subject fields from the `append_to` DocType'''
# set subject_field and sender_field

View file

@ -188,6 +188,7 @@ class EMail:
self.msg_root["Message-Id"] = '<' + message_id + '>'
else:
self.msg_root["Message-Id"] = get_message_id()
self.msg_root["isnotification"] = '<notification>'
def set_in_reply_to(self, in_reply_to):
"""Used to send the Message-Id of a received email back as In-Reply-To"""