2 # $Id: process.in,v 1.21 2000/10/31 13:14:53 joy Exp $
8 require( '/etc/debbugs/config' );
9 require( '/usr/lib/debbugs/errorlib' );
10 chdir( "$gSpoolDir" ) || die 'chdir spool: $!\n';
12 #open(DEBUG,"> /tmp/debbugs.debug");
13 open DEBUG, ">/dev/null";
15 defined( $intdate= time ) || &quit( "failed to get time: $!" );
18 m/^([BMQFDU])(\d*)\.\d+$/ || &quit("bad argument");
20 $tryref= length($2) ? $2+0 : -1;
23 if (!rename("incoming/G$nn","incoming/P$nn"))
24 { $_=$!.''; m/no such file or directory/i && exit 0;
25 &quit("renaming to lock: $!");
28 $baddress= 'bugs' if $codeletter eq 'B';
29 $baddress= 'maintonly' if $codeletter eq 'M';
30 $baddress= 'quiet' if $codeletter eq 'Q';
31 $baddress= 'forwarded' if $codeletter eq 'F';
32 $baddress= 'done' if $codeletter eq 'D';
33 $baddress= 'submitter' if $codeletter eq 'U';
34 $baddress || &quit("bad codeletter $codeletter");
35 $baddressroot= $baddress;
36 $baddress= "$tryref-$baddress" if $tryref>=0;
38 open(M,"incoming/P$nn");
45 print DEBUG "###\n",join("##\n",@msg),"\n###\n";
47 chop($tdate= `date -u '+%a, %d %h %Y %T GMT'`);
49 X-Loop: $gMaintainerEmail
50 Received: via spool by $baddress\@$gEmailDomain id=$nn
51 (code $codeletter ref $tryref); $tdate
54 # Process the message's mail headers
55 for ($i=0; $i<=$#msg; $i++) {
57 last unless length($_);
58 &quit("looping detected") if m/^x-loop: (\S+)$/i && $1 eq "$gMaintainerEmail";
59 $ins= !m/^subject:/i && !m/^reply-to:/i && !m/^return-path:/i
60 && !m/^From / && !m/^X-Debbugs-CC:/i && !m/^received:/i;
61 $fwd .= $_."\n" if $ins;
62 while ($msg[$i+1] =~ m/^\s/) {
64 $fwd .= $msg[$i]."\n" if $ins;
67 # print DEBUG ">$_<\n";
69 $v= $1; $v =~ y/A-Z/a-z/;
70 print DEBUG ">$v=$_<\n";
73 print DEBUG "!>$_<\n";
78 while ($i <= $#msg && !length($msg[$i])) { $fwd .= "\n"; $i++; }
80 #skips the "this is mime" message and any blank space after it
81 if ( $msg[$i] =~ /^This is a multi-part message in MIME format./ )
83 while ( $i <= $#msg && length( $msg[$i] ) ) { $fwd .= $msg[$i] . "\n"; $i++; }
84 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
86 #if the lines starts with -- or is nothing but blank space...
87 #skip to the next blank line(s) then skip past the blank line(s)
88 if ( $msg[$i] =~ /^--/ || $msg[$i] =~ /^\s*$/ )
90 while ( $i <= $#msg && length( $msg[$i] ) ) { $fwd .= $msg[$i] . "\n"; $i++; }
91 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
94 while (defined ($msg[$i] ) )
96 last if ( $msg[$i] !~ m/^([\w]+):\s*(\S+)(.*)/ );
99 print DEBUG ">$fn|$'|\n";
100 $fwd .= $fn.': '.$fv."\n";
104 $pfullheader{$fn}= $2.$3;
105 print DEBUG ">$fn~$fv<\n";
109 $fwd .= join("\n",@msg[$i..$#msg]);
111 print DEBUG "***\n$fwd\n***\n";
113 defined($header{'from'}) || &quit("no From header");
114 $replyto= defined($header{'reply-to'}) ? $header{'reply-to'} : $header{'from'};
117 $_= "$2 <$1>" if m/^([^\<\> \t\n\(\)]+) \(([^\(\)\<\>]+)\)$/;
119 print DEBUG "replytocompare >$replytocompare<\n";
121 if (!defined($header{'subject'}))
122 { $brokenness.= <<END;
124 Your message did not contain a Subject field. This is broken, I am
125 afraid - the Subject: line is a Required Header according to RFC822.
126 Please remember to include a Subject field in your messages in future.
127 If you did so the fact that it got lost probably indicates a poorly
128 configured mail system at your site or an intervening one.
130 $subject= '(no subject)';
131 } else { $subject= $header{'subject'}; }
134 $subject =~ s/^Re:\s*//i; $_= $subject."\n";
135 if ($tryref < 0 && m/^Bug ?\#(\d+)\D/i) { $tryref= $1+0; }
138 { $bfound= &lockreadbugmerge($tryref);
139 if ($bfound) { $ref= $tryref; }
141 { &htmllog("Reply","sent", $replyto,"Unknown problem report number <code>$tryref</code>.");
142 &sendmessage(<<END, '');
143 From: $gMaintainerEmail ($gProject $gBug Tracking System)
145 Subject: Unknown problem report $gBug#$tryref ($subject)
146 Message-ID: <handler.x.$nn.unknown\@$gEmailDomain>
147 In-Reply-To: $header{'message-id'}
148 References: $header{'message-id'} $s_msgid
149 X-$gProject-PR-Message: error
151 You sent a message to the $gBug tracking system which gave (in the
152 Subject line or encoded into the recipient at $gEmailDomain),
153 the number of a nonexistent $gBug report (#$tryref).
155 This may be because that $gBug report has been resolved for more than $gRemoveAge
156 days, and the record of it has been expunged, or because you mistyped
157 the $gBug report number.
159 Your message was dated $header{'date'} and was sent to
160 $baddress\@$gEmailDomain. It had
161 Message-ID $header{'message-id'}
162 and Subject $subject.
164 It has been filed (under junk) but otherwise ignored.
166 Please consult your records to find the correct $gBug report number, or
167 contact me, the system administrator, for assistance.
170 (administrator, $gProject $gBugs database)
172 (NB: If you are a system administrator and have no idea what I am
173 talking about this indicates a serious mail system misconfiguration
174 somewhere. Please contact me immediately.)
180 } else { &filelock('lock/-1'); }
182 if ($codeletter eq 'D' || $codeletter eq 'F')
183 { if ($replyto =~ m/$gBounceFroms/o ||
184 $header{'from'} =~ m/$gBounceFroms/o)
185 { &quit("bounce detected ! Mwaap! Mwaap!"); }
186 $markedby= $header{'from'} eq $replyto ? $replyto :
187 "$header{'from'} (reply to $replyto)";
188 if ($codeletter eq 'F')
189 { (&appendlog,&finish) if length($s_forwarded);
190 $receivedat= "forwarded\@$gEmailDomain";
191 $markaswhat= 'forwarded';
192 $set_forwarded= $header{'to'};
193 if ( length( $gListDomain ) > 0 && length( $gFowardList ) > 0 )
194 { $generalcc= "$gFowardList\@$gListDomain"; }
195 else { $generalcc=''; }
197 { (&appendlog,&finish) if length($s_done);
198 $receivedat= "done\@$gEmailDomain";
200 $set_done= $header{'from'};
201 if ( length( $gListDomain ) > 0 && length( $gDoneList ) > 0 )
202 { $generalcc= "$gDoneList\@$gListDomain"; }
203 else { $generalcc=''; }
206 { &htmllog("Warning","sent",$replyto,"Message ignored.");
207 &sendmessage(<<END, '');
208 From: $gMaintainerEmail ($gProject $gBug Tracking System)
210 Subject: Message with no $gBug number ignored by $receivedat
212 Message-ID: <header.x.$nn.warnignore\@$gEmailDomain>
213 In-Reply-To: $header{'message-id'}
214 References: $header{'message-id'} $s_msgid
215 X-$gProject-PR-Message: error
217 You sent a message to the $gProject $gBug tracking system old-style
218 unified mark as $markaswhat address ($receivedat),
219 without a recognisable $gBug number in the Subject.
220 Your message has been filed under junk but otherwise ignored.
222 If you don't know what I'm talking about then probably either:
224 (a) you unwittingly sent a message to done\@$gEmailDomain
225 because you replied to all recipients of the message a developer used
226 to mark a $gBug as done and you modified the Subject. In this case,
227 please do not be alarmed. To avoid confusion do not do it again, but
228 there is no need to apologise or mail anyone asking for an explanation.
230 (b) you are a system administrator, reading this because the $gBug
231 tracking system is responding to a misdirected bounce message. In this
232 case there is a serious mail system misconfiguration somewhere - please
233 contact me immediately.
235 Your message was dated $header{'date'} and had
236 message-id $header{'message-id'}
237 and subject $subject.
239 If you need any assistance or explanation please contact me.
242 (administrator, $gProject $gBugs database)
249 $noticeccval.= join(', ', grep($_ ne $replyto,@maintaddrs));
250 $noticeccval =~ s/\s+\n\s+/ /g; $noticeccval =~ s/^\s+/ /; $noticeccval =~ s/\s+$//;
251 if (length($noticeccval)) { $noticecc= "Cc: $noticeccval\n"; }
252 if (length($generalcc)) { $noticecc.= "Bcc: $generalcc\n"; }
253 @process= ($ref,split(/ /,$s_mergedwith));
256 { if ($ref != $orgref)
258 &lockreadbug($ref) || die "huh ? $ref from $orgref out of @process";
260 $s_done= $set_done if defined($set_done);
261 $s_forwarded= $set_forwarded if defined($set_forwarded);
262 &overwrite("db/$ref.status",
263 "$s_originator\n$s_date\n$s_subject\n$s_msgid\n".
264 "$s_package\n$s_keywords\n$s_done\n$s_forwarded\n$s_mergedwith\n$s_severity\n");
265 open(O,"db/$ref.report") || &quit("read original report: $!");
266 $x= join('',<O>); close(O);
267 if ($codeletter eq 'F')
268 { &htmllog("Reply","sent",$replyto,"You have marked $gBug as forwarded.");
269 &sendmessage(<<END, '');
270 From: $gMaintainerEmail ($gProject $gBug Tracking System)
272 ${noticecc}Subject: $gBug#$ref: marked as forwarded ($s_subject)
273 Message-ID: <header.$ref.$nn.ackfwdd\@$gEmailDomain>
274 In-Reply-To: $header{'message-id'}
275 References: $header{'message-id'} $s_msgid
276 X-$gProject-PR-Message: forwarded $ref
278 Your message dated $header{'date'}
279 with message-id $header{'message-id'}
280 has caused the $gProject $gBug report #$ref,
282 to be marked as having been forwarded to the upstream software
283 author(s) $s_forwarded.
285 (NB: If you are a system administrator and have no idea what I am
286 talking about this indicates a serious mail system misconfiguration
287 somewhere. Please contact me immediately.)
290 (administrator, $gProject $gBugs database)
294 { &htmllog("Reply","sent",$replyto,"You have taken responsibility.");
295 &sendmessage(<<END."--------------------------------------\n".$x."---------------------------------------\n".join( "\n", @msg ), '');
296 From: $gMaintainerEmail ($gProject $gBug Tracking System)
298 ${noticecc}Subject: $gBug#$ref: marked as done ($s_subject)
299 Message-ID: <handler.$ref.$nn.ackdone\@$gEmailDomain>
300 In-Reply-To: $header{'message-id'}
301 References: $header{'message-id'} $s_msgid
302 X-$gProject-PR-Message: closed $ref
304 Your message dated $header{'date'}
305 with message-id $header{'message-id'}
306 and subject line $subject
307 has caused the attached $gBug report to be marked as done.
309 This means that you claim that the problem has been dealt with.
310 If this is not the case it is now your responsibility to reopen the
311 $gBug report if necessary, and/or fix the problem forthwith.
313 (NB: If you are a system administrator and have no idea what I am
314 talking about this indicates a serious mail system misconfiguration
315 somewhere. Please contact me immediately.)
318 (administrator, $gProject $gBugs database)
321 &htmllog("Notification","sent",$s_originator,
322 "$gBug acknowledged by developer.");
323 &sendmessage(<<END.join("\n",@msg),'');
324 From: $gMaintainerEmail ($gProject $gBug Tracking System)
326 Subject: $gBug#$ref acknowledged by developer ($s_subject)
327 Message-ID: <handler.$ref.$nn.notifdone\@$gEmailDomain>
328 In-Reply-To: $s_msgid
329 References: $header{'message-id'} $s_msgid
330 X-$gProject-PR-Message: they-closed $ref
332 This is an automatic notification regarding your $gBug report.
334 It has been closed by one of the developers, namely
337 Their explanation is attached below. If this explanation is
338 unsatisfactory and you have not received a better one in a separate
339 message then please contact the developer directly, or email
340 $ref\@$gEmailDomain or me.
343 (administrator, $gProject $gBugs database)
353 { if ($codeletter eq 'U')
354 { &htmllog("Warning","sent",$replyto,"Message not forwarded.");
355 &sendmessage(<<END, '');
356 From: $gMaintainerEmail ($gProject $gBug Tracking System)
358 Subject: Message with no $gBug number cannot be sent to submitter !
360 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
361 In-Reply-To: $header{'message-id'}
362 References: $header{'message-id'} $s_msgid
363 X-$gProject-PR-Message: error
365 You sent a message to the $gProject $gBug tracking system send to $gBug
366 report submitter address $baddress\@$gEmailDomain, without a
367 recognisable $gBug number in the Subject. Your message has been filed
368 under junk but otherwise ignored.
370 If you don't know what I'm talking about then probably either:
372 (a) you unwittingly sent a message to $baddress\@$gEmailDomain
373 because you replied to all recipients of the message a developer sent
374 to a $gBug's submitter and you modified the Subject. In this case,
375 please do not be alarmed. To avoid confusion do not do it again, but
376 there is no need to apologise or mail anyone asking for an
379 (b) you are a system administrator, reading this because the $gBug
380 tracking system is responding to a misdirected bounce message. In this
381 case there is a serious mail system misconfiguration somewhere - please
382 contact me immediately.
384 Your message was dated $header{'date'} and had
385 message-id $header{'message-id'}
386 and subject $subject.
388 If you need any assistance or explanation please contact me.
391 (administrator, $gProject $gBugs database)
397 if (!defined($pheader{'package'}))
398 { &htmllog("Warning","sent",$replyto,"Message not forwarded.");
399 &sendmessage(<<END."---------------------------------------------------------------------------\n".join("\n", @msg), '');
400 From: $gMaintainerEmail ($gProject $gBug Tracking System)
402 Subject: Message with no Package: tag cannot be processed!
404 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
405 In-Reply-To: $header{'message-id'}
406 References: $header{'message-id'} $s_msgid
407 X-$gProject-PR-Message: error
409 Your message didn't have a Package: line at the start (in the
410 pseudo-header following the real mail header), or didn't have a
411 pseudo-header at all.
413 This makes it much harder for us to categorise and deal with your
414 problem report. Please _resubmit_ your report and tell us which package
415 the report is on. For help, check out http://$gWebDomain/Reporting.html.
417 Your message was dated $header{'date'} and had
418 message-id $header{'message-id'}
419 and subject $subject.
420 The complete text of it is attached to this message.
422 If you need any assistance or explanation please contact me.
425 (administrator, $gProject $gBugs database)
430 } else { $s_package= $pheader{'package'}; }
432 if (defined($pheader{'keywords'})) {
433 $s_keywords= $pfullheader{'keywords'};
434 } elsif (defined($pheader{'tags'})) {
435 $s_keywords= $pfullheader{'tags'};
437 if (length($s_keywords)) {
439 my %gkws = map { (%_, 1) } @gTags;
440 foreach my $kw (sort split(/[,\s]+/, lc($s_keywords))) {
441 push @kws, $kw if (defined $gkws{$kw});
443 $s_keywords = join(" ", @kws);
446 if (defined($pheader{'severity'}) || defined($pheader{'priority'}))
447 { $s_severity= $pheader{'severity'};
448 $s_severity= $pheader{'priority'} unless ($s_severity);
450 if (!grep($_ eq $s_severity, @severities, "$gDefaultSeverity")) {
453 Your message specified a Severity: in the pseudo-header, but
454 the severity value $s_severity was not recognised.
455 The default severity $gDefaultSeverity is being used instead.
456 The recognised values are: $gShowSeverities.
458 # if we use @gSeverityList array in the above line, perl -c gives:
459 # In string, @gSeverityList now must be written as \@gSeverityList at
460 # process line 452, near "$gDefaultSeverity is being used instead.
464 &filelock("nextnumber.lock");
465 open(N,"nextnumber") || &quit("nextnumber: read: $!");
466 $v=<N>; $v =~ s/\n$// || &quit("nextnumber bad format");
467 $ref= $v+0; $v += 1; $newref=1;
468 &overwrite('nextnumber', "$v\n");
470 &overwrite("db/$ref.log",'');
471 &overwrite("db/$ref.status",
472 "$replyto\n$intdate\n$subject\n$header{'message-id'}\n".
473 "$s_package\n$s_keywords\n\n\n\n$s_severity\n");
474 &overwrite("db/$ref.report",
475 join("\n",@msg)."\n");
480 print DEBUG "maintainers >@maintaddrs<\n";
482 $orgsender= defined($header{'sender'}) ? "Orignal-Sender: $header{'sender'}\n" : '';
483 $newsubject= $subject; $newsubject =~ s/^$gBug#$ref\W*\s*//;
485 $xcchdr= $header{ 'x-debbugs-cc' };
486 if ($xcchdr =~ m/\S/) {
487 push(@resentccs,$xcchdr);
488 $resentccexplain.= <<END;
490 As you requested using X-Debbugs-CC, your message was also forwarded to
492 (after having been given a $gBug report number, if it did not have one).
496 if (@maintaddrs && ($codeletter eq 'B' || $codeletter eq 'M')) {
497 push(@resentccs,@maintaddrs);
498 $resentccexplain.= <<END." ".join("\n ",@maintaddrs)."\n";
500 Your message has been sent to the package maintainer(s):
504 $veryquiet= $codeletter eq 'Q';
505 if ($codeletter eq 'M' && !@maintaddrs) {
509 You requested that the message be sent to the package maintainer(s)
510 but either the $gBug report is not associated with any package (probably
511 because of a missing Package pseudo-header field in the original $gBug
512 report), or the package(s) specified do not have any maintainer(s).
514 Your message has *not* been sent to any package maintainers; it has
515 merely been filed in the $gBug tracking system. If you require assistance
516 please contact $gMaintainerEmail quoting the $gBug number $ref.
520 $resentccval.= join(', ',@resentccs);
521 $resentccval =~ s/\s+\n\s+/ /g; $resentccval =~ s/^\s+/ /; $resentccval =~ s/\s+$//;
522 if (length($resentccval)) { $resentcc= "Resent-CC: $resentccval\n"; }
524 if ($codeletter eq 'U') {
525 &htmllog("Message", "sent on", $s_originator, "$gBug#$ref.");
526 &sendmessage(<<END,$s_originator,@resentccs);
527 Subject: $gBug#$ref: $newsubject
528 Reply-To: $replyto, $ref-quiet\@$gEmailDomain
529 ${orgsender}Resent-To: $s_originator
530 ${resentcc}Resent-Date: $tdate
531 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
532 Resent-Sender: $gMaintainerEmail
533 X-$gProject-PR-Message: report $ref
534 X-$gProject-PR-Package: $s_package
537 } elsif ($codeletter eq 'B') {
538 &htmllog($newref ? "Report" : "Information", "forwarded",
539 join(', ',"$gSubmitList\@$gListDomain",@resentccs),
540 "<code>$gBug#$ref</code>".
541 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
543 &sendmessage(<<END,"$gSubmitList\@$gListDomain",@resentccs);
544 Subject: $gBug#$ref: $newsubject
545 Reply-To: $replyto, $ref\@$gEmailDomain
546 Resent-From: $header{'from'}
547 ${orgsender}Resent-To: $gSubmitList\@$gListDomain
548 ${resentcc}Resent-Date: $tdate
549 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
550 Resent-Sender: $gMaintainerEmail
551 X-$gProject-PR-Message: report $ref
552 X-$gProject-PR-Package: $s_package
555 } elsif (@resentccs) {
556 # D and F done far earlier; B just done - so this must be M or Q
557 # We preserve whichever it was in the Reply-To (possibly adding
559 &htmllog($newref ? "Report" : "Information", "forwarded",
561 "<code>$gBug#$ref</code>".
562 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
564 &sendmessage(<<END,@resentccs);
565 Subject: $gBug#$ref: $newsubject
566 Reply-To: $replyto, $ref-$baddressroot\@$gEmailDomain
567 Resent-From: $header{'from'}
568 ${orgsender}Resent-To: $resentccval
570 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
571 Resent-Sender: $gMaintainerEmail
572 X-$gProject-PR-Message: report $ref
573 X-$gProject-PR-Package: $s_package
578 $htmlbreak= length($brokenness) ? "<p>\n".&sani($brokenness)."\n<p>\n" : '';
579 $htmlbreak =~ s/\n\n/\n<P>\n\n/g;
580 if (length($resentccval)) {
582 " Copy sent to <code>".&sani($resentccval)."</code>.".
586 &htmllog("Acknowledgement","sent",$replyto,
588 "New $gBug report received and filed, but not forwarded." :
589 "New $gBug report received and forwarded."). $htmlbreak);
590 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
591 From: $gMaintainerEmail ($gProject $gBug Tracking System)
593 Subject: $gBug#$ref: Acknowledgement of QUIET report
595 Message-ID: <handler.$ref.$nn.ackquiet\@$gEmailDomain>
596 In-Reply-To: $header{'message-id'}
597 References: $header{'message-id'}
598 X-$gProject-PR-Message: ack-quiet $ref
600 Thank you for the problem report you have sent regarding $gProject.
601 This is an automatically generated reply, to let you know your message
602 has been received. It has not been forwarded to the developers or
603 their mailing list; you should ensure that the developers are aware of
604 the problem you have entered into the system - preferably quoting the
605 $gBug reference number, #$ref.
607 If you wish to submit further information on your problem, please send it
608 to $ref-$baddressroot\@$gEmailDomain (and *not*
609 to $baddress\@$gEmailDomain).
611 Please do not reply to the address at the top of this message,
612 unless you wish to report a problem with the $gBug-tracking system.
615 (administrator, $gProject $gBugs database)
617 From: $gMaintainerEmail ($gProject $gBug Tracking System)
619 Subject: $gBug#$ref: Acknowledgement of maintainer-only report
621 Message-ID: <handler.$ref.$nn.ackmaint\@$gEmailDomain>
622 In-Reply-To: $header{'message-id'}
623 References: $header{'message-id'}
624 X-$gProject-PR-Message: ack-maintonly $ref
626 Thank you for the problem report you have sent regarding $gProject.
627 This is an automatically generated reply, to let you know your message has
628 been received. It is being forwarded to the developers (but not the mailing
629 list, as you requested) for their attention; they will reply in due course.
631 If you wish to submit further information on your problem, please send
632 it to $ref-$baddressroot\@$gEmailDomain (and *not*
633 to $baddress\@$gEmailDomain).
635 Please do not reply to the address at the top of this message,
636 unless you wish to report a problem with the $gBug-tracking system.
639 (administrator, $gProject $gBugs database)
641 From: $gMaintainerEmail ($gProject $gBug Tracking System)
643 Subject: $gBug#$ref: Acknowledgement ($subject)
644 Message-ID: <handler.$ref.$nn.ack\@$gEmailDomain>
645 In-Reply-To: $header{'message-id'}
646 References: $header{'message-id'}
647 X-$gProject-PR-Message: ack $ref
649 Thank you for the problem report you have sent regarding $gProject.
650 This is an automatically generated reply, to let you know your message has
651 been received. It is being forwarded to the developers mailing list for
652 their attention; they will reply in due course.
654 If you wish to submit further information on your problem, please send
655 it to $ref\@$gEmailDomain (and *not* to
656 $baddress\@$gEmailDomain).
658 Please do not reply to the address at the top of this message,
659 unless you wish to report a problem with the $gBug-tracking system.
662 (administrator, $gProject $gBugs database)
664 } elsif ($codeletter ne 'U') {
665 &htmllog("Acknowledgement","sent",$replyto,
666 ($veryquiet ? "Extra info received and filed, but not forwarded." :
667 $codeletter eq 'M' ? "Extra info received and forwarded to maintainer." :
668 "Extra info received and forwarded to list."). $htmlbreak);
669 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
670 From: $gMaintainerEmail ($gProject $gBug Tracking System)
672 Subject: $gBug#$ref: Info received and FILED only
674 Message-ID: <handler.$ref.$nn.ackinfoquiet\@$gEmailDomain>
675 In-Reply-To: $header{'message-id'}
676 References: $header{'message-id'}
677 X-$gProject-PR-Message: ack-info-quiet $ref
679 Thank you for the additional information you have supplied regarding
680 this problem report. It has NOT been forwarded to the developers, but
681 will accompany the original report in the $gBug tracking system. Please
682 ensure that you yourself have sent a copy of the additional
683 information to any relevant developers or mailing lists.
685 If you wish to continue to submit further information on your problem,
686 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
688 Please do not reply to the address at the top of this message,
689 unless you wish to report a problem with the $gBug-tracking system.
692 (administrator, $gProject $gBugs database)
694 From: $gMaintainerEmail ($gProject $gBug Tracking System)
696 Subject: $gBug#$ref: Info received for maintainer only
698 Message-ID: <handler.$ref.$nn.ackinfomaint\@$gEmailDomain>
699 In-Reply-To: $header{'message-id'}
700 References: $header{'message-id'}
701 X-$gProject-PR-Message: ack-info $ref
703 Thank you for the additional information you have supplied regarding
704 this problem report. It has been forwarded to the developer(s) (but
705 not to the mailing list) to accompany the original report.
707 If you wish to continue to submit further information on your problem,
708 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
710 Please do not reply to the address at the top of this message,
711 unless you wish to report a problem with the $gBug-tracking system.
714 (administrator, $gProject $gBugs database)
716 From: $gMaintainerEmail ($gProject $gBug Tracking System)
718 Subject: $gBug#$ref: Info received (was $subject)
719 Message-ID: <handler.$ref.$nn.ackinfo\@$gEmailDomain>
720 In-Reply-To: $header{'message-id'}
721 References: $header{'message-id'}
722 X-$gProject-PR-Message: ack-info-maintonly $ref
724 Thank you for the additional information you have supplied regarding
725 this problem report. It has been forwarded to the developer(s) and
726 to the developers mailing list to accompany the original report.
728 If you wish to continue to submit further information on your problem,
729 please send it to $ref\@$gEmailDomain, as before.
731 Please do not reply to the address at the top of this message,
732 unless you wish to report a problem with the $gBug-tracking system.
735 (administrator, $gProject $gBugs database)
744 open(NEW,">$f.new") || &quit("$f.new: create: $!");
745 print(NEW "$v") || &quit("$f.new: write: $!");
746 close(NEW) || &quit("$f.new: close: $!");
747 rename("$f.new","$f") || &quit("rename $f.new to $f: $!");
751 if (!open(AP,">>db/$ref.log")) {
752 print DEBUG "failed open log<\n";
753 print DEBUG "failed open log err $!<\n";
754 &quit("opening db/$ref.log (li): $!");
756 print(AP "\7\n",@log,"\n\3\n") || &quit("writing db/$ref.log (li): $!");
757 close(AP) || &quit("closing db/$ref.log (li): $!");
761 utime(time,time,"db");
763 while ($u= $cleanups[$#cleanups]) { &$u; }
764 unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
768 &quit("wot no exit");
770 sub chldhandle { $chldexit = 'yes'; }
773 local ($whatobj,$whatverb,$where,$desc) = @_;
774 open(AP,">>db/$ref.log") || &quit("opening db/$ref.log (lh): $!");
777 "<strong>$whatobj $whatverb</strong> to <code>".&sani($where).
778 "</code>:<br>\n". $desc.
779 "\n\3\n") || &quit("writing db/$ref.log (lh): $!");
780 close(AP) || &quit("closing db/$ref.log (lh): $!");
785 map { $_->address() }
786 map { Mail::Address->parse($_) } @_;
791 local ($msg,@recips) = @_;
792 if ($recips[0] eq '' && $#recips == 0) { @recips= ('-t'); }
794 #save email to the log
795 open(AP,">>db/$ref.log") || &quit("opening db/$ref.log (lo): $!");
796 print(AP "\2\n",join("\4",@recips),"\n\5\n$msg\n\3\n") ||
797 &quit("writing db/$ref.log (lo): $!");
798 close(AP) || &quit("closing db/$ref.log (lo): $!");
800 #if debbuging.. save email to a log
801 # open AP, ">>debug";
802 # print AP join( '|', @recips )."\n>>";
803 # print AP get_addresses( @recips );
804 # print AP "<<\n".$msg;
805 # print AP "\n--------------------------------------------------------\n";
810 $SIG{'CHLD'}='chldhandle';
811 #print DEBUG "mailing sigchild set up<\n";
814 #print DEBUG "mailing opened pipe fork<\n";
815 defined($c) || die $!;
816 #print DEBUG "mailing opened pipe fork ok $c<\n";
817 if (!$c) { # ie, we are in the child process
818 #print DEBUG "mailing child<\n";
819 unless (open(STDERR,">&STDOUT")) {
820 #print DEBUG "mailing child opened stderr<\n";
821 print STDOUT "redirect stderr: $!\n";
822 #print DEBUG "mailing child opened stderr fail<\n";
824 #print DEBUG "mailing child opened stderr fail exit !?<\n";
826 #print DEBUG "mailing child opened stderr ok<\n";
828 #print DEBUG "mailing child forked again<\n";
829 defined($c) || die $!;
830 #print DEBUG "mailing child forked again ok $c<\n";
831 if (!$c) { # ie, we are the child process
832 #print DEBUG "mailing grandchild<\n";
833 exec '/usr/lib/sendmail','-f'."$gMaintainerEmail",'-odi','-oem','-oi',get_addresses(@recips);
834 #print DEBUG "mailing grandchild exec failed<\n";
836 #print DEBUG "mailing grandchild died !?<\n";
838 #print DEBUG "mailing child not grandchild<\n";
839 print(D $msg) || die $!;
840 #print DEBUG "mailing child printed msg<\n";
842 #print DEBUG "mailing child closed pipe<\n";
843 die "\n*** command returned exit status $?\n" if $?;
844 #print DEBUG "mailing child exit status ok<\n";
846 #print DEBUG "mailing child exited ?!<\n";
848 #print DEBUG "mailing parent<\n";
850 #print DEBUG "mailing parent results emptied<\n";
851 while( $chldexit eq 'no' ) { $results.= $_; }
852 #print DEBUG "mailing parent results read >$results<\n";
854 #print DEBUG "mailing parent results closed<\n";
855 $results.= "\n*** child returned exit status $?\n" if $?;
856 #print DEBUG "mailing parent exit status ok<\n";
857 $SIG{'CHLD'}='DEFAULT';
858 #print DEBUG "mailing parent sigchild default<\n";
859 if (length($results)) { &quit("running sendmail: $results"); }
860 #print DEBUG "mailing parent results ok<\n";
863 sub checkmaintainers {
864 return if $maintainerschecked++;
865 return if !length($s_package);
866 open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
870 m/^(\S+)\s+(\S.*\S)\n$/ || &quit("maintainers bogus \`$_'");
871 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
872 $maintainerof{$1}= $2;
875 $anymaintfound=0; $anymaintnotfound=0;
876 for $p (split(m/[ \t?,()]+/,$s_package)) {
878 if (defined($maintainerof{$p})) {
879 print DEBUG "maintainer add >$p|$maintainerof{$p}<\n";
880 $addmaint= $maintainerof{$p};
881 push(@maintaddrs,$addmaint) unless
882 $addmaint eq $replyto || grep($_ eq $addmaint, @maintaddrs);
885 print DEBUG "maintainer none >$p<\n";