summaryrefslogtreecommitdiff
path: root/rt/lib/t/regression/06mailgateway.t
diff options
context:
space:
mode:
authorivan <ivan>2006-10-17 08:51:01 +0000
committerivan <ivan>2006-10-17 08:51:01 +0000
commita513c0bef534d05f03c1242831b6f3be19b97dae (patch)
tree2f2a88caf104fef31a3a8dc190ac3fe41dd017c1 /rt/lib/t/regression/06mailgateway.t
parentd4d0590bef31071e8809ec046717444b95b3f30a (diff)
import rt 3.4.5
Diffstat (limited to 'rt/lib/t/regression/06mailgateway.t')
-rw-r--r--rt/lib/t/regression/06mailgateway.t60
1 files changed, 30 insertions, 30 deletions
diff --git a/rt/lib/t/regression/06mailgateway.t b/rt/lib/t/regression/06mailgateway.t
index 8486aea9e..1bdc38a69 100644
--- a/rt/lib/t/regression/06mailgateway.t
+++ b/rt/lib/t/regression/06mailgateway.t
@@ -62,7 +62,7 @@ use RT::I18N;
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url http://this.test.for.non-connection.is.expected.to.generate.an.error"), "Opened the mailgate - The error below is expected - $@");
print MAIL <<EOF;
From: root\@localhost
-To: rt\@example.com
+To: rt\@$RT::rtname
Subject: This is a test of new ticket creation
Foob!
@@ -78,7 +78,7 @@ is ( $? >> 8, 75, "The error message above is expected The mail gateway exited w
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action correspond"), "Opened the mailgate - $@");
print MAIL <<EOF;
From: root\@localhost
-To: rt\@example.com
+To: rt\@$RT::rtname
Subject: This is a test of new ticket creation
Blah!
@@ -105,8 +105,8 @@ ok ($tick->Subject eq 'This is a test of new ticket creation', "Created the tick
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action correspond"), "Opened the mailgate - $@");
print MAIL <<EOF;
-From: doesnotexist\@example.com
-To: rt\@example.com
+From: doesnotexist\@$RT::rtname
+To: rt\@$RT::rtname
Subject: This is a test of new ticket creation as an unknown user
Blah!
@@ -123,7 +123,7 @@ $tick = $tickets->First();
ok ($tick->Id, "found ticket ".$tick->Id);
ok ($tick->Subject ne 'This is a test of new ticket creation as an unknown user', "failed to create the new ticket from an unprivileged account");
my $u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist@example.com');
+$u->Load("doesnotexist\@$RT::rtname");
ok( $u->Id == 0, " user does not exist and was not created by failed ticket submission");
@@ -141,8 +141,8 @@ ok ($val, "Granted everybody the right to create tickets - $msg");
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action correspond"), "Opened the mailgate - $@");
print MAIL <<EOF;
-From: doesnotexist\@example.com
-To: rt\@example.com
+From: doesnotexist\@$RT::rtname
+To: rt\@$RT::rtname
Subject: This is a test of new ticket creation as an unknown user
Blah!
@@ -160,7 +160,7 @@ $tick = $tickets->First();
ok ($tick->Id, "found ticket ".$tick->Id);
ok ($tick->Subject eq 'This is a test of new ticket creation as an unknown user', "failed to create the new ticket from an unprivileged account");
$u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist@example.com');
+$u->Load("doesnotexist\@$RT::rtname");
ok( $u->Id != 0, " user does not exist and was created by ticket submission");
# }}}
@@ -174,9 +174,9 @@ ok( $u->Id != 0, " user does not exist and was created by ticket submission");
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action correspond"), "Opened the mailgate - $@");
print MAIL <<EOF;
-From: doesnotexist-2\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a reply as an unknown user
+From: doesnotexist-2\@$RT::rtname
+To: rt\@$RT::rtname
+Subject: [$RT::rtname #@{[$tick->Id]}] This is a test of a reply as an unknown user
Blah! (Should not work.)
Foob!
@@ -186,7 +186,7 @@ close (MAIL);
is ($? >> 8, 0, "The mail gateway exited normally. yay");
$u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-2@example.com');
+$u->Load('doesnotexist-2@$RT::rtname');
ok( $u->Id == 0, " user does not exist and was not created by ticket correspondence submission");
# }}}
@@ -199,9 +199,9 @@ ok ($val, "Granted everybody the right to reply to tickets - $msg");
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action correspond"), "Opened the mailgate - $@");
print MAIL <<EOF;
-From: doesnotexist-2\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a reply as an unknown user
+From: doesnotexist-2\@$RT::rtname
+To: rt\@$RT::rtname
+Subject: [$RT::rtname #@{[$tick->Id]}] This is a test of a reply as an unknown user
Blah!
Foob!
@@ -212,7 +212,7 @@ is ($? >> 8, 0, "The mail gateway exited normally. yay");
$u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-2@example.com');
+$u->Load("doesnotexist-2\@$RT::rtname");
ok( $u->Id != 0, " user exists and was created by ticket correspondence submission");
# }}}
@@ -225,9 +225,9 @@ ok( $u->Id != 0, " user exists and was created by ticket correspondence submissi
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action comment"), "Opened the mailgate - $@");
print MAIL <<EOF;
-From: doesnotexist-3\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a comment as an unknown user
+From: doesnotexist-3\@$RT::rtname
+To: rt\@$RT::rtname
+Subject: [$RT::rtname #@{[$tick->Id]}] This is a test of a comment as an unknown user
Blah! (Should not work.)
Foob!
@@ -238,7 +238,7 @@ close (MAIL);
is ($? >> 8, 0, "The mail gateway exited normally. yay");
$u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-3@example.com');
+$u->Load("doesnotexist-3\@$RT::rtname");
ok( $u->Id == 0, " user does not exist and was not created by ticket comment submission");
# }}}
@@ -250,9 +250,9 @@ ok ($val, "Granted everybody the right to reply to tickets - $msg");
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action comment"), "Opened the mailgate - $@");
print MAIL <<EOF;
-From: doesnotexist-3\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a comment as an unknown user
+From: doesnotexist-3\@$RT::rtname
+To: rt\@$RT::rtname
+Subject: [$RT::rtname #@{[$tick->Id]}] This is a test of a comment as an unknown user
Blah!
Foob!
@@ -263,7 +263,7 @@ close (MAIL);
is ($? >> 8, 0, "The mail gateway exited normally. yay");
$u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-3@example.com');
+$u->Load("doesnotexist-3\@$RT::rtname");
ok( $u->Id != 0, " user exists and was created by ticket comment submission");
# }}}
@@ -351,7 +351,7 @@ ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --act
print MAIL <<EOF;
From: root\@localhost
-To: rtemail\@example.com
+To: rtemail\@$RT::rtname
Subject: This is a test of I18N ticket creation
Content-Type: text/plain; charset="utf-8"
@@ -385,7 +385,7 @@ ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --act
print MAIL <<EOF;
From: root\@localhost
-To: rtemail\@example.com
+To: rtemail\@$RT::rtname
Subject: This is a test of I18N ticket creation
Content-Type: text/plain; charset="utf-8"
@@ -436,7 +436,7 @@ is( $tick->Owner, $RT::Nobody->Id, 'owner of the new ticket is nobody' );
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action take"), "Opened the mailgate - $@");
print MAIL <<EOF;
From: root\@localhost
-Subject: [example.com \#$id] test
+Subject: [$RT::rtname \#$id] test
EOF
close (MAIL);
@@ -461,7 +461,7 @@ is( $tick->Owner, $RT::Nobody->Id, 'set owner back to nobody');
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action take-correspond"), "Opened the mailgate - $@");
print MAIL <<EOF;
From: root\@localhost
-Subject: [example.com \#$id] correspondence
+Subject: [$RT::rtname \#$id] correspondence
test
EOF
@@ -474,14 +474,14 @@ is( $tick->Id, $id, 'load correct ticket');
is( $tick->OwnerObj->EmailAddress, 'root@localhost', 'successfuly take ticket via email');
my $txns = $tick->Transactions;
$txns->Limit( FIELD => 'Type', VALUE => 'Correspond');
-is( $txns->Last->Subject, "[example.com \#$id] correspondence", 'successfuly add correspond within take via email' );
+is( $txns->Last->Subject, "[$RT::rtname \#$id] correspondence", 'successfuly add correspond within take via email' );
# +1 because of auto open
is( $tick->Transactions->Count, 6, 'no superfluous transactions');
ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $RT::WebURL --queue general --action resolve"), "Opened the mailgate - $@");
print MAIL <<EOF;
From: root\@localhost
-Subject: [example.com \#$id] test
+Subject: [$RT::rtname \#$id] test
EOF
close (MAIL);