# Copyright (c) 2008 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: Incoming2.bunit,v 1.5 2010/06/14 19:17:23 nagler Exp $ Request('initialize_fully'); options({ create_object => sub { my(undef, $args) = @_; my($h) = $args->[0]; return class()->new(join( "\n", map("$_: $h->{$_}", sort(keys(%$h))), "\nbody\n", )); }, }); my($forum) = remote_email('mail_forum'); my($user1) = email('mail_user1'); my($user2) = email('mail_user2'); my($alias) = remote_email('forum_alias'); [ map(( [shift(@$_)] => [ { method => 'get_reply_email_arrays', compute_return => sub { my(undef, $actual) = @_; return [map( $_ && $_->as_length ? $_->as_array : (), @$actual, )]; }, compute_params => sub { my(undef, $params) = @_; req()->set_realm('mail_forum'); my($realm_emails) = [ $params->[1] ? $params->[1] : (), req(qw(auth_realm owner))->format_email, ]; return [ MailReplyWho($params->[0]), $realm_emails->[0], $realm_emails, req(), ]; }, } => [@$_], ], ), [ {From => 'a@a.a', To => $forum, Cc => $user2}, author => [['a@a.a']], [realm => $alias] => [[$alias]], all => [['a@a.a'], [$forum]], ], [ {From => 'a@a.a', To => $user2, Cc => ''}, author => [['a@a.a']], [realm => $alias] => [[$alias]], all => [['a@a.a'], [$forum]], ], [ {From => 'a@a.a', To => $user2, Cc => $forum}, author => [['a@a.a']], [realm => $alias] => [[$alias]], all => [['a@a.a'], [$forum]], ], [ {From => 'a@a.a', 'Reply-To' => 'b@b.b'}, author => [['b@b.b']], realm => [[$forum]], all => [['b@b.b'], [$forum]], ], [ {From => 'a@a.a', 'Reply-To' => $user1}, author => [[$user1]], realm => [[$forum]], all => [[$forum]], ], [ {From => 'a@a.a', 'Reply-To' => $forum, To => $forum}, author => [['a@a.a']], realm => [[$forum]], all => [['a@a.a'], [$forum]], ], [ {From => 'a@a.a', 'Reply-To' => $forum, To => $forum}, author => [['a@a.a']], realm => [[$forum]], [all => $alias] => [['a@a.a'], [$alias]], ], [ {From => $user1, 'Reply-To' => $forum, To => $forum}, author => [[$user1]], realm => [[$forum]], all => [[$forum]], ], [ {From => $forum, To => $forum}, author => [[$forum]], realm => [[$forum]], all => [[$forum]], ]), ];