X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fmail%2Foutlook.t;h=8f3b71bc8bd0bcd4f310beece1e946a119d09425;hb=8c72aca69588468b2e5b35397e4d6fb3d543155e;hp=15bfa21bc30df5d9074e1c4a629190d5bbf61106;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/rt/t/mail/outlook.t b/rt/t/mail/outlook.t index 15bfa21bc..8f3b71bc8 100644 --- a/rt/t/mail/outlook.t +++ b/rt/t/mail/outlook.t @@ -1,66 +1,13 @@ -#!/usr/bin/perl -w -# BEGIN BPS TAGGED BLOCK {{{ -# -# COPYRIGHT: -# -# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC -# -# -# (Except where explicitly superseded by other copyright notices) -# -# -# LICENSE: -# -# This work is made available to you under the terms of Version 2 of -# the GNU General Public License. A copy of that license should have -# been provided with this software, but in any event can be snarfed -# from www.gnu.org. -# -# This work 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 this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 or visit their web page on the internet at -# http://www.gnu.org/copyleft/gpl.html. -# -# -# CONTRIBUTION SUBMISSION POLICY: -# -# (The following paragraph is not intended to limit the rights granted -# to you to modify and distribute this software under the terms of -# the GNU General Public License and is only of importance to you if -# you choose to contribute your changes and enhancements to the -# community by submitting them to Best Practical Solutions, LLC.) -# -# By intentionally submitting any modifications, corrections or -# derivatives to this work, or any other work intended for use with -# Request Tracker, to Best Practical Solutions, LLC, you confirm that -# you are the copyright holder for those contributions and you grant -# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -# royalty-free, perpetual, license to use, copy, create derivative -# works based on those contributions, and sublicense and distribute -# those contributions and any derivatives thereof. -# -# END BPS TAGGED BLOCK }}} - -=head1 NAME - -rt-mailgate - Mail interface to RT3. - -=cut - use strict; use warnings; -use RT::Test tests => 43; -my ($baseurl, $m) = RT::Test->started_ok; +use RT::Test tests => 66; + +RT->Config->Set('CheckMoreMSMailHeaders', 1); + # 12.0 is outlook 2007, 14.0 is 2010 for my $mailer ( 'Microsoft Office Outlook 12.0', 'Microsoft Outlook 14.0' ) { - diag "Test mail with multipart/alternative" if $ENV{'TEST_VERBOSE'}; + diag "Test mail with multipart/alternative"; { my $text = <Config->Get('rtname')]} Subject: outlook basic test Content-Type: multipart/alternative; - boundary="----=_NextPart_000_0004_01CB045C.A5A075D0" +\tboundary="----=_NextPart_000_0004_01CB045C.A5A075D0" ------=_NextPart_000_0004_01CB045C.A5A075D0 Content-Type: text/plain; - charset="us-ascii" +\tcharset="us-ascii" Content-Transfer-Encoding: 7bit here is the content @@ -86,7 +33,7 @@ another line ------=_NextPart_000_0004_01CB045C.A5A075D0 Content-Type: text/html; - charset="us-ascii" +\tcharset="us-ascii" Content-Transfer-Encoding: quoted-printable this is fake @@ -106,8 +53,7 @@ EOF $mailer . ' with multipart/alternative, \n\n are replaced' ); } - diag "Test mail with multipart/mixed, with multipart/alternative in it" - if $ENV{'TEST_VERBOSE'}; + diag "Test mail with multipart/mixed, with multipart/alternative in it"; { my $text = <Config->Get('rtname')]} Subject: outlook basic test Content-Type: multipart/mixed; - boundary="----=_NextPart_000_000F_01CB045E.5222CB40" +\tboundary="----=_NextPart_000_000F_01CB045E.5222CB40" ------=_NextPart_000_000F_01CB045E.5222CB40 Content-Type: multipart/alternative; - boundary="----=_NextPart_001_0010_01CB045E.5222CB40" +\tboundary="----=_NextPart_001_0010_01CB045E.5222CB40" ------=_NextPart_001_0010_01CB045E.5222CB40 Content-Type: text/plain; - charset="us-ascii" +\tcharset="us-ascii" Content-Transfer-Encoding: 7bit foo @@ -138,7 +84,7 @@ baz ------=_NextPart_001_0010_01CB045E.5222CB40 Content-Type: text/html; - charset="us-ascii" +\tcharset="us-ascii" Content-Transfer-Encoding: quoted-printable this is fake @@ -147,10 +93,10 @@ Content-Transfer-Encoding: quoted-printable ------=_NextPart_000_000F_01CB045E.5222CB40 Content-Type: text/plain; - name="att.txt" +\tname="att.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; - filename="att.txt" +\tfilename="att.txt" this is the attachment! :)=0A= @@ -167,8 +113,7 @@ EOF $mailer . ' with multipart/multipart, \n\n are replaced' ); } - diag "Test mail with with outlook, but the content type is text/plain" - if $ENV{'TEST_VERBOSE'}; + diag "Test mail with with outlook, but the content type is text/plain"; { my $text = <Config->Get('rtname')]} +Subject: outlook basic test +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: base64 + +VGhpcyBpcyB0aGUgYm9keSBvZiBhbiBlbWFpbC4KCkl0IGhhcyBtdWx0aXBs +ZSBleHRyYSBuZXdsaW5lcy4KCgoKTGlrZSBhIG1hbmdsZWQgT3V0bG9vayBt +ZXNzYWdlIG1pZ2h0LgoKCgpKb2huIFNtaXRoCgpTb21lIENvbXBhbnkKCmVt +YWlsQHNvbWVjby5jb20KCg== +EOF + + my $content = <Config->Get('rtname')]} +Subject: outlook basic test +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: base64 +X-MS-Has-Attach: +X-MS-Tnef-Correlator: + +VGhpcyBpcyB0aGUgYm9keSBvZiBhbiBlbWFpbC4KCkl0IGhhcyBtdWx0aXBs +ZSBleHRyYSBuZXdsaW5lcy4KCgoKTGlrZSBhIG1hbmdsZWQgT3V0bG9vayBt +ZXNzYWdlIG1pZ2h0LgoKCgpKb2huIFNtaXRoCgpTb21lIENvbXBhbnkKCmVt +YWlsQHNvbWVjby5jb20KCg== +EOF + + my $content = <Config->Get('rtname')]} Subject: outlook basic test Content-Type: multipart/alternative; - boundary="----=_NextPart_000_0004_01CB045C.A5A075D0" +\tboundary="----=_NextPart_000_0004_01CB045C.A5A075D0" ------=_NextPart_000_0004_01CB045C.A5A075D0 Content-Type: text/plain; - charset="us-ascii" +\tcharset="us-ascii" Content-Transfer-Encoding: 7bit foo @@ -230,14 +241,13 @@ baz ------=_NextPart_000_0004_01CB045C.A5A075D0 Content-Type: text/html; - charset="us-ascii" +\tcharset="us-ascii" Content-Transfer-Encoding: quoted-printable this is fake ------=_NextPart_000_0004_01CB045C.A5A075D0-- - EOF my $content = <; Tue, 17 Jul 2012 10:11:51 +0100 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----_=_NextPart_001_01CD63FC.33F4C15C" +Content-class: urn:content-classes:message +Subject: outlook basic test +Date: Tue, 17 Jul 2012 10:11:50 +0100 +Message-ID: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: Testing Outlook HTML +Thread-Index: Ac1j/DNs7ly963bnRt63SJw9DkGwyw== +From: root\@localhost +To: rt\@@{[RT->Config->Get('rtname')]} + +This is a multi-part message in MIME format. + +------_=_NextPart_001_01CD63FC.33F4C15C +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +This email contains a line of text containing multiple sentences. Where +will RT wrap this when the text is quoted? What about the footer below? + +=20 + +This is a different line, with a blank line (paragraph) above. Will +there be additional blank lines when the text is quoted? + +=20 + +This isthesig + +=20 + + +------_=_NextPart_001_01CD63FC.33F4C15C +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +

This email = +contains a line of text containing multiple sentences.  Where will = +RT wrap this when the text is quoted?  What about the footer = +below?

 

This is a different line, with a blank line = +(paragraph) above.  Will there be additional blank lines when the = +text is quoted?

 

This isthesig = +

 

+------_=_NextPart_001_01CD63FC.33F4C15C-- +EOF + + my $content = <send_via_mailgate($text);