FEATURE: do not send notification emails to users who are included in the To and CC header of an incoming email

This commit is contained in:
Gerhard Schlager
2017-11-10 16:10:25 +01:00
parent 32be3f98c9
commit 31e2385316
4 changed files with 99 additions and 2 deletions

View File

@@ -1 +1,20 @@
Fabricator(:incoming_email)
Fabricator(:incoming_email) do
message_id "12345@example.com"
subject "Hello world"
from_address "foo@example.com"
to_addresses "someone@else.com"
raw <<~RAW
Return-Path: <foo@example.com>
From: Foo <foo@example.com>
To: someone@else.com
Subject: Hello world
Date: Fri, 15 Jan 2016 00:12:43 +0100
Message-ID: <12345@example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
The body contains "Hello world" too.
RAW
end

View File

@@ -133,3 +133,14 @@ Fabricator(:private_message_post, from: :post) do
end
raw "Ssshh! This is our secret conversation!"
end
Fabricator(:post_via_email, from: :post) do
incoming_email
via_email true
after_create do |post|
incoming_email.topic = post.topic
incoming_email.post = post
incoming_email.user = post.user
end
end