+ my @senders = ReturnSenders(
+ userid => $userid,
+ type => $type,
+ start_at => $next,
+ lines => $lines,
+ date => $date
+ );
+
+ for my $sender (@senders) {
+ my $msgs = ReturnMessages(
+ userid => $userid,
+ sender => $sender,
+ );
+
+ my $leftclass = 'tableleftdata';
+ my $dataclass = 'tabledata';
+ my $rightclass = 'tablerightdata';
+ my $senderclass = 'sender';
+ my $subjectclass = 'subject';
+
+ # Check to see if this is the last line
+ if ((($next + 1) % $lines) == (@senders % $lines)) {
+ # We always "bottom" the first column
+ $leftclass = 'tablebottomleft';
+
+ # Check to see if there any message lines to display
+ unless (@$msgs) {
+ $dataclass = 'tablebottomdata';
+ $rightclass = 'tablebottomright';
+ $senderclass = 'senderbottom';
+ } # unless
+ } # if
+
+ # This is for the purposes of supplying a subject line if the mailto address
+ # is clicked on. It's kludgy because we are simply grabbing the subject line
+ # of the first email sent where there may be many emails from this sender
+ # Still it is often the right subject (or a good enough one)
+ #
+ # A little tricky here because of transliteration. If I test for
+ # $msg->[0]{subject} when $msg->[0] is essentially empty I create the hash
+ # making it non empty. Therefore I need to first test if $msgs->[0] exists
+ # first.
+ my $heading = '';
+
+ if ($msgs->[0]) {
+ $heading = $msgs->[0]{subject} if $msgs->[0]{subject};
+ } # if
+
+ my ($onlist, $seq);
+
+ my $rule = 'none';
+ my $hit_count = 0;
+
+ ($onlist, $rule, $seq, $hit_count) = OnWhitelist($sender, $userid, 0);
+
+ unless ($onlist) {
+ ($onlist, $rule, $seq, $hit_count) = OnBlacklist($sender, 0);
+
+ unless ($onlist) {
+ ($onlist, $rule, $seq, $hit_count) = OnNulllist($sender, 0);
+ } # unless
+ } # unless
+
+ $hit_count //= '';
+
+ my $list = '';
+ my $sequence = 0;
+ my $comment = '';
+
+ # Parse rule
+ if ($rule) {
+ if ($rule =~ /\((\w+):(\d+)\)\s+"(\S*)"/) {
+ $list = $1;
+ $sequence = $2;
+ $rule = $3;
+ $comment = '';
+ } elsif ($rule =~ /\((\w+):(\d+)\)\s+"(\S*) - (.*)"/) {
+ $list = $1;
+ $sequence = $2;
+ $rule = $3;
+ $comment = $4;
+ } # if