do not send an auto reply to 'noreply*' addresses
This commit is contained in:
parent
1804939407
commit
c79b3185e5
3 changed files with 38 additions and 9 deletions
|
@ -182,11 +182,11 @@ def receive_email(envelope, log=None):
|
|||
if new:
|
||||
# auto reply if new issue
|
||||
references = collect_references(active_issue_thread)
|
||||
|
||||
reply_email = Email.objects.create(
|
||||
sender=recipient, recipient=sender, body="Thank you for your message.", subject="Message received",
|
||||
in_reply_to=header_message_id, event=target_event, issue_thread=active_issue_thread)
|
||||
reply = make_reply(reply_email, references)
|
||||
if not sender.startswith('noreply'):
|
||||
reply_email = Email.objects.create(
|
||||
sender=recipient, recipient=sender, body="Thank you for your message.", subject="Message received",
|
||||
in_reply_to=header_message_id, event=target_event, issue_thread=active_issue_thread)
|
||||
reply = make_reply(reply_email, references)
|
||||
else:
|
||||
# change state if not new
|
||||
if active_issue_thread.state != 'pending_new':
|
||||
|
@ -223,7 +223,7 @@ class LMTPHandler:
|
|||
"message": "email received"}
|
||||
)
|
||||
log.info(f"Sent message to frontend")
|
||||
if new:
|
||||
if new and reply:
|
||||
await send_smtp(reply, log)
|
||||
log.info("Sent auto reply")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue