-ok(eq_array(RT::EmailParser::CullRTAddresses("",@before),@after), "CullRTAddresses only culls RT addresses");
+ok(eq_array(RT::EmailParser->CullRTAddresses(@before),@after), "CullRTAddresses only culls RT addresses");
+
+{
+ require RT::Interface::Email;
+ my ( $addr, $name ) =
+ RT::Interface::Email::ParseAddressFromHeader('foo@example.com');
+ is( $addr, 'foo@example.com', 'addr for foo@example.com' );
+ is( $name, undef, 'no name for foo@example.com' );
+
+ ( $addr, $name ) =
+ RT::Interface::Email::ParseAddressFromHeader('Foo <foo@example.com>');
+ is( $addr, 'foo@example.com', 'addr for Foo <foo@example.com>' );
+ is( $name, 'Foo', 'name for Foo <foo@example.com>' );
+
+ ( $addr, $name ) =
+ RT::Interface::Email::ParseAddressFromHeader('foo@example.com (Comment)');
+ is( $addr, 'foo@example.com', 'addr for foo@example.com (Comment)' );
+ is( $name, undef, 'no name for foo@example.com (Comment)' );
+}