2014-12-29 15:39:59 +00:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class EmailBuildTest < ActiveSupport::TestCase
|
|
|
|
test 'document complete check' do
|
|
|
|
|
|
|
|
html = '<b>test</b>'
|
2016-02-10 23:09:27 +00:00
|
|
|
result = Channel::EmailBuild.html_complete_check(html)
|
2014-12-29 15:39:59 +00:00
|
|
|
|
2016-02-10 23:09:27 +00:00
|
|
|
assert(result =~ /^<\!DOCTYPE/, 'test 1')
|
|
|
|
assert(result !~ /^.+?<\!DOCTYPE/, 'test 1')
|
|
|
|
assert(result =~ /<html>/, 'test 1')
|
|
|
|
assert(result =~ /font-family/, 'test 1')
|
|
|
|
assert(result =~ %r{<b>test</b>}, 'test 1')
|
2014-12-29 15:39:59 +00:00
|
|
|
|
|
|
|
html = 'invalid <!DOCTYPE html><html><b>test</b></html>'
|
2016-02-10 23:09:27 +00:00
|
|
|
result = Channel::EmailBuild.html_complete_check(html)
|
2014-12-29 15:39:59 +00:00
|
|
|
|
2016-02-10 23:09:27 +00:00
|
|
|
assert(result !~ /^<\!DOCTYPE/, 'test 2')
|
|
|
|
assert(result =~ /^.+?<\!DOCTYPE/, 'test 2')
|
|
|
|
assert(result =~ /<html>/, 'test 2')
|
|
|
|
assert(result !~ /font-family/, 'test 2')
|
|
|
|
assert(result =~ %r{<b>test</b>}, 'test 2')
|
2014-12-29 15:39:59 +00:00
|
|
|
|
2017-07-13 09:59:22 +00:00
|
|
|
# Issue #1230, missing backslashes
|
|
|
|
# 'Test URL: \\storage\project\100242-Inc'
|
|
|
|
html = '<b>Test URL</b>: \\\\storage\\project\\100242-Inc'
|
|
|
|
result = Channel::EmailBuild.html_complete_check(html)
|
|
|
|
assert(result.include?(html), 'backslashes must be kept')
|
|
|
|
|
2014-12-29 15:39:59 +00:00
|
|
|
end
|
2014-12-29 23:25:57 +00:00
|
|
|
|
2014-12-30 14:08:20 +00:00
|
|
|
test 'html email + attachment check' do
|
2018-06-05 06:40:40 +00:00
|
|
|
html = <<~MSG_HTML.chomp
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
|
|
</head>
|
|
|
|
<body style="font-family:Geneva,Helvetica,Arial,sans-serif; font-size: 12px;">
|
|
|
|
<div>> Welcome!</div><div>></div><div>> Thank you for installing Zammad. äöüß</div><div>></div>
|
|
|
|
</body>
|
|
|
|
</html>
|
2018-10-09 06:17:41 +00:00
|
|
|
MSG_HTML
|
2014-12-29 23:25:57 +00:00
|
|
|
mail = Channel::EmailBuild.build(
|
2018-12-19 17:31:51 +00:00
|
|
|
from: 'sender@example.com',
|
|
|
|
to: 'recipient@example.com',
|
|
|
|
body: html,
|
2015-04-27 13:42:53 +00:00
|
|
|
content_type: 'text/html',
|
2018-12-19 17:31:51 +00:00
|
|
|
attachments: [
|
2014-12-30 14:08:20 +00:00
|
|
|
{
|
2016-01-15 17:22:57 +00:00
|
|
|
'Mime-Type' => 'image/png',
|
2018-12-19 17:31:51 +00:00
|
|
|
:content => 'xxx',
|
|
|
|
:filename => 'somename.png'
|
2018-04-16 09:58:03 +00:00
|
|
|
}
|
2014-12-30 14:08:20 +00:00
|
|
|
],
|
2014-12-29 23:25:57 +00:00
|
|
|
)
|
|
|
|
|
2018-08-22 10:05:14 +00:00
|
|
|
text_should = <<~MSG_TEXT.chomp
|
2019-03-27 12:02:56 +00:00
|
|
|
> Welcome!\r
|
|
|
|
>\r
|
|
|
|
> Thank you for installing Zammad. äöüß\r
|
|
|
|
>\r
|
2018-10-09 06:17:41 +00:00
|
|
|
MSG_TEXT
|
2018-06-05 06:40:40 +00:00
|
|
|
assert_equal(text_should, mail.text_part.body.to_s)
|
2019-03-27 12:02:56 +00:00
|
|
|
|
|
|
|
html_should = <<~MSG_HTML.chomp
|
|
|
|
<!DOCTYPE html>\r
|
|
|
|
<html>\r
|
|
|
|
<head>\r
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\r
|
|
|
|
</head>\r
|
|
|
|
<body style="font-family:Geneva,Helvetica,Arial,sans-serif; font-size: 12px;">\r
|
|
|
|
<div>> Welcome!</div><div>></div><div>> Thank you for installing Zammad. äöüß</div><div>></div>\r
|
|
|
|
</body>\r
|
|
|
|
</html>
|
|
|
|
MSG_HTML
|
|
|
|
assert_equal(html_should, mail.html_part.body.to_s)
|
2014-12-29 23:25:57 +00:00
|
|
|
|
2014-12-30 14:08:20 +00:00
|
|
|
parser = Channel::EmailParser.new
|
2016-02-10 23:09:27 +00:00
|
|
|
data = parser.parse(mail.to_s)
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
# check body
|
2017-03-10 06:49:01 +00:00
|
|
|
should = '<div>> Welcome!</div><div>></div><div>> Thank you for installing Zammad. äöüß</div><div>></div>'
|
2016-02-10 23:09:27 +00:00
|
|
|
assert_equal(should, data[:body])
|
2016-06-21 15:14:15 +00:00
|
|
|
assert_equal('text/html', data[:content_type])
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
# check count of attachments, only 2, because 3 part is text message and is already in body
|
2016-02-10 23:09:27 +00:00
|
|
|
assert_equal(2, data[:attachments].length)
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
# check attachments
|
2017-11-23 08:09:44 +00:00
|
|
|
data[:attachments]&.each do |attachment|
|
|
|
|
if attachment[:filename] == 'message.html'
|
|
|
|
assert_nil(attachment[:preferences]['Content-ID'])
|
|
|
|
assert_equal(true, attachment[:preferences]['content-alternative'])
|
|
|
|
assert_equal('text/html', attachment[:preferences]['Mime-Type'])
|
|
|
|
assert_equal('UTF-8', attachment[:preferences]['Charset'])
|
|
|
|
elsif attachment[:filename] == 'somename.png'
|
|
|
|
assert_nil(attachment[:preferences]['Content-ID'])
|
|
|
|
assert_nil(attachment[:preferences]['content-alternative'])
|
|
|
|
assert_equal('image/png', attachment[:preferences]['Mime-Type'])
|
|
|
|
assert_equal('UTF-8', attachment[:preferences]['Charset'])
|
|
|
|
else
|
|
|
|
assert(false, "invalid attachment, should not be there, #{attachment.inspect}")
|
2017-10-01 12:25:52 +00:00
|
|
|
end
|
2014-12-30 14:08:20 +00:00
|
|
|
end
|
2014-12-29 23:25:57 +00:00
|
|
|
end
|
|
|
|
|
2014-12-30 14:08:20 +00:00
|
|
|
test 'plain email + attachment check' do
|
2018-06-05 06:40:40 +00:00
|
|
|
text = <<~MSG_TEXT.chomp
|
|
|
|
> Welcome!
|
|
|
|
>
|
|
|
|
> Thank you for installing Zammad. äöüß
|
|
|
|
>
|
2018-10-09 06:17:41 +00:00
|
|
|
MSG_TEXT
|
2014-12-30 14:08:20 +00:00
|
|
|
mail = Channel::EmailBuild.build(
|
2018-12-19 17:31:51 +00:00
|
|
|
from: 'sender@example.com',
|
|
|
|
to: 'recipient@example.com',
|
|
|
|
body: text,
|
2015-04-27 13:42:53 +00:00
|
|
|
attachments: [
|
2014-12-30 14:08:20 +00:00
|
|
|
{
|
2016-01-15 17:22:57 +00:00
|
|
|
'Mime-Type' => 'image/png',
|
2018-12-19 17:31:51 +00:00
|
|
|
:content => 'xxx',
|
|
|
|
:filename => 'somename.png'
|
2018-04-16 09:58:03 +00:00
|
|
|
}
|
2014-12-30 14:08:20 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-03-27 12:02:56 +00:00
|
|
|
text_should = <<~MSG_TEXT.chomp
|
|
|
|
> Welcome!\r
|
|
|
|
>\r
|
|
|
|
> Thank you for installing Zammad. äöüß\r
|
|
|
|
>\r
|
|
|
|
MSG_TEXT
|
|
|
|
assert_equal(text_should, mail.text_part.body.to_s)
|
2017-03-24 10:02:13 +00:00
|
|
|
assert_nil(mail.html_part)
|
2018-04-16 09:58:03 +00:00
|
|
|
assert_equal('image/png; filename=somename.png', mail.attachments[0].content_type)
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
parser = Channel::EmailParser.new
|
2016-02-10 23:09:27 +00:00
|
|
|
data = parser.parse(mail.to_s)
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
# check body
|
2018-08-22 10:05:14 +00:00
|
|
|
assert_equal(text, data[:body])
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
# check count of attachments, 2
|
2016-02-10 23:09:27 +00:00
|
|
|
assert_equal(1, data[:attachments].length)
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
# check attachments
|
2017-11-23 08:09:44 +00:00
|
|
|
data[:attachments]&.each do |attachment|
|
|
|
|
if attachment[:filename] == 'somename.png'
|
|
|
|
assert_nil(attachment[:preferences]['Content-ID'])
|
|
|
|
assert_nil(attachment[:preferences]['content-alternative'])
|
|
|
|
assert_equal('image/png', attachment[:preferences]['Mime-Type'])
|
|
|
|
assert_equal('UTF-8', attachment[:preferences]['Charset'])
|
|
|
|
else
|
|
|
|
assert(false, "invalid attachment, should not be there, #{attachment.inspect}")
|
2017-10-01 12:25:52 +00:00
|
|
|
end
|
2014-12-30 14:08:20 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-04-16 09:58:03 +00:00
|
|
|
test 'plain email + attachment check 2' do
|
|
|
|
ticket1 = Ticket.create!(
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'some article helper test1',
|
|
|
|
group: Group.lookup(name: 'Users'),
|
|
|
|
customer_id: 2,
|
|
|
|
state: Ticket::State.lookup(name: 'new'),
|
|
|
|
priority: Ticket::Priority.lookup(name: '2 normal'),
|
2018-04-16 09:58:03 +00:00
|
|
|
updated_by_id: 1,
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
assert(ticket1, 'ticket created')
|
|
|
|
|
|
|
|
# create inbound article #1
|
|
|
|
article1 = Ticket::Article.create!(
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: ticket1.id,
|
|
|
|
from: 'some_sender@example.com',
|
|
|
|
to: 'some_recipient@example.com',
|
|
|
|
subject: 'some subject',
|
|
|
|
message_id: 'some@id',
|
|
|
|
content_type: 'text/html',
|
|
|
|
body: 'some message article helper test1 <div><img style="width: 85.5px; height: 49.5px" src="cid:15.274327094.140938@zammad.example.com">asdasd<img src="cid:15.274327094.140939@zammad.example.com"><br>',
|
|
|
|
internal: false,
|
|
|
|
sender: Ticket::Article::Sender.find_by(name: 'Customer'),
|
|
|
|
type: Ticket::Article::Type.find_by(name: 'email'),
|
2018-04-16 09:58:03 +00:00
|
|
|
updated_by_id: 1,
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
|
|
|
|
store1 = Store.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article1.id,
|
|
|
|
data: 'content_file1_normally_should_be_an_ics_calendar_file',
|
|
|
|
filename: 'schedule.ics',
|
|
|
|
preferences: {
|
2018-04-16 09:58:03 +00:00
|
|
|
'Mime-Type' => 'text/calendar'
|
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
|
2018-06-05 06:40:40 +00:00
|
|
|
text = <<~MSG_TEXT.chomp
|
|
|
|
> Welcome!
|
|
|
|
>
|
|
|
|
> Thank you for installing Zammad. äöüß
|
|
|
|
>
|
2018-10-09 06:17:41 +00:00
|
|
|
MSG_TEXT
|
2018-04-16 09:58:03 +00:00
|
|
|
mail = Channel::EmailBuild.build(
|
2018-12-19 17:31:51 +00:00
|
|
|
from: 'sender@example.com',
|
|
|
|
to: 'recipient@example.com',
|
|
|
|
body: text,
|
2018-04-16 09:58:03 +00:00
|
|
|
attachments: [
|
|
|
|
store1
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-03-27 12:02:56 +00:00
|
|
|
text_should = <<~MSG_TEXT.chomp
|
|
|
|
> Welcome!\r
|
|
|
|
>\r
|
|
|
|
> Thank you for installing Zammad. äöüß\r
|
|
|
|
>\r
|
|
|
|
MSG_TEXT
|
|
|
|
assert_equal(text_should, mail.text_part.body.to_s)
|
2018-04-16 09:58:03 +00:00
|
|
|
assert_nil(mail.html_part)
|
|
|
|
assert_equal('text/calendar; filename=schedule.ics', mail.attachments[0].content_type)
|
|
|
|
|
|
|
|
parser = Channel::EmailParser.new
|
|
|
|
data = parser.parse(mail.to_s)
|
|
|
|
|
|
|
|
# check body
|
2018-08-22 10:05:14 +00:00
|
|
|
assert_equal(text, data[:body])
|
2018-04-16 09:58:03 +00:00
|
|
|
|
|
|
|
# check count of attachments, 2
|
|
|
|
assert_equal(1, data[:attachments].length)
|
|
|
|
|
|
|
|
# check attachments
|
|
|
|
data[:attachments]&.each do |attachment|
|
|
|
|
if attachment[:filename] == 'schedule.ics'
|
|
|
|
assert(attachment[:preferences]['Content-ID'])
|
|
|
|
assert_nil(attachment[:preferences]['content-alternative'])
|
|
|
|
assert_equal('text/calendar', attachment[:preferences]['Mime-Type'])
|
|
|
|
assert_equal('UTF-8', attachment[:preferences]['Charset'])
|
|
|
|
else
|
|
|
|
assert(false, "invalid attachment, should not be there, #{attachment.inspect}")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-12-30 14:08:20 +00:00
|
|
|
test 'plain email + without attachment check' do
|
2018-06-05 06:40:40 +00:00
|
|
|
text = <<~MSG_TEXT.chomp
|
|
|
|
> Welcome!
|
|
|
|
>
|
|
|
|
> Thank you for installing Zammad. äöüß
|
|
|
|
>
|
2018-10-09 06:17:41 +00:00
|
|
|
MSG_TEXT
|
2014-12-30 14:08:20 +00:00
|
|
|
mail = Channel::EmailBuild.build(
|
2015-04-27 13:42:53 +00:00
|
|
|
from: 'sender@example.com',
|
2018-12-19 17:31:51 +00:00
|
|
|
to: 'recipient@example.com',
|
2015-04-27 13:42:53 +00:00
|
|
|
body: text,
|
2014-12-30 14:08:20 +00:00
|
|
|
)
|
|
|
|
|
2019-03-27 12:02:56 +00:00
|
|
|
text_should = <<~MSG_TEXT.chomp
|
|
|
|
> Welcome!\r
|
|
|
|
>\r
|
|
|
|
> Thank you for installing Zammad. äöüß\r
|
|
|
|
>\r
|
|
|
|
MSG_TEXT
|
|
|
|
assert_equal(text_should, mail.body.to_s)
|
2017-03-24 10:02:13 +00:00
|
|
|
assert_nil(mail.html_part)
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
parser = Channel::EmailParser.new
|
2016-02-10 23:09:27 +00:00
|
|
|
data = parser.parse(mail.to_s)
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
# check body
|
2018-08-22 10:05:14 +00:00
|
|
|
assert_equal(text, data[:body])
|
2014-12-30 14:08:20 +00:00
|
|
|
|
|
|
|
# check count of attachments, 0
|
2016-02-10 23:09:27 +00:00
|
|
|
assert_equal(0, data[:attachments].length)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
test 'email - html email client fixes' do
|
|
|
|
|
|
|
|
# https://github.com/martini/zammad/issues/165
|
|
|
|
html_raw = '<blockquote type="cite">some
|
|
|
|
text
|
|
|
|
</blockquote>
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
<blockquote type="cite">some
|
|
|
|
text
|
|
|
|
</blockquote>'
|
|
|
|
html_with_fixes = Channel::EmailBuild.html_mail_client_fixes(html_raw)
|
|
|
|
assert_not_equal(html_with_fixes, html_raw)
|
|
|
|
|
2016-06-09 13:00:11 +00:00
|
|
|
html_should = '<blockquote type="cite" style="border-left: 2px solid blue; margin: 0 0 16px; padding: 8px 12px 8px 12px;">some
|
2016-02-10 23:09:27 +00:00
|
|
|
text
|
|
|
|
</blockquote>
|
|
|
|
|
|
|
|
123
|
|
|
|
|
2016-06-09 13:00:11 +00:00
|
|
|
<blockquote type="cite" style="border-left: 2px solid blue; margin: 0 0 16px; padding: 8px 12px 8px 12px;">some
|
2016-02-10 23:09:27 +00:00
|
|
|
text
|
|
|
|
</blockquote>'
|
|
|
|
assert_equal(html_should, html_with_fixes)
|
2014-12-30 14:08:20 +00:00
|
|
|
|
2016-05-20 12:16:36 +00:00
|
|
|
html_raw = '<p>some
|
|
|
|
text
|
|
|
|
</p>
|
|
|
|
<p>123</p>'
|
|
|
|
html_with_fixes = Channel::EmailBuild.html_mail_client_fixes(html_raw)
|
|
|
|
assert_not_equal(html_with_fixes, html_raw)
|
|
|
|
|
|
|
|
html_should = '<p style="margin: 0;">some
|
|
|
|
text
|
|
|
|
</p>
|
|
|
|
<p style="margin: 0;">123</p>'
|
|
|
|
assert_equal(html_should, html_with_fixes)
|
2016-06-21 15:14:15 +00:00
|
|
|
|
|
|
|
html_raw = '<p>sometext</p><hr><p>123</p>'
|
|
|
|
html_with_fixes = Channel::EmailBuild.html_mail_client_fixes(html_raw)
|
|
|
|
assert_not_equal(html_with_fixes, html_raw)
|
|
|
|
|
|
|
|
html_should = '<p style="margin: 0;">sometext</p><hr style="margin-top: 6px; margin-bottom: 6px; border: 0; border-top: 1px solid #dfdfdf;"><p style="margin: 0;">123</p>'
|
|
|
|
assert_equal(html_should, html_with_fixes)
|
2014-12-30 14:08:20 +00:00
|
|
|
end
|
2014-12-29 23:25:57 +00:00
|
|
|
|
2016-11-25 12:43:28 +00:00
|
|
|
test 'from checks' do
|
|
|
|
|
|
|
|
quoted_in_one_line = Channel::EmailBuild.recipient_line('Somebody @ "Company"', 'some.body@example.com')
|
|
|
|
assert_equal('"Somebody @ \"Company\"" <some.body@example.com>', quoted_in_one_line)
|
|
|
|
|
|
|
|
quoted_in_one_line = Channel::EmailBuild.recipient_line('Somebody', 'some.body@example.com')
|
|
|
|
assert_equal('Somebody <some.body@example.com>', quoted_in_one_line)
|
|
|
|
|
|
|
|
quoted_in_one_line = Channel::EmailBuild.recipient_line('Somebody | Some Org', 'some.body@example.com')
|
|
|
|
assert_equal('"Somebody | Some Org" <some.body@example.com>', quoted_in_one_line)
|
|
|
|
|
|
|
|
quoted_in_one_line = Channel::EmailBuild.recipient_line('Test Master Agent via Support', 'some.body@example.com')
|
|
|
|
assert_equal('"Test Master Agent via Support" <some.body@example.com>', quoted_in_one_line)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2019-03-27 12:02:56 +00:00
|
|
|
# #2362 - Attached text files get prepended on e-mail reply instead of appended
|
|
|
|
test 'plain email + text attachment' do
|
|
|
|
ticket1 = Ticket.create!(
|
|
|
|
title: 'some article text attachment test',
|
|
|
|
group: Group.lookup(name: 'Users'),
|
|
|
|
customer_id: 2,
|
|
|
|
state: Ticket::State.lookup(name: 'new'),
|
|
|
|
priority: Ticket::Priority.lookup(name: '2 normal'),
|
|
|
|
updated_by_id: 1,
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
assert(ticket1, 'ticket created')
|
|
|
|
|
|
|
|
article1 = Ticket::Article.create!(
|
|
|
|
ticket_id: ticket1.id,
|
|
|
|
from: 'some_sender@example.com',
|
|
|
|
to: 'some_recipient@example.com',
|
|
|
|
subject: 'some subject',
|
|
|
|
message_id: 'some@id',
|
|
|
|
content_type: 'text/html',
|
|
|
|
body: 'some message article helper test1 <div><img style="width: 85.5px; height: 49.5px" src="cid:15.274327094.140938@zammad.example.com">asdasd<img src="cid:15.274327094.140939@zammad.example.com"><br>',
|
|
|
|
internal: false,
|
|
|
|
sender: Ticket::Article::Sender.find_by(name: 'Customer'),
|
|
|
|
type: Ticket::Article::Type.find_by(name: 'email'),
|
|
|
|
updated_by_id: 1,
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
|
|
|
|
text = <<~MSG_TEXT.chomp
|
|
|
|
> Welcome!
|
|
|
|
>
|
|
|
|
> Email Content
|
|
|
|
MSG_TEXT
|
|
|
|
|
|
|
|
store1 = Store.add(
|
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article1.id,
|
|
|
|
data: 'Text Content',
|
|
|
|
filename: 'text_file.txt',
|
|
|
|
preferences: {
|
|
|
|
'Mime-Type' => 'text/plain'
|
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
|
|
|
|
mail = Channel::EmailBuild.build(
|
|
|
|
from: 'sender@example.com',
|
|
|
|
to: 'recipient@example.com',
|
|
|
|
body: text,
|
|
|
|
attachments: [
|
|
|
|
store1
|
|
|
|
],
|
|
|
|
)
|
|
|
|
File.write('append_test.eml', mail.to_s)
|
|
|
|
|
|
|
|
# Email Content should appear before the Text Content within the raw email
|
|
|
|
assert_match(/Email Content[\s\S]*Text Content/, mail.to_s)
|
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|