my $output = '';
local $_ = $record->{type};
if (/html/) {
+ my $class = $record->{text} =~ /^<strong>(?:Acknowledgement|Reply|Information|Report|Notification)/ ? 'infmessage':'msgreceived';
$output .= decode_rfc1522($record->{text});
# Link to forwarded http:// urls in the midst of the report
# (even though these links already exist at the top)
$output .= '<a href="' . bugurl($ref, 'msg='.($msg_number+1)) . '">Full text</a> and <a href="' .
bugurl($ref, 'msg='.($msg_number+1), 'mbox') . '">rfc822 format</a> available.';
- $output = qq(<div class="msgreceived">\n<a name="$msg_number">\n) . $output . "</div>\n";
+ $output = qq(<div class="$class"><hr>\n<a name="$msg_number">\n) . $output . "</div>\n";
}
elsif (/recips/) {
my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im;
elsif (defined $msg_id) {
$$seen_msg_ids{$msg_id} = 1;
}
- $output .= qq(<a name="$msg_number">\n);
+ $output .= qq(<hr><a name="$msg_number">\n);
$output .= 'View this message in <a href="' . bugurl($ref, "msg=$msg_number", "mbox") . '">rfc822 format</a>';
$output .= handle_email_message($record->{text},
ref => $bug_number,
}
# Incomming Mail Message
my ($received,$hostname) = $record->{text} =~ m/Received: \(at (\S+)\) by (\S+)\;/;
- $output .= qq|<p class="msgreceived"><a name="$msg_number"><a name="msg$msg_number">Message received</a> at |.
+ $output .= qq|<hr><p class="msgreceived"><a name="$msg_number"><a name="msg$msg_number">Message received</a> at |.
htmlsanit("$received\@$hostname") . q| (<a href="| . bugurl($ref, "msg=$msg_number") . '">full text</a>'.q|, <a href="| . bugurl($ref, "msg=$msg_number") . ';mbox=yes">mbox</a>)'.":</p>\n";
$output .= handle_email_message($record->{text},
ref => $bug_number,
}
@log = reverse @log if $reverse;
-$log = join('<hr>',@log);
+$log = join("\n",@log);
print "Content-Type: text/html; charset=utf-8\n\n";
my $dummy2 = $debbugs::gWebHostBugDir;
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
-print "<HTML><HEAD>\n" .
- "<TITLE>$short - $title - $debbugs::gProject $debbugs::gBug report logs</TITLE>\n" .
- '<meta http-equiv="Content-Type" content="text/html;charset=utf-8">'.
- "<link rel=\"stylesheet\" href=\"$debbugs::gWebHostBugDir/css/bugs.css\" type=\"text/css\">" .
- "</HEAD>\n" .
- '<BODY>' .
- "\n";
+print <<END;
+<HTML><HEAD>
+<TITLE>$short - $title - $debbugs::gProject $debbugs::gBug report logs</TITLE>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<link rel="stylesheet" href="$debbugs::gWebHostBugDir/css/bugs.css" type="text/css">
+<script type="text/javascript">
+<!--
+function toggle_infmessages(){
+ var styles = document.styleSheets;
+ var deleted = 0
+ for (var i = 0; i < styles.length; i++) {
+ for (var j = 0; j < styles[i].cssRules.length; j++) {
+ if (styles[i].cssRules[j].cssText == ".infmessage { display: none; }") {
+ styles[i].deleteRule(j);
+ deleted = 1;
+ }
+ }
+ }
+ if (!deleted) {
+ styles[0].insertRule(".infmessage { display: none; }",0);
+ }
+}
+-->
+</script>
+</HEAD>
+<BODY">
+END
print "<H1>" . "$debbugs::gProject $debbugs::gBug report logs - <A HREF=\"mailto:$ref\@$gEmailDomain\">$short</A>" .
"<BR>" . $title . "</H1>\n";
print qq(<p><a href="mailto:$ref\@$debbugs::gEmailDomain">Reply</a> ),
qq(or <a href="mailto:$ref-subscribe\@$debbugs::gEmailDomain">subscribe</a> ),
qq(to this bug.</p>\n);
+print qq(<p><a href="javascript:toggle_infmessages();">Show useless messages</a></p>);
printf "<div class=\"msgreceived\"><p>View this report as an <a href=\"%s\">mbox folder</a>.</p></div>\n", bugurl($ref, "mbox");
-print "<HR>";
print "$log";
print "<HR>";
print "<p class=\"msgreceived\">Send a report that <a href=\"/cgi-bin/bugspam.cgi?bug=$ref\">this bug log contains spam</a>.</p>\n<HR>\n";
$replyto = $header{'from'};
}
+# This is an error counter which should be incremented every time there is an error.
+my $errors = 0;
$controlrequestaddr= $control ? "control\@$gEmailDomain" : "request\@$gEmailDomain";
$transcript='';
&transcript("Processing commands for $controlrequestaddr:\n\n");
"detailed logs for $gBug#$ref");
} elsif (m/^index(\s+full)?$/i) {
&transcript("This BTS function is currently disabled, sorry.\n\n");
+ $errors++;
$ok++; # well, it's not really ok, but it fixes #81224 :)
} elsif (m/^index-summary\s+by-package$/i) {
&transcript("This BTS function is currently disabled, sorry.\n\n");
+ $errors++;
$ok++; # well, it's not really ok, but it fixes #81224 :)
} elsif (m/^index-summary(\s+by-number)?$/i) {
&transcript("This BTS function is currently disabled, sorry.\n\n");
+ $errors++;
$ok++; # well, it's not really ok, but it fixes #81224 :)
} elsif (m/^index(\s+|-)pack(age)?s?$/i) {
&sendlynxdoc("pkgindex.cgi?indexon=pkg",'index of packages');
$ok++;
} elsif (m/^send-unmatched(\s+this|\s+-?0)?$/i) {
&transcript("This BTS function is currently disabled, sorry.\n\n");
+ $errors++;
$ok++; # well, it's not really ok, but it fixes #81224 :)
} elsif (m/^send-unmatched\s+(last|-1)$/i) {
&transcript("This BTS function is currently disabled, sorry.\n\n");
+ $errors++;
$ok++; # well, it's not really ok, but it fixes #81224 :)
} elsif (m/^send-unmatched\s+(old|-2)$/i) {
&transcript("This BTS function is currently disabled, sorry.\n\n");
+ $errors++;
$ok++; # well, it's not really ok, but it fixes #81224 :)
} elsif (m/^getinfo\s+([\w-.]+)$/i) {
# the following is basically a Debian-specific kludge, but who cares
$user = $newuser;
} else {
&transcript("Selected user id ($newuser) invalid, sorry\n");
+ $errors++;
$user = "";
}
} elsif (m/^usercategory\s+(\S+)(\s+\[hidden\])?\s*$/i) {
my ($o, $txt) = ($1, $2);
if ($#cats == -1 && $o eq "+") {
&transcript("User defined category specification must start with a category name. Skipping.\n\n");
+ $errors++;
$bad = 1;
next;
}
$desc = ""; $op = $1;
} else {
&transcript("Unrecognised syntax for category section. Skipping.\n\n");
+ $errors++;
$bad = 1;
next;
}
$ref = $1; $addsubcode = $3 || "+"; $tags = $4;
if ($user eq "") {
&transcript("No valid user selected\n");
+ $errors++;
} elsif (&setbug) {
&nochangebug;
my %ut;
}
if (@badtags) {
&transcript("Ignoring illegal tag/s: ".join(', ', @badtags).".\nPlease use only alphanumerics, at, dot, plus and dash.\n");
+ $errors++;
}
for my $t (keys %chtags) {
$ut{$t} = [] unless defined $ut{$t};
(Use control\@$gEmailDomain to manipulate reports.)
END
+ $errors++;
if (++$unknowns >= 3) {
&transcript("Too many unknown commands, stopping here.\n\n");
last;
if (&setbug) {
if (!length($data->{done}) and not defined($version)) {
&transcript("$gBug is already open, cannot reopen.\n\n");
+ $errors++;
&nochangebug;
} else {
$action=
if (!grep($_ eq $newseverity, @gSeverityList, "$gDefaultSeverity")) {
&transcript("Severity level \`$newseverity' is not known.\n".
"Recognized are: $gShowSeverities.\n\n");
+ $errors++;
} elsif (exists $gObsoleteSeverities{$newseverity}) {
&transcript("Severity level \`$newseverity' is obsolete. " .
- "$gObsoleteSeverities{$newseverity}\n\n");
+ "Use $gObsoleteSeverities{$newseverity} instead.\n\n");
+ $errors++;
} elsif (&setbug) {
$printseverity= $data->{severity};
$printseverity= "$gDefaultSeverity" if $printseverity eq '';
if (@badtags) {
&transcript("Unknown tag/s: ".join(', ', @badtags).".\n".
"Recognized are: ".join(' ', @gTags).".\n\n");
+ $errors++;
}
if (&setbug) {
if ($data->{keywords} eq '') {
}
if (@badblockers) {
&transcript("Unknown blocking bug/s: ".join(', ', @badblockers).".\n");
+ $errors++;
}
$ref=$bugnum;
if (length($mismatch)) {
&transcript("Mismatch - only $gBugs in same state can be merged:\n".
$mismatch."\n");
+ $errors++;
&cancelbug; @newmergelist=(); last;
}
push(@newmergelist,$ref);
if ($data->{package} ne $master_bug_data->{package}) {
&transcript("Mismatch - only $gBugs in the same package can be forcibly merged:\n".
"$gBug $ref is not in the same package as $master_bug\n");
+ $errors++;
&cancelbug; @newmergelist=(); last;
}
for my $t (split /\s+/,$data->{keywords}) {
$bug_affected{$ref} = 1;
if (&setbug) {
if (length($data->{mergedwith})) {
- &transcript("$gBug is marked as being merged with others.\n\n");
+ &transcript("$gBug is marked as being merged with others. Use an existing clone.\n\n");
+ $errors++;
&nochangebug;
} else {
&filelock("nextnumber.lock");
}
} else {
&transcript("Unknown command or malformed arguments to command.\n\n");
+ $errors++;
if (++$unknowns >= 5) {
&transcript("Too many unknown commands, stopping here.\n\n");
last;
&transcript(">\nEnd of message, stopping processing here.\n\n");
}
if (!$ok && !quickabort) {
+ $errors++;
&transcript("No commands successfully parsed; sending the help text(s).\n");
&sendhelp;
&transcript("\n");
$header{'subject'} = "your mail";
}
+# Error text here advertises how many errors there were
+my $error_text = $errors > 0 ? " (with $errors errors)":'';
+
$reply= <<END;
From: $gMaintainerEmail ($gProject $gBug Tracking System)
To: $replyto
-${maintccs}Subject: Processed: $header{'subject'}
+${maintccs}Subject: Processed${error_text}: $header{'subject'}
In-Reply-To: $header{'message-id'}
References: $header{'message-id'}
Message-ID: <handler.s.$nn.transcript\@$gEmailDomain>
sub checkpkglimit {
if (keys %limit_pkgs and not defined $limit_pkgs{$data->{package}}) {
&transcript("$gBug number $ref belongs to package $data->{package}, skipping.\n\n");
+ $errors++;
return 0;
}
return 1;
# &transcript("$action\n\n")
# endmerge
-sub notfoundbug { &transcript("$gBug number $ref not found.\n\n"); }
+sub notfoundbug { &transcript("$gBug number $ref not found. (Is it archived?)\n\n"); }
sub foundbug { &transcript("$gBug#$ref: $data->{subject}\n"); }
sub getmerge {