mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-48002-master' of git://github.com/ankitagarwal/moodle
This commit is contained in:
commit
a7f81bc72d
@ -237,4 +237,98 @@ abstract class handler {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove quoted message string from the text (NOT HTML) message.
|
||||
*
|
||||
* @param \stdClass $messagedata The Inbound Message record
|
||||
*
|
||||
* @return array message and message format to use.
|
||||
*/
|
||||
protected static function remove_quoted_text($messagedata) {
|
||||
$linecount = self::get_linecount_to_remove($messagedata);
|
||||
if (!empty($messagedata->plain)) {
|
||||
$text = $messagedata->plain;
|
||||
} else {
|
||||
$text = html_to_text($messagedata->html);
|
||||
}
|
||||
$messageformat = FORMAT_PLAIN;
|
||||
|
||||
$splitted = preg_split("/\n|\r/", $text);
|
||||
if (empty($splitted)) {
|
||||
return array($text, $messageformat);
|
||||
}
|
||||
|
||||
// Remove extra line. "Xyz wrote on...".
|
||||
$count = 0;
|
||||
$i = 0;
|
||||
$flag = false;
|
||||
foreach ($splitted as $i => $element) {
|
||||
if (stripos($element, ">") === 0) {
|
||||
// Quoted text found.
|
||||
$flag = true;
|
||||
// Remove 2 non empty line before this.
|
||||
for ($j = $i - 1; ($j >= 0); $j--) {
|
||||
$element = $splitted[$j];
|
||||
if (!empty($element)) {
|
||||
unset($splitted[$j]);
|
||||
$count++;
|
||||
}
|
||||
if ($count == $linecount) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($flag) {
|
||||
// Quoted text was found.
|
||||
$k = $i - $linecount; // Where to start the chopping process.
|
||||
|
||||
// Remove quoted text.
|
||||
$splitted = array_slice($splitted, 0, $k);
|
||||
|
||||
// Strip out empty lines towards the end, since a lot of clients add a huge chunk of empty lines.
|
||||
$reverse = array_reverse($splitted);
|
||||
foreach ($reverse as $i => $line) {
|
||||
if (empty($line)) {
|
||||
unset($reverse[$i]);
|
||||
} else {
|
||||
// Non empty line found.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$replaced = implode(PHP_EOL, array_reverse($reverse));
|
||||
$message = trim($replaced);
|
||||
} else {
|
||||
// No quoted text, fallback to original text.
|
||||
if (!empty($messagedata->html)) {
|
||||
$message = $messagedata->html;
|
||||
$messageformat = FORMAT_HTML;
|
||||
} else {
|
||||
$message = $messagedata->plain;
|
||||
}
|
||||
}
|
||||
return array($message, $messageformat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to guess how many lines to remove from the email to delete "xyz wrote on" text. Hard coded numbers for various email
|
||||
* clients.
|
||||
* Gmail uses two
|
||||
* Evolution uses one
|
||||
* Thunderbird uses one
|
||||
*
|
||||
* @param \stdClass $messagedata The Inbound Message record
|
||||
*
|
||||
* @return int number of lines to chop off before the start of quoted text.
|
||||
*/
|
||||
protected static function get_linecount_to_remove($messagedata) {
|
||||
$linecount = 1;
|
||||
if (!empty($messagedata->html) && stripos($messagedata->html, 'gmail_quote') !== false) {
|
||||
// Gmail uses two lines.
|
||||
$linecount = 2;
|
||||
}
|
||||
return $linecount;
|
||||
}
|
||||
}
|
||||
|
4
lib/tests/fixtures/messageinbound/SAMPLE
vendored
Normal file
4
lib/tests/fixtures/messageinbound/SAMPLE
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
----CLIENT----
|
||||
----EXPECTEDPLAIN----
|
||||
----EXPECTEDHTML----
|
||||
----FULLSOURCE----
|
131
lib/tests/fixtures/messageinbound/evolution.test
vendored
Normal file
131
lib/tests/fixtures/messageinbound/evolution.test
vendored
Normal file
@ -0,0 +1,131 @@
|
||||
----CLIENT----
|
||||
OS: Ubuntu 14.04
|
||||
Mail Client: Evolution
|
||||
Client Version: 31.6.0
|
||||
Date: 30/04/2015
|
||||
|
||||
----EXPECTEDPLAIN----
|
||||
An ion meets his atom friend on the street and says he's lost an
|
||||
electron. "Are you sure?" asks the atom. The ion replies, "I'm
|
||||
positive."
|
||||
|
||||
----EXPECTEDHTML----
|
||||
An ion meets his atom friend on the street and says he's lost an
|
||||
electron. "Are you sure?" asks the atom. The ion replies, "I'm positive."
|
||||
|
||||
----FULLSOURCE----
|
||||
Message-ID: <1430198383.10608.0.camel@jean>
|
||||
Subject: Re: [DIVERTED t1@localhost] test: Re: test
|
||||
From: ankit <ankit@localhost>
|
||||
To: ankit+AAAAAAAAAAIAAAAAAAAADQAAAAAAAAA3xIUdg5K043cciDEJ@localhost
|
||||
Date: Tue, 28 Apr 2015 10:49:43 +0530
|
||||
In-Reply-To: <77abfbf3eea680a5bd9cd88d2ca74e602b2168c7684d404d5049289f49f30e0f@localhost>
|
||||
References:
|
||||
<cc33da86ad1b5b11e72155da74ca23c92e5e295c534f724162172905dee7a2fb@localhost>
|
||||
<77abfbf3eea680a5bd9cd88d2ca74e602b2168c7684d404d5049289f49f30e0f@localhost>
|
||||
Content-Type: multipart/alternative; boundary="=-HCcF2t8PQgHyHwzJsOEP"
|
||||
X-Mailer: Evolution 3.10.4-0ubuntu2
|
||||
Mime-Version: 1.0
|
||||
X-Evolution-Identity: 1416821596.2740.0@jean
|
||||
X-Evolution-Fcc: folder://local/Sent
|
||||
X-Evolution-Transport: 1416821597.2740.10@jean
|
||||
X-Evolution-Source-Folder: folder://1416821596.2740.2%40jean/INBOX
|
||||
X-Evolution-Source-Message: 298
|
||||
X-Evolution-Source-Flags: ANSWERED SEEN
|
||||
X-Evolution-Format: text/html
|
||||
X-Evolution-Source:
|
||||
|
||||
|
||||
--=-HCcF2t8PQgHyHwzJsOEP
|
||||
Content-Type: text/plain; charset="UTF-8"
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
An ion meets his atom friend on the street and says he's lost an
|
||||
electron. "Are you sure?" asks the atom. The ion replies, "I'm
|
||||
positive."
|
||||
On Tue, 2015-04-28 at 13:18 +0800, Admin User wrote:
|
||||
> test » Forums » Forum » test
|
||||
>
|
||||
> Picture of Admin User
|
||||
> Re: test
|
||||
> by Admin User - Tuesday, 28 April
|
||||
> 2015, 1:17 PM
|
||||
>
|
||||
> Tell me a joke
|
||||
>
|
||||
>
|
||||
> Show parent | Reply
|
||||
> See this post in context
|
||||
>
|
||||
> ______________________________________________________________________
|
||||
>
|
||||
> Unsubscribe from this discussion Unsubscribe from all forums Change
|
||||
> your forum digest preferences
|
||||
>
|
||||
>
|
||||
> You can reply to this forum post via email.
|
||||
>
|
||||
|
||||
|
||||
|
||||
--=-HCcF2t8PQgHyHwzJsOEP
|
||||
Content-Type: text/html; charset="utf-8"
|
||||
Content-Transfer-Encoding: 7bit
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
|
||||
<META NAME="GENERATOR" CONTENT="GtkHTML/4.6.6">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
An ion meets his atom friend on the street and says he's lost an<BR>
|
||||
electron. "Are you sure?" asks the atom. The ion replies, "I'm positive."<BR>
|
||||
On Tue, 2015-04-28 at 13:18 +0800, Admin User wrote:
|
||||
<BLOCKQUOTE TYPE=CITE>
|
||||
<A HREF="http://localhost/stable_master_forum/course/view.php?id=2">test</A> » <A HREF="http://localhost/stable_master_forum/mod/forum/index.php?id=2">Forums</A> » <A HREF="http://localhost/stable_master_forum/mod/forum/view.php?f=2">Forum</A> » <A HREF="http://localhost/stable_master_forum/mod/forum/discuss.php?d=1">test</A>
|
||||
</BLOCKQUOTE>
|
||||
<BLOCKQUOTE TYPE=CITE>
|
||||
<TABLE CELLSPACING="0" CELLPADDING="3">
|
||||
<TR>
|
||||
<TD WIDTH="35" VALIGN="top">
|
||||
<A HREF="http://localhost/stable_master_forum/user/view.php?id=2&course=2"><IMG SRC="http://localhost/stable_master_forum/theme/image.php?theme=clean&component=core&image=u%2Ff2&svg=0" WIDTH="35" HEIGHT="35" ALIGN="bottom" ALT="Picture of Admin User"></A>
|
||||
</TD>
|
||||
<TD>
|
||||
Re: test
|
||||
by <A HREF="http://localhost/stable_master_forum/user/view.php?id=2&course=2">Admin User</A> - Tuesday, 28 April 2015, 1:17 PM
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
|
||||
</TD>
|
||||
<TD>
|
||||
Tell me a joke<BR>
|
||||
<BR>
|
||||
<BR>
|
||||
<A HREF="http://localhost/stable_master_forum/mod/forum/discuss.php?d=1&parent=1">Show parent</A> | <A HREF="http://localhost/stable_master_forum/mod/forum/post.php?reply=55">Reply</A>
|
||||
<A HREF="http://localhost/stable_master_forum/mod/forum/discuss.php?d=1#p55">See this post in context</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<HR ALIGN="center">
|
||||
|
||||
</BLOCKQUOTE>
|
||||
<BLOCKQUOTE TYPE=CITE>
|
||||
<A HREF="http://localhost/stable_master_forum/mod/forum/subscribe.php?id=2&d=1">Unsubscribe from this discussion</A> <A HREF="http://localhost/stable_master_forum/mod/forum/unsubscribeall.php">Unsubscribe from all forums</A> <A HREF="http://localhost/stable_master_forum/mod/forum/index.php?id=2">Change your forum digest preferences</A>
|
||||
</BLOCKQUOTE>
|
||||
<BLOCKQUOTE TYPE=CITE>
|
||||
<BR>
|
||||
You can reply to this forum post via email.<BR>
|
||||
<BR>
|
||||
</BLOCKQUOTE>
|
||||
<BR>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
|
||||
--=-HCcF2t8PQgHyHwzJsOEP--
|
||||
|
||||
|
335
lib/tests/fixtures/messageinbound/ios.test
vendored
Normal file
335
lib/tests/fixtures/messageinbound/ios.test
vendored
Normal file
@ -0,0 +1,335 @@
|
||||
----CLIENT----
|
||||
OS: ios 8.1.1
|
||||
Mail Client: ios (iPad Mini Retina)
|
||||
Client Version: 8.1.1
|
||||
Date: 04/05/2015
|
||||
|
||||
----EXPECTEDPLAIN----
|
||||
Sample reply messages:
|
||||
|
||||
Thanks for offering to help with QA testing. I've added you to the testers group in the tracker, so you can now pass or fail QA tests. Hopefully the process is fully explained in http://docs.moodle.org/dev/QA_testing but if there's anything you're not sure about, please post in the testing and QA forum.
|
||||
|
||||
|
||||
Thanks for offering to help with QA testing. Please create an account in the Moodle Tracker and let me know your Tracker username then I can add you to the testers group.
|
||||
|
||||
|
||||
Thanks for offering to help with QA testing. We recently finished the Moodle 2.8 QA cycle, so our next QA cycle won't be for a while, however you are welcome to try things out on our Moodle QA Testing site http://qa.moodle.net/ and post in the Testing and QA forum http://moodle.org/mod/forum/view.php?id=56 about any issues you come across, or any questions you have. If you come across any bugs (obvious problems), please report them in the Moodle tracker.
|
||||
|
||||
|
||||
Thanks for helping with QA testing. Your help would be appreciated even more if you could just add a comment when passing a test, such as feedback about the feature e.g. “Teachers are going to love this” or even simply "This test passes - yippee!" to confirm that the test wasn't accidentally passed without being run.
|
||||
|
||||
Thanks for helping with QA testing. It has been observed that you assigned this issue to yourself for testing, but no action has been taken on this. It will be helpful if you can either test this or un-assign yourself, so someone else can take it.
|
||||
|
||||
----EXPECTEDHTML----
|
||||
Sample reply messages:
|
||||
|
||||
Thanks for offering to help with QA testing. I've added you to the testers
|
||||
group in the tracker, so you can now pass or fail QA tests. Hopefully the
|
||||
process is fully explained in http://docs.moodle.org/dev/QA_testing [10]
|
||||
but if there's anything you're not sure about, please post in the testing
|
||||
and QA forum.
|
||||
|
||||
Thanks for offering to help with QA testing. Please create an account in
|
||||
the Moodle Tracker and let me know your Tracker username then I can add you
|
||||
to the testers group.
|
||||
|
||||
Thanks for offering to help with QA testing. We recently finished the
|
||||
Moodle 2.8 QA cycle, so our next QA cycle won't be for a while, however you
|
||||
are welcome to try things out on our Moodle QA Testing site
|
||||
http://qa.moodle.net/ [11] and post in the Testing and QA forum
|
||||
http://moodle.org/mod/forum/view.php?id=56 [12] about any issues you come
|
||||
across, or any questions you have. If you come across any bugs (obvious
|
||||
problems), please report them in the Moodle tracker.
|
||||
|
||||
Thanks for helping with QA testing. Your help would be appreciated even
|
||||
more if you could just add a comment when passing a test, such as feedback
|
||||
about the feature e.g. “Teachers are going to love this” or even simply
|
||||
"This test passes - yippee!" to confirm that the test wasn't accidentally
|
||||
passed without being run.
|
||||
|
||||
Thanks for helping with QA testing. It has been observed that you assigned
|
||||
this issue to yourself for testing, but no action has been taken on this.
|
||||
It will be helpful if you can either test this or un-assign yourself, so
|
||||
someone else can take it.
|
||||
|
||||
Sent from my iPad
|
||||
|
||||
----FULLSOURCE----
|
||||
Delivered-To: moodlehqtest+aaaaaaaaaaiaaaaaaaaaagaaaaaaaaayvgt8xe92mmlgeicg@example.com
|
||||
Received: by 10.50.159.130 with SMTP id xc2csp1451249igb;
|
||||
Sun, 3 May 2015 20:02:36 -0700 (PDT)
|
||||
X-Received: by 10.67.4.230 with SMTP id ch6mr38162348pad.137.1430708556295;
|
||||
Sun, 03 May 2015 20:02:36 -0700 (PDT)
|
||||
Return-Path: <andrewrn@example.com>
|
||||
Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com. [2607:f8b0:400e:c03::229])
|
||||
by mx.google.com with ESMTPS id gl6si17965581pac.197.2015.05.03.20.02.35
|
||||
for <moodlehqtest+AAAAAAAAAAIAAAAAAAAAAgAAAAAAAAAYvGT8Xe92mmlGEicg@example.com>
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
|
||||
Sun, 03 May 2015 20:02:36 -0700 (PDT)
|
||||
Received-SPF: pass (google.com: domain of andrewrn@example.com designates 2607:f8b0:400e:c03::229 as permitted sender) client-ip=2607:f8b0:400e:c03::229;
|
||||
Authentication-Results: mx.google.com;
|
||||
spf=pass (google.com: domain of andrewrn@example.com designates 2607:f8b0:400e:c03::229 as permitted sender) smtp.mail=andrewrn@example.com;
|
||||
dkim=pass header.i=@example.com;
|
||||
dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
|
||||
Received: by mail-pa0-x229.google.com with SMTP id yx8so148925642pac.1
|
||||
for <moodlehqtest+AAAAAAAAAAIAAAAAAAAAAgAAAAAAAAAYvGT8Xe92mmlGEicg@example.com>; Sun, 03 May 2015 20:02:35 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=gmail.com; s=20120113;
|
||||
h=from:content-type:content-transfer-encoding:mime-version:subject
|
||||
:message-id:date:references:in-reply-to:to;
|
||||
bh=EZm73X2O6OdzfLc1nsBxWhkpKHmDJNt33U63cRjQHAw=;
|
||||
b=IX/H6XP5WADMopMjPPQXpvr1Wm9TV67Ru+lWfBKXx8FstY2qSAf4g7P+EtCNBgWnac
|
||||
qNm6cTY+x3kx/ZPQLfpaQD4+QrEHteu8T4pilbjN0ikpu8K1lRMGXRqDjLf49yNJaXpP
|
||||
J4kMoye4i+3LA6ffGGer/5gax/s/gZ2M6nD8OCTuCxIVu51etROhDdo5OfsUK5w97R6P
|
||||
33bMm6wfzd/OjLrNNaFZydGEHK4qQUgwn7GcYi1cAq7g9SLl1lWT6n65IrhMkaqroDnV
|
||||
rBYzYdYKhJs2e16r0TBoKh0u+YHtZM9wF/3odFevDPxSnL56+lKUPpTkmuADNEQ+fJw9
|
||||
zrMw==
|
||||
X-Received: by 10.70.140.108 with SMTP id rf12mr38069446pdb.140.1430708555833;
|
||||
Sun, 03 May 2015 20:02:35 -0700 (PDT)
|
||||
Return-Path: <andrewrn@example.com>
|
||||
Received: from [172.20.255.99] (59-100-142-46.cust.static-ipl.aapt.com.au. [59.100.142.46])
|
||||
by mx.google.com with ESMTPSA id yv6sm2329352pac.29.2015.05.03.20.02.34
|
||||
for <moodlehqtest+AAAAAAAAAAIAAAAAAAAAAgAAAAAAAAAYvGT8Xe92mmlGEicg@example.com>
|
||||
(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
|
||||
Sun, 03 May 2015 20:02:34 -0700 (PDT)
|
||||
From: Andrew Robert Nicols <andrewrn@example.com>
|
||||
Content-Type: multipart/alternative;
|
||||
boundary=Apple-Mail-97963C5D-72E2-413A-89FF-624233E4337F
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Mime-Version: 1.0 (1.0)
|
||||
Subject: Re: MDL-48002: Testing of MDL-48002
|
||||
Message-Id: <ECE56778-577F-4B37-A28B-7789A19BBF3A@example.com>
|
||||
Date: Mon, 4 May 2015 11:02:31 +0800
|
||||
References: <15b35e982364f0003cea36e7a0464787ee6127fe5c21a54d229021314547699c@banana.per.in.moodle.com>
|
||||
In-Reply-To: <15b35e982364f0003cea36e7a0464787ee6127fe5c21a54d229021314547699c@banana.per.in.moodle.com>
|
||||
To: "moodlehqtest+AAAAAAAAAAIAAAAAAAAAAgAAAAAAAAAYvGT8Xe92mmlGEicg@example.com" <moodlehqtest+AAAAAAAAAAIAAAAAAAAAAgAAAAAAAAAYvGT8Xe92mmlGEicg@example.com>
|
||||
X-Mailer: iPad Mail (12B435)
|
||||
|
||||
|
||||
--Apple-Mail-97963C5D-72E2-413A-89FF-624233E4337F
|
||||
Content-Type: text/plain;
|
||||
charset=utf-8
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
=09
|
||||
Sample reply messages:
|
||||
|
||||
Thanks for offering to help with QA testing. I've added you to the testers g=
|
||||
roup in the tracker, so you can now pass or fail QA tests. Hopefully the pro=
|
||||
cess is fully explained in http://docs.moodle.org/dev/QA_testing but if ther=
|
||||
e's anything you're not sure about, please post in the testing and QA forum.=
|
||||
|
||||
|
||||
|
||||
Thanks for offering to help with QA testing. Please create an account in the=
|
||||
Moodle Tracker and let me know your Tracker username then I can add you to t=
|
||||
he testers group.
|
||||
|
||||
|
||||
Thanks for offering to help with QA testing. We recently finished the Moodle=
|
||||
2.8 QA cycle, so our next QA cycle won't be for a while, however you are we=
|
||||
lcome to try things out on our Moodle QA Testing site http://qa.moodle.net/ a=
|
||||
nd post in the Testing and QA forum http://moodle.org/mod/forum/view.php?id=3D=
|
||||
56 about any issues you come across, or any questions you have. If you come a=
|
||||
cross any bugs (obvious problems), please report them in the Moodle tracker.=
|
||||
|
||||
|
||||
|
||||
Thanks for helping with QA testing. Your help would be appreciated even more=
|
||||
if you could just add a comment when passing a test, such as feedback about=
|
||||
the feature e.g. =E2=80=9CTeachers are going to love this=E2=80=9D or even s=
|
||||
imply "This test passes - yippee!" to confirm that the test wasn't accidenta=
|
||||
lly passed without being run.
|
||||
|
||||
Thanks for helping with QA testing. It has been observed that you assigned t=
|
||||
his issue to yourself for testing, but no action has been taken on this. It=
|
||||
will be helpful if you can either test this or un-assign yourself, so someo=
|
||||
ne else can take it.
|
||||
|
||||
Sent from my iPad
|
||||
|
||||
> On 4 May 2015, at 11:02 am, Admin User <andrew@nicols.co.uk> wrote:
|
||||
>=20
|
||||
> MDL-48002 =C2=BB Forums =C2=BB MDL-48002 =C2=BB Testing of MDL-48002
|
||||
> =09
|
||||
> Testing of MDL-48002
|
||||
> by Admin User - Monday, 4 May 2015, 10:48 AM
|
||||
> =09
|
||||
> We are trying to test that this issue will work as expected.
|
||||
>=20
|
||||
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis convallis ph=
|
||||
aretra justo dignissim cursus. Sed sagittis, velit vel scelerisque sollicitu=
|
||||
din, neque purus pulvinar nisi, quis semper urna dolor nec est. Maecenas ut d=
|
||||
ui accumsan, tincidunt sem ac, efficitur lorem. Vivamus consequat viverra er=
|
||||
os eget cursus. Morbi porttitor nunc vehicula consequat laoreet. Pellentesqu=
|
||||
e ac diam vel libero finibus sodales a fringilla erat. Ut elementum ante ege=
|
||||
t convallis dignissim. Proin iaculis mauris nec diam maximus, ac scelerisque=
|
||||
metus tincidunt. Nullam tincidunt turpis ut aliquam volutpat. Vestibulum an=
|
||||
te ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; D=
|
||||
onec neque quam, sollicitudin bibendum ipsum id, malesuada convallis orci.
|
||||
>=20
|
||||
> Cras posuere, velit et consectetur euismod, orci ante malesuada libero, eu=
|
||||
tincidunt tortor elit vitae tellus. Nunc vel felis id metus fringilla lobor=
|
||||
tis. Sed sit amet ipsum vitae dolor aliquet dapibus eu vel nulla. Sed id dui=
|
||||
nec nisl hendrerit blandit ut et turpis. Donec dictum nunc mauris, quis pla=
|
||||
cerat tellus fermentum ac. Phasellus at fermentum quam. Phasellus magna magn=
|
||||
a, pharetra pharetra pellentesque a, convallis non leo. Nunc ac semper est. U=
|
||||
t interdum condimentum nunc sit amet sollicitudin. Aenean vitae sodales dolo=
|
||||
r, vitae porta felis. Aliquam tincidunt posuere lorem sed mollis. Vestibulum=
|
||||
sed quam convallis, commodo ante et, rhoncus metus. Sed arcu diam, venenati=
|
||||
s vel urna eu, porta viverra massa. Suspendisse nec consectetur risus, quis h=
|
||||
endrerit arcu. Ut purus metus, varius sit amet mauris non, posuere ultricies=
|
||||
velit. Nullam nec luctus lorem.
|
||||
>=20
|
||||
> Proin quis turpis efficitur, auctor dui nec, vulputate ligula. Sed egestas=
|
||||
facilisis magna nec posuere. Nam nisl nibh, dictum in velit eget, dapibus e=
|
||||
uismod lacus. Phasellus mollis eros nibh, eu venenatis libero luctus eu. Eti=
|
||||
am ultricies turpis interdum, rutrum leo sed, sollicitudin lectus. Suspendis=
|
||||
se potenti. Vestibulum in purus orci. Pellentesque fringilla nunc ac diam tr=
|
||||
istique pellentesque. Duis tincidunt mi ipsum, ac consequat augue iaculis a.=
|
||||
Ut ut erat at lacus lobortis facilisis at at ipsum. Aliquam ut nisi posuere=
|
||||
, dictum arcu id, placerat nisl. Vivamus in ex et lorem tempor iaculis eleme=
|
||||
ntum quis nunc.
|
||||
>=20
|
||||
> Some more text here.
|
||||
>=20
|
||||
> Now in the reply we will not remove the content and sent a bit of a reply.=
|
||||
|
||||
>=20
|
||||
> Reply
|
||||
> See this post in context
|
||||
> Unsubscribe from this discussion Unsubscribe from all forums Change your f=
|
||||
orum digest preferences
|
||||
> You can reply to this via email.
|
||||
|
||||
--Apple-Mail-97963C5D-72E2-413A-89FF-624233E4337F
|
||||
Content-Type: text/html;
|
||||
charset=utf-8
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
|
||||
utf-8"></head><body dir=3D"auto"><div><table border=3D"0" cellpadding=3D"3" c=
|
||||
ellspacing=3D"0" class=3D"forumpost" style=3D"-webkit-text-size-adjust: auto=
|
||||
;"><tbody><tr><td class=3D"left side" valign=3D"top"><span style=3D"-webkit-=
|
||||
text-size-adjust: none; background-color: rgba(255, 255, 255, 0);"> </s=
|
||||
pan></td><td class=3D"content"><p></p><p dir=3D"ltr" style=3D"margin-top: 0p=
|
||||
t; margin-bottom: 0pt;"><span style=3D"vertical-align: baseline; -webkit-tex=
|
||||
t-size-adjust: none; background-color: rgba(255, 255, 255, 0);">Sample reply=
|
||||
messages:</span></p><span style=3D"-webkit-text-size-adjust: none; backgrou=
|
||||
nd-color: rgba(255, 255, 255, 0);"><br></span><p dir=3D"ltr" style=3D"margin=
|
||||
-top: 0pt; margin-bottom: 0pt;"><span style=3D"font-style: italic; vertical-=
|
||||
align: baseline; -webkit-text-size-adjust: none; background-color: rgba(255,=
|
||||
255, 255, 0);">Thanks for offering to help with QA testing. I've added you t=
|
||||
o the testers group in the tracker, so you can now pass or fail QA tests. Ho=
|
||||
pefully the process is fully explained in <a href=3D"http://docs.moodle.org/=
|
||||
dev/QA_testing" x-apple-data-detectors=3D"true" x-apple-data-detectors-type=3D=
|
||||
"link" x-apple-data-detectors-result=3D"1">http://docs.moodle.org/dev/QA_tes=
|
||||
ting</a> but if there's anything you're not sure about, please post in the t=
|
||||
esting and QA forum.</span></p><span style=3D"-webkit-text-size-adjust: none=
|
||||
; background-color: rgba(255, 255, 255, 0);"><br><br></span><p dir=3D"ltr" s=
|
||||
tyle=3D"margin-top: 0pt; margin-bottom: 0pt;"><span style=3D"font-style: ita=
|
||||
lic; vertical-align: baseline; -webkit-text-size-adjust: none; background-co=
|
||||
lor: rgba(255, 255, 255, 0);">Thanks for offering to help with QA testing. P=
|
||||
lease create an account in the Moodle Tracker and let me know your Tracker u=
|
||||
sername then I can add you to the testers group.</span></p><span style=3D"-w=
|
||||
ebkit-text-size-adjust: none; background-color: rgba(255, 255, 255, 0);"><br=
|
||||
><br></span><p dir=3D"ltr" style=3D"margin-top: 0pt; margin-bottom: 0pt;"><s=
|
||||
pan style=3D"font-style: italic; vertical-align: baseline; -webkit-text-size=
|
||||
-adjust: none; background-color: rgba(255, 255, 255, 0);">Thanks for offerin=
|
||||
g to help with QA testing. We recently finished the Moodle 2.8 QA cycle, so o=
|
||||
ur next QA cycle won't be for a while, however you are welcome to try things=
|
||||
out on our Moodle QA Testing site <a href=3D"http://qa.moodle.net/" x-apple=
|
||||
-data-detectors=3D"true" x-apple-data-detectors-type=3D"link" x-apple-data-d=
|
||||
etectors-result=3D"3">http://qa.moodle.net/</a> and post in the Testing and Q=
|
||||
A forum <a href=3D"http://moodle.org/mod/forum/view.php?id=3D56" x-apple-dat=
|
||||
a-detectors=3D"true" x-apple-data-detectors-type=3D"link" x-apple-data-detec=
|
||||
tors-result=3D"4">http://moodle.org/mod/forum/view.php?id=3D56</a> about any=
|
||||
issues you come across, or any questions you have. If you come across any b=
|
||||
ugs (obvious problems), please report them in the Moodle tracker.</span></p>=
|
||||
<span style=3D"-webkit-text-size-adjust: none; background-color: rgba(255, 2=
|
||||
55, 255, 0);"><br><br></span><p dir=3D"ltr" style=3D"margin-top: 0pt; margin=
|
||||
-bottom: 0pt;"><span style=3D"font-style: italic; vertical-align: baseline; -=
|
||||
webkit-text-size-adjust: none; background-color: rgba(255, 255, 255, 0);">Th=
|
||||
anks for helping with QA testing. Your help would be appreciated even more i=
|
||||
f you could just add a comment when passing a test, such as feedback about t=
|
||||
he feature e.g. =E2=80=9CTeachers are going to love this=E2=80=9D or even si=
|
||||
mply "This test passes - yippee!" to confirm that the test wasn't accidental=
|
||||
ly passed without being run.</span></p><span style=3D"-webkit-text-size-adju=
|
||||
st: none; background-color: rgba(255, 255, 255, 0);"><br></span><p dir=3D"lt=
|
||||
r" style=3D"margin-top: 0pt; margin-bottom: 0pt;"><span style=3D"font-style:=
|
||||
italic; vertical-align: baseline; -webkit-text-size-adjust: none; backgroun=
|
||||
d-color: rgba(255, 255, 255, 0);">Thanks for helping with QA testing. It has=
|
||||
been observed that you assigned this issue to yourself for testing, but no a=
|
||||
ction has been taken on this. It will be helpful if you can either tes=
|
||||
t this or un-assign yourself, so someone else can take it.</span></p></td></=
|
||||
tr></tbody></table><br>Sent from my iPad</div><div><br>On 4 May 2015, at 11:=
|
||||
02 am, Admin User <<a href=3D"mailto:andrew@nicols.co.uk">andrew@nicols.c=
|
||||
o.uk</a>> wrote:<br><br></div><blockquote type=3D"cite"><div>
|
||||
|
||||
|
||||
<div class=3D"navbar"><a target=3D"_blank" href=3D"http://banana.per.in.mood=
|
||||
le.com/mdl48002/course/view.php?id=3D3">MDL-48002</a> =C2=BB <a target=3D"_b=
|
||||
lank" href=3D"http://banana.per.in.moodle.com/mdl48002/mod/forum/index.php?i=
|
||||
d=3D3">Forums</a> =C2=BB <a target=3D"_blank" href=3D"http://banana.per.in.m=
|
||||
oodle.com/mdl48002/mod/forum/view.php?f=3D5">MDL-48002</a> =C2=BB <a target=3D=
|
||||
"_blank" href=3D"http://banana.per.in.moodle.com/mdl48002/mod/forum/discuss.=
|
||||
php?d=3D8">Testing of MDL-48002</a></div><table border=3D"0" cellpadding=3D"=
|
||||
3" cellspacing=3D"0" class=3D"forumpost"><tbody><tr class=3D"header"><td wid=
|
||||
th=3D"35" valign=3D"top" class=3D"picture left"><a href=3D"http://banana.per=
|
||||
.in.moodle.com/mdl48002/user/view.php?id=3D2&course=3D3"><img src=3D"htt=
|
||||
p://banana.per.in.moodle.com/mdl48002/theme/image.php/_s/clean/core/14307067=
|
||||
79/u/f2" alt=3D"Picture of Admin User" title=3D"Picture of Admin User" class=
|
||||
=3D"userpicture defaultuserpic" width=3D"35" height=3D"35"></a></td><td clas=
|
||||
s=3D"topic starter"><div class=3D"subject">Testing of MDL-48002</div><div cl=
|
||||
ass=3D"author">by <a href=3D"http://banana.per.in.moodle.com/mdl48002/user/v=
|
||||
iew.php?id=3D2&course=3D3">Admin User</a> - Monday, 4 May 2015, 10:48 AM=
|
||||
</div></td></tr><tr><td class=3D"left side" valign=3D"top"> </td><td cl=
|
||||
ass=3D"content"><p>We are trying to test that this issue will work as expect=
|
||||
ed.</p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis conv=
|
||||
allis pharetra justo dignissim cursus. Sed sagittis, velit vel scelerisque s=
|
||||
ollicitudin, neque purus pulvinar nisi, quis semper urna dolor nec est. Maec=
|
||||
enas ut dui accumsan, tincidunt sem ac, efficitur lorem. Vivamus consequat v=
|
||||
iverra eros eget cursus. Morbi porttitor nunc vehicula consequat laoreet. Pe=
|
||||
llentesque ac diam vel libero finibus sodales a fringilla erat. Ut elementum=
|
||||
ante eget convallis dignissim. Proin iaculis mauris nec diam maximus, ac sc=
|
||||
elerisque metus tincidunt. Nullam tincidunt turpis ut aliquam volutpat. Vest=
|
||||
ibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia=
|
||||
Curae; Donec neque quam, sollicitudin bibendum ipsum id, malesuada convalli=
|
||||
s orci.</p><p>Cras posuere, velit et consectetur euismod, orci ante malesuad=
|
||||
a libero, eu tincidunt tortor elit vitae tellus. Nunc vel felis id metus fri=
|
||||
ngilla lobortis. Sed sit amet ipsum vitae dolor aliquet dapibus eu vel nulla=
|
||||
. Sed id dui nec nisl hendrerit blandit ut et turpis. Donec dictum nunc maur=
|
||||
is, quis placerat tellus fermentum ac. Phasellus at fermentum quam. Phasellu=
|
||||
s magna magna, pharetra pharetra pellentesque a, convallis non leo. Nunc ac s=
|
||||
emper est. Ut interdum condimentum nunc sit amet sollicitudin. Aenean vitae s=
|
||||
odales dolor, vitae porta felis. Aliquam tincidunt posuere lorem sed mollis.=
|
||||
Vestibulum sed quam convallis, commodo ante et, rhoncus metus. Sed arcu dia=
|
||||
m, venenatis vel urna eu, porta viverra massa. Suspendisse nec consectetur r=
|
||||
isus, quis hendrerit arcu. Ut purus metus, varius sit amet mauris non, posue=
|
||||
re ultricies velit. Nullam nec luctus lorem.</p><p>Proin quis turpis efficit=
|
||||
ur, auctor dui nec, vulputate ligula. Sed egestas facilisis magna nec posuer=
|
||||
e. Nam nisl nibh, dictum in velit eget, dapibus euismod lacus. Phasellus mol=
|
||||
lis eros nibh, eu venenatis libero luctus eu. Etiam ultricies turpis interdu=
|
||||
m, rutrum leo sed, sollicitudin lectus. Suspendisse potenti. Vestibulum in p=
|
||||
urus orci. Pellentesque fringilla nunc ac diam tristique pellentesque. Duis t=
|
||||
incidunt mi ipsum, ac consequat augue iaculis a. Ut ut erat at lacus loborti=
|
||||
s facilisis at at ipsum. Aliquam ut nisi posuere, dictum arcu id, placerat n=
|
||||
isl. Vivamus in ex et lorem tempor iaculis elementum quis nunc.</p><p>Some m=
|
||||
ore text here.</p><p>Now in the reply we will not remove the content and sen=
|
||||
t a bit of a reply.</p><div class=3D"commands"><a target=3D"_blank" href=3D"=
|
||||
http://banana.per.in.moodle.com/mdl48002/mod/forum/post.php?reply=3D24">Repl=
|
||||
y</a></div><div class=3D"link"><a target=3D"_blank" href=3D"http://banana.pe=
|
||||
r.in.moodle.com/mdl48002/mod/forum/discuss.php?d=3D8#p24">See this post in c=
|
||||
ontext</a></div></td></tr></tbody></table>
|
||||
|
||||
<hr><div class=3D"mdl-align unsubscribelink"><a href=3D"http://banana.per.in=
|
||||
.moodle.com/mdl48002/mod/forum/subscribe.php?id=3D5&d=3D8">Unsubscribe f=
|
||||
rom this discussion</a> <a href=3D"http://banana.per.in.moodle.com/mdl4=
|
||||
8002/mod/forum/unsubscribeall.php">Unsubscribe from all forums</a> <a h=
|
||||
ref=3D"http://banana.per.in.moodle.com/mdl48002/mod/forum/index.php?id=3D3">=
|
||||
Change your forum digest preferences</a></div><p>You can reply to this via e=
|
||||
mail.</p>
|
||||
|
||||
</div></blockquote></body></html>=
|
||||
|
||||
--Apple-Mail-97963C5D-72E2-413A-89FF-624233E4337F--
|
261
lib/tests/fixtures/messageinbound/outlook.test
vendored
Normal file
261
lib/tests/fixtures/messageinbound/outlook.test
vendored
Normal file
@ -0,0 +1,261 @@
|
||||
----CLIENT----
|
||||
OS: Win 7
|
||||
Mail Client: Outlook 2013
|
||||
Client Version: 15.0.4569.1503
|
||||
Date: 04/05/2015
|
||||
|
||||
----EXPECTEDPLAIN----
|
||||
Sending mail via clent and it seems to go all good...
|
||||
|
||||
Havent tried this before and its so slow....
|
||||
|
||||
Cheers
|
||||
Rajesh
|
||||
|
||||
----EXPECTEDHTML----
|
||||
Sending mail via clent and it seems to go all good...
|
||||
|
||||
Havent tried this before and its so slow....
|
||||
|
||||
Cheers
|
||||
|
||||
----FULLSOURCE----
|
||||
Delivered-To: moodlehqtest+aaaaaaaaaaiaaaaaaaaabqaaaaaaaaazd63zvl6kcy04ioh+@example.com
|
||||
Received: by 10.50.159.130 with SMTP id xc2csp1452325igb;
|
||||
Sun, 3 May 2015 20:06:33 -0700 (PDT)
|
||||
X-Received: by 10.182.42.131 with SMTP id o3mr16558872obl.59.1430708792759;
|
||||
Sun, 03 May 2015 20:06:32 -0700 (PDT)
|
||||
Return-Path: <rajesh.taneja@example.com>
|
||||
Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com. [2607:f8b0:4003:c06::232])
|
||||
by mx.google.com with ESMTPS id bb9si7457620obb.49.2015.05.03.20.06.32
|
||||
for <moodlehqtest+AAAAAAAAAAIAAAAAAAAABQAAAAAAAAAZD63zvl6KcY04ioh+@example.com>
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
|
||||
Sun, 03 May 2015 20:06:32 -0700 (PDT)
|
||||
Received-SPF: pass (google.com: domain of rajesh.taneja@example.com designates 2607:f8b0:4003:c06::232 as permitted sender) client-ip=2607:f8b0:4003:c06::232;
|
||||
Authentication-Results: mx.google.com;
|
||||
spf=pass (google.com: domain of rajesh.taneja@example.com designates 2607:f8b0:4003:c06::232 as permitted sender) smtp.mail=rajesh.taneja@example.com;
|
||||
dkim=pass header.i=@example.com;
|
||||
dmarc=pass (p=NONE dis=NONE) header.from=example.com
|
||||
Received: by mail-oi0-x232.google.com with SMTP id o83so103034701oik.1
|
||||
for <moodlehqtest+AAAAAAAAAAIAAAAAAAAABQAAAAAAAAAZD63zvl6KcY04ioh+@example.com>; Sun, 03 May 2015 20:06:32 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=example.com; s=20120113;
|
||||
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
|
||||
:content-type;
|
||||
bh=PP8NIhvbaEoIB2TwtsICSY6RhRgAhmJDKfcS/XCrsjk=;
|
||||
b=bEJMEs0yNfdFSzchg5vhQXD6W9MuubLtBBZzLRE6UHCW93ZxgTwFJXjyEq5ZAGiWT6
|
||||
2g5feEHEe6CYYOojIVGy10yh0l1XfK6kn4VgnzFTHO65RtqKggrYjijpsqqFY6moE5QC
|
||||
F1gakGp7mpaT72QVx/Pu+L9rwO1MA4vfG2RstjWZMPD/dzS2HlrYwjsI8ScpO4u/oros
|
||||
xl9/xWQ6brRi0co1ISSHgsaYWYAcgt6uSpGzzyL8OAA5vVWnxBSKVg+zYxY3rIo7Xbd+
|
||||
vfg/Ne1CkkQ4mM4ig4P7vDQBtgN5mm6I4GF5y3uSd2asr4Wjsw183vqSc8OhfvNL2owy
|
||||
m59w==
|
||||
MIME-Version: 1.0
|
||||
X-Received: by 10.202.230.11 with SMTP id d11mr15578479oih.6.1430708792570;
|
||||
Sun, 03 May 2015 20:06:32 -0700 (PDT)
|
||||
Received: by 10.202.0.68 with HTTP; Sun, 3 May 2015 20:06:32 -0700 (PDT)
|
||||
Received: by 10.202.0.68 with HTTP; Sun, 3 May 2015 20:06:32 -0700 (PDT)
|
||||
In-Reply-To: <669f8f3b6ac48139941bed5fcd069b97801de3b6920fe49cf6be18a5e23db0e8@banana.per.in.moodle.com>
|
||||
References: <a2cf1c399f255d43697f2ca2094f09ec00779b255ae27bb457557dcc0de72d04@banana.per.in.moodle.com>
|
||||
<669f8f3b6ac48139941bed5fcd069b97801de3b6920fe49cf6be18a5e23db0e8@banana.per.in.moodle.com>
|
||||
Date: Mon, 4 May 2015 11:06:32 +0800
|
||||
Message-ID: <CAEavSoBRiVHuk3hX9G8hbgPhJPb4KTfcjS-Kq2Qh_gdkP6hgEA@mail.example.com>
|
||||
Subject: Re: MDL-48002: Re: Testing of MDL-48002
|
||||
From: Rajesh Taneja <rajesh.taneja@example.com>
|
||||
To: moodlehqtest+AAAAAAAAAAIAAAAAAAAABQAAAAAAAAAZD63zvl6KcY04ioh+@example.com
|
||||
Content-Type: multipart/alternative; boundary=001a1140761a5bdf4c051538d992
|
||||
|
||||
--001a1140761a5bdf4c051538d992
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
Sending mail via clent and it seems to go all good...
|
||||
|
||||
Havent tried this before and its so slow....
|
||||
|
||||
Cheers
|
||||
Rajesh
|
||||
On 4 May 2015 11:01 am, "Rajesh Taneja" <rajesh.taneja@example.com> wrote:
|
||||
|
||||
> MDL-48002 <http://banana.per.in.moodle.com/mdl48002/course/view.php?id=
|
||||
=3D3>
|
||||
> =C2=BB Forums
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/index.php?id=3D3> =C2=
|
||||
=BB
|
||||
> MDL-48002
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/view.php?f=3D5> =C2=
|
||||
=BB Testing
|
||||
> of MDL-48002
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/discuss.php?d=3D8>
|
||||
> [image: Picture of Rajesh Taneja]
|
||||
> <http://banana.per.in.moodle.com/mdl48002/user/view.php?id=3D5&course=3D3=
|
||||
>
|
||||
> Re: Testing of MDL-48002
|
||||
> by Rajesh Taneja
|
||||
> <http://banana.per.in.moodle.com/mdl48002/user/view.php?id=3D5&course=3D3=
|
||||
> -
|
||||
> Monday, 4 May 2015, 11:02 AM
|
||||
>
|
||||
>
|
||||
> Sample reply messages:
|
||||
>
|
||||
> Thanks for offering to help with QA testing. I've added you to the tester=
|
||||
s
|
||||
> group in the tracker, so you can now pass or fail QA tests. Hopefully the
|
||||
> process is fully explained in http://docs.moodle.org/dev/QA_testing but
|
||||
> if there's anything you're not sure about, please post in the testing and
|
||||
> QA forum.
|
||||
>
|
||||
>
|
||||
> Thanks for offering to help with QA testing. Please create an account in
|
||||
> the Moodle Tracker and let me know your Tracker username then I can add y=
|
||||
ou
|
||||
> to the testers group.
|
||||
>
|
||||
>
|
||||
> Thanks for offering to help with QA testing. We recently finished the
|
||||
> Moodle 2.8 QA cycle, so our next QA cycle won't be for a while, however y=
|
||||
ou
|
||||
> are welcome to try things out on our Moodle QA Testing site
|
||||
> http://qa.moodle.net/ and post in the Testing and QA forum
|
||||
> http://moodle.org/mod/forum/view.php?id=3D56 about any issues you come
|
||||
> across, or any questions you have. If you come across any bugs (obvious
|
||||
> problems), please report them in the Moodle tracker.
|
||||
>
|
||||
>
|
||||
> Thanks for helping with QA testing. Your help would be appreciated even
|
||||
> more if you could just add a comment when passing a test, such as feedbac=
|
||||
k
|
||||
> about the feature e.g. =E2=80=9CTeachers are going to love this=E2=80=9D =
|
||||
or even simply
|
||||
> "This test passes - yippee!" to confirm that the test wasn't accidentally
|
||||
> passed without being run.
|
||||
>
|
||||
> Thanks for helping with QA testing. It has been observed that you assigne=
|
||||
d
|
||||
> this issue to yourself for testing, but no action has been taken on this.
|
||||
> It will be helpful if you can either test this or un-assign yourself, so
|
||||
> someone else can take it.
|
||||
>
|
||||
>
|
||||
> Show parent
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/discuss.php?d=3D8&par=
|
||||
ent=3D24>
|
||||
> | Reply
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/post.php?reply=3D25>
|
||||
> See this post in context
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/discuss.php?d=3D8#p25=
|
||||
>
|
||||
> ------------------------------
|
||||
> Unsubscribe from this forum
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/subscribe.php?id=3D5>=
|
||||
Unsubscribe
|
||||
> from this discussion
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/subscribe.php?id=3D5&=
|
||||
d=3D8>
|
||||
> Unsubscribe from all forums
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/unsubscribeall.php> C=
|
||||
hange
|
||||
> your forum digest preferences
|
||||
> <http://banana.per.in.moodle.com/mdl48002/mod/forum/index.php?id=3D3>
|
||||
>
|
||||
> You can reply to this via email.
|
||||
>
|
||||
|
||||
--001a1140761a5bdf4c051538d992
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
<p dir=3D"ltr">Sending mail via clent and it seems to go all good...</p>
|
||||
<p dir=3D"ltr">Havent tried this before and its so slow....</p>
|
||||
<p dir=3D"ltr">Cheers<br>
|
||||
Rajesh</p>
|
||||
<div class=3D"gmail_quote">On 4 May 2015 11:01 am, "Rajesh Taneja"=
|
||||
; <<a href=3D"mailto:rajesh.taneja@example.com">rajesh.taneja@example.com</a=
|
||||
>> wrote:<br type=3D"attribution"><blockquote class=3D"gmail_quote" styl=
|
||||
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
|
||||
<div>
|
||||
|
||||
<div><a href=3D"http://banana.per.in.moodle.com/mdl48002/course/view.php?id=
|
||||
=3D3" target=3D"_blank">MDL-48002</a> =C2=BB <a href=3D"http://banana.per.i=
|
||||
n.moodle.com/mdl48002/mod/forum/index.php?id=3D3" target=3D"_blank">Forums<=
|
||||
/a> =C2=BB <a href=3D"http://banana.per.in.moodle.com/mdl48002/mod/forum/vi=
|
||||
ew.php?f=3D5" target=3D"_blank">MDL-48002</a> =C2=BB <a href=3D"http://bana=
|
||||
na.per.in.moodle.com/mdl48002/mod/forum/discuss.php?d=3D8" target=3D"_blank=
|
||||
">Testing of MDL-48002</a></div><table border=3D"0" cellpadding=3D"3" cells=
|
||||
pacing=3D"0"><tr><td width=3D"35" valign=3D"top"><a href=3D"http://banana.p=
|
||||
er.in.moodle.com/mdl48002/user/view.php?id=3D5&course=3D3" target=3D"_b=
|
||||
lank"><img src=3D"http://banana.per.in.moodle.com/mdl48002/theme/image.php/=
|
||||
_s/clean/core/1430706779/u/f2" alt=3D"Picture of Rajesh Taneja" title=3D"Pi=
|
||||
cture of Rajesh Taneja" width=3D"35" height=3D"35"></a></td><td><div>Re: Te=
|
||||
sting of MDL-48002</div><div>by <a href=3D"http://banana.per.in.moodle.com/=
|
||||
mdl48002/user/view.php?id=3D5&course=3D3" target=3D"_blank">Rajesh Tane=
|
||||
ja</a> - Monday, 4 May 2015, 11:02 AM</div></td></tr><tr><td valign=3D"top"=
|
||||
>=C2=A0</td><td><p><b style=3D"font-weight:normal"></b></p><p dir=3D"ltr" s=
|
||||
tyle=3D"line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style=3D"f=
|
||||
ont-size:16px;font-family:Arial;color:#000000;background-color:transparent;=
|
||||
font-weight:normal;font-style:normal;font-variant:normal;text-decoration:no=
|
||||
ne;vertical-align:baseline;white-space:pre-wrap">Sample reply messages:</sp=
|
||||
an></p><br><p dir=3D"ltr" style=3D"line-height:1.38;margin-top:0pt;margin-b=
|
||||
ottom:0pt"><span style=3D"font-size:16px;font-family:Arial;color:#000000;ba=
|
||||
ckground-color:transparent;font-weight:normal;font-style:italic;font-varian=
|
||||
t:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"=
|
||||
>Thanks for offering to help with QA testing. I've added you to the tes=
|
||||
ters group in the tracker, so you can now pass or fail QA tests. Hopefully =
|
||||
the process is fully explained in <a href=3D"http://docs.moodle.org/dev/QA_=
|
||||
testing" target=3D"_blank">http://docs.moodle.org/dev/QA_testing</a> but if=
|
||||
there's anything you're not sure about, please post in the testing=
|
||||
and QA forum.</span></p><br><br><p dir=3D"ltr" style=3D"line-height:1.44;m=
|
||||
argin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:16px;font-family:=
|
||||
Arial;color:#000000;background-color:transparent;font-weight:normal;font-st=
|
||||
yle:italic;font-variant:normal;text-decoration:none;vertical-align:baseline=
|
||||
;white-space:pre-wrap">Thanks for offering to help with QA testing. Please =
|
||||
create an account in the Moodle Tracker and let me know your Tracker userna=
|
||||
me then I can add you to the testers group.</span></p><br><br><p dir=3D"ltr=
|
||||
" style=3D"line-height:1.44;margin-top:0pt;margin-bottom:0pt"><span style=
|
||||
=3D"font-size:16px;font-family:Arial;color:#000000;background-color:transpa=
|
||||
rent;font-weight:normal;font-style:italic;font-variant:normal;text-decorati=
|
||||
on:none;vertical-align:baseline;white-space:pre-wrap">Thanks for offering t=
|
||||
o help with QA testing. We recently finished the Moodle 2.8 QA cycle, so ou=
|
||||
r next QA cycle won't be for a while, however you are welcome to try th=
|
||||
ings out on our Moodle QA Testing site <a href=3D"http://qa.moodle.net/" ta=
|
||||
rget=3D"_blank">http://qa.moodle.net/</a> and post in the Testing and QA fo=
|
||||
rum <a href=3D"http://moodle.org/mod/forum/view.php?id=3D56" target=3D"_bla=
|
||||
nk">http://moodle.org/mod/forum/view.php?id=3D56</a> about any issues you c=
|
||||
ome across, or any questions you have. If you come across any bugs (obvious=
|
||||
problems), please report them in the Moodle tracker.</span></p><br><br><p =
|
||||
dir=3D"ltr" style=3D"line-height:1.44;margin-top:0pt;margin-bottom:0pt"><sp=
|
||||
an style=3D"font-size:16px;font-family:Arial;color:#000000;background-color=
|
||||
:transparent;font-weight:normal;font-style:italic;font-variant:normal;text-=
|
||||
decoration:none;vertical-align:baseline;white-space:pre-wrap">Thanks for he=
|
||||
lping with QA testing. Your help would be appreciated even more if you coul=
|
||||
d just add a comment when passing a test, such as feedback about the featur=
|
||||
e e.g. =E2=80=9CTeachers are going to love this=E2=80=9D or even simply &qu=
|
||||
ot;This test passes - yippee!" to confirm that the test wasn't acc=
|
||||
identally passed without being run.</span></p><br><p dir=3D"ltr" style=3D"l=
|
||||
ine-height:1.44;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:=
|
||||
16px;font-family:Arial;color:#000000;background-color:transparent;font-weig=
|
||||
ht:normal;font-style:italic;font-variant:normal;text-decoration:none;vertic=
|
||||
al-align:baseline;white-space:pre-wrap">Thanks for helping with QA testing.=
|
||||
It has been observed that you assigned this issue to yourself for testing,=
|
||||
but no action has been taken on this.=C2=A0 It will be helpful if you can =
|
||||
either test this or un-assign yourself, so someone else can take it.</span>=
|
||||
</p><br><br><div><a href=3D"http://banana.per.in.moodle.com/mdl48002/mod/fo=
|
||||
rum/discuss.php?d=3D8&parent=3D24" target=3D"_blank">Show parent</a> | =
|
||||
<a href=3D"http://banana.per.in.moodle.com/mdl48002/mod/forum/post.php?repl=
|
||||
y=3D25" target=3D"_blank">Reply</a></div><div><a href=3D"http://banana.per.=
|
||||
in.moodle.com/mdl48002/mod/forum/discuss.php?d=3D8#p25" target=3D"_blank">S=
|
||||
ee this post in context</a></div></td></tr></table>
|
||||
|
||||
<hr><div><a href=3D"http://banana.per.in.moodle.com/mdl48002/mod/forum/subs=
|
||||
cribe.php?id=3D5" target=3D"_blank">Unsubscribe from this forum</a>=C2=A0<a=
|
||||
href=3D"http://banana.per.in.moodle.com/mdl48002/mod/forum/subscribe.php?i=
|
||||
d=3D5&d=3D8" target=3D"_blank">Unsubscribe from this discussion</a>=C2=
|
||||
=A0<a href=3D"http://banana.per.in.moodle.com/mdl48002/mod/forum/unsubscrib=
|
||||
eall.php" target=3D"_blank">Unsubscribe from all forums</a>=C2=A0<a href=3D=
|
||||
"http://banana.per.in.moodle.com/mdl48002/mod/forum/index.php?id=3D3" targe=
|
||||
t=3D"_blank">Change your forum digest preferences</a></div></div><p>You can=
|
||||
reply to this via email.</p>
|
||||
|
||||
</blockquote></div>
|
||||
|
||||
--001a1140761a5bdf4c051538d992--
|
167
lib/tests/messageinbound_test.php
Normal file
167
lib/tests/messageinbound_test.php
Normal file
@ -0,0 +1,167 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Test classes for \core\message\inbound.
|
||||
*
|
||||
* @package core_message
|
||||
* @category test
|
||||
* @copyright 2015 Andrew Nicols <andrew@nicols.co.uk>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
global $CFG;
|
||||
|
||||
/**
|
||||
* Test script for message class.
|
||||
*
|
||||
* @package core_message
|
||||
* @category test
|
||||
* @copyright 2015 Andrew Nicols <andrew@nicols.co.uk>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class core_messageinbound_testcase extends advanced_testcase {
|
||||
|
||||
/**
|
||||
* @dataProvider message_inbound_handler_trim_testprovider
|
||||
*/
|
||||
public function test_messageinbound_handler_trim($file, $source, $expectedplain, $expectedhtml) {
|
||||
$this->resetAfterTest();
|
||||
|
||||
$mime = Horde_Mime_Part::parseMessage($source);
|
||||
if ($plainpartid = $mime->findBody('plain')) {
|
||||
$messagedata = new stdClass();
|
||||
$messagedata->plain = $mime->getPart($plainpartid)->getContents();
|
||||
$messagedata->html = '';
|
||||
|
||||
list($message, $format) = test_handler::remove_quoted_text($messagedata);
|
||||
$this->assertEquals($expectedplain, $message);
|
||||
$this->assertEquals(FORMAT_PLAIN, $format);
|
||||
}
|
||||
|
||||
if ($htmlpartid = $mime->findBody('html')) {
|
||||
$messagedata = new stdClass();
|
||||
$messagedata->plain = '';
|
||||
$messagedata->html = $mime->getPart($htmlpartid)->getContents();
|
||||
|
||||
list($message, $format) = test_handler::remove_quoted_text($messagedata);
|
||||
$this->assertEquals($expectedhtml, $message);
|
||||
$this->assertEquals(FORMAT_PLAIN, $format);
|
||||
}
|
||||
}
|
||||
|
||||
public function message_inbound_handler_trim_testprovider() {
|
||||
$fixturesdir = realpath(__DIR__ . '/fixtures/messageinbound/');
|
||||
$tests = array();
|
||||
$iterator = new \RecursiveIteratorIterator(
|
||||
new \RecursiveDirectoryIterator($fixturesdir),
|
||||
\RecursiveIteratorIterator::LEAVES_ONLY);
|
||||
|
||||
foreach ($iterator as $file) {
|
||||
if (!preg_match('/\.test$/', $file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$testdata = $this->read_test_file($file, $fixturesdir);
|
||||
} catch (\Exception $e) {
|
||||
die($e->getMessage());
|
||||
}
|
||||
|
||||
$test = array(
|
||||
// The filename.
|
||||
basename($file),
|
||||
|
||||
$testdata['FULLSOURCE'],
|
||||
|
||||
// The plaintext component of the message.
|
||||
$testdata['EXPECTEDPLAIN'],
|
||||
|
||||
// The HTML component of the message.
|
||||
$testdata['EXPECTEDHTML'],
|
||||
);
|
||||
|
||||
$tests[basename($file)] = $test;
|
||||
}
|
||||
return $tests;
|
||||
}
|
||||
|
||||
protected function read_test_file(\SplFileInfo $file, $fixturesdir) {
|
||||
// Break on the --[TOKEN]-- tags in the file.
|
||||
$tokens = preg_split('#(?:^|\n*)----([A-Z]+)----\n#', file_get_contents($file->getRealPath()),
|
||||
null, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$sections = array(
|
||||
// Key => Required.
|
||||
'FULLSOURCE' => true,
|
||||
'EXPECTEDPLAIN' => true,
|
||||
'EXPECTEDHTML' => true,
|
||||
'CLIENT' => true, // Required but not needed for tests, just for documentation.
|
||||
);
|
||||
$section = null;
|
||||
$data = array();
|
||||
foreach ($tokens as $i => $token) {
|
||||
if (null === $section && empty($token)) {
|
||||
continue; // Skip leading blank.
|
||||
}
|
||||
if (null === $section) {
|
||||
if (!isset($sections[$token])) {
|
||||
throw new coding_exception(sprintf(
|
||||
'The test file "%s" should not contain a section named "%s".',
|
||||
basename($file),
|
||||
$token
|
||||
));
|
||||
}
|
||||
$section = $token;
|
||||
continue;
|
||||
}
|
||||
$sectiondata = $token;
|
||||
$data[$section] = $sectiondata;
|
||||
$section = $sectiondata = null;
|
||||
}
|
||||
foreach ($sections as $section => $required) {
|
||||
if ($required && !isset($data[$section])) {
|
||||
throw new coding_exception(sprintf(
|
||||
'The test file "%s" must have a section named "%s".',
|
||||
str_replace($fixturesdir.'/', '', $file),
|
||||
$section
|
||||
));
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class test_handler
|
||||
*/
|
||||
class test_handler extends \core\message\inbound\handler {
|
||||
|
||||
public static function remove_quoted_text($messagedata) {
|
||||
return parent::remove_quoted_text($messagedata);
|
||||
}
|
||||
|
||||
public static function get_linecount_to_remove($messagedata) {
|
||||
return parent::get_linecount_to_remove($messagedata);
|
||||
}
|
||||
|
||||
public function get_name() {}
|
||||
|
||||
public function get_description() {}
|
||||
|
||||
public function process_message(stdClass $record, stdClass $messagedata) {}
|
||||
}
|
@ -162,13 +162,9 @@ class reply_handler extends \core\message\inbound\handler {
|
||||
$addpost->parent = $post->id;
|
||||
$addpost->itemid = file_get_unused_draft_itemid();
|
||||
|
||||
if (!empty($messagedata->html)) {
|
||||
$addpost->message = $messagedata->html;
|
||||
$addpost->messageformat = FORMAT_HTML;
|
||||
} else {
|
||||
$addpost->message = $messagedata->plain;
|
||||
$addpost->messageformat = FORMAT_PLAIN;
|
||||
}
|
||||
list ($message, $format) = self::remove_quoted_text($messagedata);
|
||||
$addpost->message = $message;
|
||||
$addpost->messageformat = $format;
|
||||
|
||||
// We don't trust text coming from e-mail.
|
||||
$addpost->messagetrust = false;
|
||||
@ -288,7 +284,6 @@ class reply_handler extends \core\message\inbound\handler {
|
||||
return $fs->create_file_from_string($record, $attachment->content);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the content of any success notification to be sent.
|
||||
* Both an HTML and Plain Text variant must be provided.
|
||||
@ -308,5 +303,4 @@ class reply_handler extends \core\message\inbound\handler {
|
||||
$message->html = get_string('postbymailsuccess_html', 'mod_forum', $a);
|
||||
return $message;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ $string['repliesmany'] = '{$a} replies so far';
|
||||
$string['repliesone'] = '{$a} reply so far';
|
||||
$string['reply'] = 'Reply';
|
||||
$string['replyforum'] = 'Reply to forum';
|
||||
$string['replytopostbyemail'] = 'If you reply to this via email, don\'t include a quoted copy of this post. ';
|
||||
$string['replytopostbyemail'] = 'You can reply to this via email.';
|
||||
$string['replytouser'] = 'Use email address in reply';
|
||||
$string['reply_handler'] = 'Reply to forum posts via email';
|
||||
$string['reply_handler_name'] = 'Reply to forum posts';
|
||||
|
Loading…
x
Reference in New Issue
Block a user