2 # $Id: process.in,v 1.3 1999/09/16 07:16:47 gecko Exp $
8 require( '/etc/debbugs/config' );
9 require( '/usr/lib/debbugs/errorlib' );
10 chdir( "$gSpoolDir" ) || die 'chdir spool: $!\n';
13 #open(DEBUG,"> /tmp/debbugs.debug");
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 for ($i=0; $i<=$#msg; $i++) {
56 last unless length($_);
57 &quit("looping detected") if m/^x-loop: (\S+)$/i && $1 eq "$gMaintainerEmail";
58 $ins= !m/^subject:/i && !m/^reply-to:/i && !m/^return-path:/i
59 && !m/^From / && !m/^X-Debbugs-CC:/i && !m/^received:/i;
60 $fwd .= $_."\n" if $ins;
61 while ($msg[$i+1] =~ m/^\s/) {
63 $fwd .= $msg[$i]."\n" if $ins;
66 # print DEBUG ">$_<\n";
68 $v= $1; $v =~ y/A-Z/a-z/;
69 print DEBUG ">$v=$_<\n";
72 print DEBUG "!>$_<\n";
77 while ($i <= $#msg && !length($msg[$i])) { $fwd .= "\n"; $i++; }
78 if ( $msg[$i] =~ /^--/ || $msg[$i] =~ /^\s*$/ )
80 while ( $i <= $#msg && length( $msg[$i] ) ) { $fwd .= $msg[$i]; $i++; }
81 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
84 while (defined ($msg[$i] ) )
86 last if ( $msg[$i] !~ m/^([\w]+):\s*(\S+)/ );
89 print DEBUG ">$fn|$'|\n";
90 $fwd .= $fn.': '.$fv."\n";
93 print DEBUG ">$fn~$fv<\n";
97 $fwd .= join("\n",@msg[$i..$#msg]);
99 print DEBUG "***\n$fwd\n***\n";
101 defined($header{'from'}) || &quit("no From header");
102 $replyto= defined($header{'reply-to'}) ? $header{'reply-to'} : $header{'from'};
105 $_= "$2 <$1>" if m/^([^\<\> \t\n\(\)]+) \(([^\(\)\<\>]+)\)$/;
107 print DEBUG "replytocompare >$replytocompare<\n";
109 if (!defined($header{'subject'}))
110 { $brokenness.= <<END;
112 Your message did not contain a Subject field. This is broken, I am
113 afraid - the Subject: line is a Required Header according to RFC822.
114 Please remember to include a Subject field in your messages in future.
115 If you did so the fact that it got lost probably indicates a poorly
116 configured mail system at your site or an intervening one.
118 $subject= '(no subject)';
119 } else { $subject= $header{'subject'}; }
122 $subject =~ s/^Re:\s*//i; $_= $subject."\n";
123 if ($tryref < 0 && m/^Bug ?\#(\d+)\D/i) { $tryref= $1+0; }
126 { $bfound= &lockreadbugmerge($tryref);
127 if ($bfound) { $ref= $tryref; }
129 { &htmllog("Reply","sent", $replyto,"Unknown problem report number <code>$tryref</code>.");
130 &sendmessage(<<END, '');
131 From: $gMaintainerEmail ($gProject $gBug Tracking System)
133 Subject: Unknown problem report $gBug#$tryref ($subject)
134 Message-ID: <handler.x.$nn.unknown\@$gEmailDomain>
135 In-Reply-To: $header{'message-id'}
136 References: $header{'message-id'} $s_msgid
137 X-$gProject-PR-Message: error
139 You sent a message to the $gBug tracking system which gave (in the
140 Subject line or encoded into the recipient at $gEmailDomain),
141 the number of a nonexistent $gBug report (#$tryref).
143 This may be because that $gBug report has been resolved for more than $gRemoveAge
144 days, and the record of it has been expunged, or because you mistyped
145 the $gBug report number.
147 Your message was dated $header{'date'} and was sent to
148 $baddress\@$gEmailDomain. It had
149 Message-ID $header{'message-id'}
150 and Subject $subject.
152 It has been filed (under junk) but otherwise ignored.
154 Please consult your records to find the correct $gBug report number, or
155 contact me, the system administrator, for assistance.
158 (administrator, $gProject $gBugs database)
160 (NB: If you are a system administrator and have no idea what I am
161 talking about this indicates a serious mail system misconfiguration
162 somewhere. Please contact me immediately.)
168 } else { &filelock('lock/-1'); }
170 if ($codeletter eq 'D' || $codeletter eq 'F')
171 { if ($replyto =~ m/$gBounceFroms/o ||
172 $header{'from'} =~ m/$gBounceFroms/o)
173 { &quit("bounce detected ! Mwaap! Mwaap!"); }
174 $markedby= $header{'from'} eq $replyto ? $replyto :
175 "$header{'from'} (reply to $replyto)";
176 if ($codeletter eq 'F')
177 { (&appendlog,&finish) if length($s_forwarded);
178 $receivedat= "forwarded\@$gEmailDomain";
179 $markaswhat= 'forwarded';
180 $set_forwarded= $header{'to'};
181 if ( length( $gListDomain ) > 0 && length( $gFowardList ) > 0 )
182 { $generalcc= "$gFowardList\@$gListDomain"; }
183 else { $generalcc=''; }
185 { (&appendlog,&finish) if length($s_done);
186 $receivedat= "done\@$gEmailDomain";
188 $set_done= $header{'from'};
189 if ( length( $gListDomain ) > 0 && length( $gDoneList ) > 0 )
190 { $generalcc= "$gDoneList\@$gListDomain"; }
191 else { $generalcc=''; }
194 { &htmllog("Warning","sent",$replyto,"Message ignored.");
195 &sendmessage(<<END, '');
196 From: $gMaintainerEmail ($gProject $gBug Tracking System)
198 Subject: Message with no $gBug number ignored by $receivedat
200 Message-ID: <header.x.$nn.warnignore\@$gEmailDomain>
201 In-Reply-To: $header{'message-id'}
202 References: $header{'message-id'} $s_msgid
203 X-$gProject-PR-Message: error
205 You sent a message to the $gProject $gBug tracking system old-style
206 unified mark as $markaswhat address ($receivedat),
207 without a recognisable $gBug number in the Subject.
208 Your message has been filed under junk but otherwise ignored.
210 If you don't know what I'm talking about then probably either:
212 (a) you unwittingly sent a message to done\@$gEmailDomain
213 because you replied to all recipients of the message a developer used
214 to mark a $gBug as done and you modified the Subject. In this case,
215 please do not be alarmed. To avoid confusion do not do it again, but
216 there is no need to apologise or mail anyone asking for an explanation.
218 (b) you are a system administrator, reading this because the $gBug
219 tracking system is responding to a misdirected bounce message. In this
220 case there is a serious mail system misconfiguration somewhere - please
221 contact me immediately.
223 Your message was dated $header{'date'} and had
224 message-id $header{'message-id'}
225 and subject $subject.
227 If you need any assistance or explanation please contact me.
230 (administrator, $gProject $gBugs database)
237 $noticeccval.= join(', ', grep($_ ne $replyto,@maintaddrs));
238 $noticeccval =~ s/\s+\n\s+/ /g; $noticeccval =~ s/^\s+/ /; $noticeccval =~ s/\s+$//;
239 if (length($noticeccval)) { $noticecc= "Cc: $noticeccval\n"; }
240 if (length($generalcc)) { $noticecc.= "Bcc: $generalcc\n"; }
241 @process= ($ref,split(/ /,$s_mergedwith));
244 { if ($ref != $orgref)
246 &lockreadbug($ref) || die "huh ? $ref from $orgref out of @process";
248 $s_done= $set_done if defined($set_done);
249 $s_forwarded= $set_forwarded if defined($set_forwarded);
250 &overwrite("db/$ref.status",
251 "$s_originator\n$s_date\n$s_subject\n$s_msgid\n".
252 "$s_package\n$s_keywords\n$s_done\n$s_forwarded\n$s_mergedwith\n$s_severity\n");
253 open(O,"db/$ref.report") || &quit("read original report: $!");
254 $x= join('',<O>); close(O);
255 if ($codeletter eq 'F')
256 { &htmllog("Reply","sent",$replyto,"You have marked $gBug as forwarded.");
257 &sendmessage(<<END.$x, '');
258 From: $gMaintainerEmail ($gProject $gBug Tracking System)
260 ${noticecc}Subject: $gBug#$ref: marked as forwarded ($s_subject)
261 Message-ID: <header.$ref.$nn.ackfwdd\@$gEmailDomain>
262 In-Reply-To: $header{'message-id'}
263 References: $header{'message-id'} $s_msgid
264 X-$gProject-PR-Message: forwarded $ref
266 Your message dated $header{'date'}
267 with message-id $header{'message-id'}
268 and subject line $subject
269 has caused the $gProject $gBug report #$ref,
271 to be marked as having been forwarded to the upstream software
272 author(s) $s_forwarded.
274 (NB: If you are a system administrator and have no idea what I am
275 talking about this indicates a serious mail system misconfiguration
276 somewhere. Please contact me immediately.)
279 (administrator, $gProject $gBugs database)
283 { &htmllog("Reply","sent",$replyto,"You have taken responsibility.");
284 &sendmessage(<<END.$x, '');
285 From: $gMaintainerEmail ($gProject $gBug Tracking System)
287 ${noticecc}Subject: $gBug#$ref: marked as done ($s_subject)
288 Message-ID: <handler.$ref.$nn.ackdone\@$gEmailDomain>
289 In-Reply-To: $header{'message-id'}
290 References: $header{'message-id'} $s_msgid
291 X-$gProject-PR-Message: closed $ref
293 Your message dated $header{'date'}
294 with message-id $header{'message-id'}
295 and subject line $subject
296 has caused the attached $gBug report to be marked as done.
298 This means that you claim that the problem has been dealt with.
299 If this is not the case it is now your responsibility to reopen the
300 $gBug report if necessary, and/or fix the problem forthwith.
302 (NB: If you are a system administrator and have no idea what I am
303 talking about this indicates a serious mail system misconfiguration
304 somewhere. Please contact me immediately.)
307 (administrator, $gProject $gBugs database)
310 &htmllog("Notification","sent",$s_originator,
311 "$gBug acknowledged by developer.");
312 &sendmessage(<<END.join("\n",@msg),'');
313 From: $gMaintainerEmail ($gProject $gBug Tracking System)
315 Subject: $gBug#$ref acknowledged by developer ($s_subject)
316 Message-ID: <handler.$ref.$nn.notifdone\@$gEmailDomain>
317 In-Reply-To: $s_msgid
318 References: $header{'message-id'} $s_msgid
319 X-$gProject-PR-Message: they-closed $ref
321 This is an automatic notification regarding your $gBug report.
323 It has been closed by one of the developers, namely
326 Their explanation is attached below. If this explanation is
327 unsatisfactory and you have not received a better one in a separate
328 message then please contact the developer directly, or email
329 submit\@$gEmailDomain or me.
332 (administrator, $gProject $gBugs database)
342 { if ($codeletter eq 'U')
343 { &htmllog("Warning","sent",$replyto,"Message not forwarded.");
344 &sendmessage(<<END, '');
345 From: $gMaintainerEmail ($gProject $gBug Tracking System)
347 Subject: Message with no $gBug number cannot be sent to submitter !
349 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
350 In-Reply-To: $header{'message-id'}
351 References: $header{'message-id'} $s_msgid
352 X-$gProject-PR-Message: error
354 You sent a message to the $gProject $gBug tracking system send to $gBug
355 report submitter address $baddress\@$gEmailDomain, without a
356 recognisable $gBug number in the Subject. Your message has been filed
357 under junk but otherwise ignored.
359 If you don't know what I'm talking about then probably either:
361 (a) you unwittingly sent a message to $baddress\@$gEmailDomain
362 because you replied to all recipients of the message a developer sent
363 to a $gBug's submitter and you modified the Subject. In this case,
364 please do not be alarmed. To avoid confusion do not do it again, but
365 there is no need to apologise or mail anyone asking for an
368 (b) you are a system administrator, reading this because the $gBug
369 tracking system is responding to a misdirected bounce message. In this
370 case there is a serious mail system misconfiguration somewhere - please
371 contact me immediately.
373 Your message was dated $header{'date'} and had
374 message-id $header{'message-id'}
375 and subject $subject.
377 If you need any assistance or explanation please contact me.
380 (administrator, $gProject $gBugs database)
386 if (!defined($pheader{'package'}))
387 { &htmllog("Warning","sent",$replyto,"Message not forwarded.");
388 &sendmessage(<<END, '');
389 From: $gMaintainerEmail ($gProject $gBug Tracking System)
391 Subject: Message with no Package: tag cannot be processed!
393 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
394 In-Reply-To: $header{'message-id'}
395 References: $header{'message-id'} $s_msgid
396 X-$gProject-PR-Message: error
398 Your message didn't have a Package: line at the start (in the
399 pseudo-header following the real mail header), or didn't have a
400 psuedo-header at all.
402 This makes it much harder for us to categorise and deal with your
403 problem report. Please resubmit your report and tell us which package the
404 report is on. For help, check out http://$gWebDomain/Reporting.html.
406 Your message was dated $header{'date'} and had
407 message-id $header{'message-id'}
408 and subject $subject.
410 If you need any assistance or explanation please contact me.
413 (administrator, $gProject $gBugs database)
419 $s_package= $pheader{'package'};
420 print "Package: $s_package\n";
422 if (defined($pheader{'keywords'})) {
423 $s_keywords= $pheader{'keywords'};
426 if (defined($pheader{'severity'})) {
427 $s_severity= $pheader{'severity'};
428 if (!grep($_ eq $s_severity, @severities, "$gDefaultSeverity")) {
431 Your message specified a Severity: in the psuedo-header, but
432 the severity value $s_severity was not recognised.
433 The default severity $gDefaultSeverity is being used instead.
434 The recognised values are: @showseverities.
439 &filelock("nextnumber.lock");
440 open(N,"nextnumber") || &quit("nextnumber: read: $!");
441 $v=<N>; $v =~ s/\n$// || &quit("nextnumber bad format");
442 $ref= $v+0; $v += 1; $newref=1;
443 &overwrite('nextnumber', "$v\n");
445 &overwrite("db/$ref.log",'');
446 &overwrite("db/$ref.status",
447 "$replyto\n$intdate\n$subject\n$header{'message-id'}\n".
448 "$s_package\n$s_keywords\n\n\n\n$s_severity\n");
449 &overwrite("db/$ref.report",
450 join("\n",@msg)."\n");
455 print DEBUG "maintainers >@maintaddrs<\n";
457 $orgsender= defined($header{'sender'}) ? "Orignal-Sender: $header{'sender'}\n" : '';
458 $newsubject= $subject; $newsubject =~ s/^$gBug#$ref\W*\s*//;
460 $xcchdr= $header{X-Debbugs-CC};
461 if ($xcchdr =~ m/\S/) {
462 push(@resentccs,$xcchdr);
463 $resentccexplain.= <<END;
465 As you requested using X-Debbugs-CC, your message was also forwarded to
467 (after having been given a $gBug report number, if it did not have one).
471 if (@maintaddrs && ($codeletter eq 'B' || $codeletter eq 'M')) {
472 push(@resentccs,@maintaddrs);
473 $resentccexplain.= <<END." ".join("\n ",@maintaddrs)."\n";
475 Your message has been sent to the package maintainer(s):
479 $veryquiet= $codeletter eq 'Q';
480 if ($codeletter eq 'M' && !@maintaddrs) {
484 You requested that the message be sent to the package maintainer(s)
485 but either the $gBug report is not associated with any package (probably
486 because of a missing Package psuedo-header field in the original $gBug
487 report), or the package(s) specified do not have any maintainer(s).
489 Your message has *not* been sent to any package maintainers; it has
490 merely been filed in the $gBug tracking system. If you require assistance
491 please contact $gMaintainerEmail quoting the $gBug number $ref.
495 $resentccval.= join(', ',@resentccs);
496 $resentccval =~ s/\s+\n\s+/ /g; $resentccval =~ s/^\s+/ /; $resentccval =~ s/\s+$//;
497 if (length($resentccval)) { $resentcc= "Resent-CC: $resentccval\n"; }
499 if ($codeletter eq 'U') {
500 &htmllog("Message", "sent on", $s_originator, "$gBug#$ref.");
501 &sendmessage(<<END,$s_originator,@resentccs);
502 Subject: $gBug#$ref: $newsubject
503 Reply-To: $replyto, $ref-quiet\@$gEmailDomain
504 ${orgsender}Resent-To: $s_originator
505 ${resentcc}Resent-Date: $tdate
506 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
507 Resent-Sender: $gMaintainerEmail
508 X-$gProject-PR-Message: report $ref
509 X-$gProject-PR-Package: $s_package
510 X-$gProject-PR-Keywords: $s_keywords
513 } elsif ($codeletter eq 'B') {
514 &htmllog($newref ? "Report" : "Information", "forwarded",
515 join(', ',"$gSubmitList\@$gListDomain",@resentccs),
516 "<code>$gBug#$ref</code>".
517 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
518 (length($s_keywords)? "; Keywords <code>".&sani($s_keywords)."</code>":'').
520 &sendmessage(<<END,"$gSubmitList\@$gListDomain",@resentccs);
521 Subject: $gBug#$ref: $newsubject
522 Reply-To: $replyto, $ref\@$gEmailDomain
523 Resent-From: $header{'from'}
524 ${orgsender}Resent-To: $gSubmitList\@$gListDomain
525 ${resentcc}Resent-Date: $tdate
526 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
527 Resent-Sender: $gMaintainerEmail
528 X-$gProject-PR-Message: report $ref
529 X-$gProject-PR-Package: $s_package
530 X-$gProject-PR-Keywords: $s_keywords
533 } elsif (@resentccs) {
534 # D and F done far earlier; B just done - so this must be M or Q
535 # We preserve whichever it was in the Reply-To (possibly adding
537 &htmllog($newref ? "Report" : "Information", "forwarded",
539 "<code>$gBug#$ref</code>".
540 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
541 (length($s_keywords)? "; Keywords <code>".&sani($s_keywords)."</code>":'').
543 &sendmessage(<<END,@resentccs);
544 Subject: $gBug#$ref: $newsubject
545 Reply-To: $replyto, $ref-$baddressroot\@$gEmailDomain
546 Resent-From: $header{'from'}
547 ${orgsender}Resent-To: $resentccval
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
553 X-$gProject-PR-Keywords: $s_keywords
558 $htmlbreak= length($brokenness) ? "<p>\n".&sani($brokenness)."\n<p>\n" : '';
559 $htmlbreak =~ s/\n\n/\n<P>\n\n/g;
560 if (length($resentccval)) {
562 " Copy sent to <code>".&sani($resentccval)."</code>.".
566 &htmllog("Acknowledgement","sent",$replyto,
568 "New $gBug report received and filed, but not forwarded." :
569 "New $gBug report received and forwarded."). $htmlbreak);
570 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
571 From: $gMaintainerEmail ($gProject $gBug Tracking System)
573 Subject: $gBug#$ref: Acknowledgement of QUIET report
575 Message-ID: <handler.$ref.$nn.ackquiet\@$gEmailDomain>
576 In-Reply-To: $header{'message-id'}
577 References: $header{'message-id'}
578 X-$gProject-PR-Message: ack-quiet $ref
580 Thank you for the problem report you have sent regarding $gProject.
581 This is an automatically generated reply, to let you know your message
582 has been received. It has not been forwarded to the developers or
583 their mailing list; you should ensure that the developers are aware of
584 the problem you have entered into the system - preferably quoting the
585 $gBug reference number, #$ref.
587 If you wish to submit further information on your problem, please send it
588 to $ref-$baddressroot\@$gEmailDomain (and *not*
589 to $baddress\@$gEmailDomain).
591 Please do not reply to the address at the top of this message,
592 unless you wish to report a problem with the $gBug-tracking system.
595 (administrator, $gProject $gBugs database)
597 From: $gMaintainerEmail ($gProject $gBug Tracking System)
599 Subject: $gBug#$ref: Acknowledgement of maintainer-only report
601 Message-ID: <handler.$ref.$nn.ackmaint\@$gEmailDomain>
602 In-Reply-To: $header{'message-id'}
603 References: $header{'message-id'}
604 X-$gProject-PR-Message: ack-maintonly $ref
606 Thank you for the problem report you have sent regarding $gProject.
607 This is an automatically generated reply, to let you know your message has
608 been received. It is being forwarded to the developers (but not the mailing
609 list, as you requested) for their attention; they will reply in due course.
611 If you wish to submit further information on your problem, please send
612 it to $ref-$baddressroot\@$gEmailDomain (and *not*
613 to $baddress\@$gEmailDomain).
615 Please do not reply to the address at the top of this message,
616 unless you wish to report a problem with the $gBug-tracking system.
619 (administrator, $gProject $gBugs database)
621 From: $gMaintainerEmail ($gProject $gBug Tracking System)
623 Subject: $gBug#$ref: Acknowledgement ($subject)
624 Message-ID: <handler.$ref.$nn.ack\@$gEmailDomain>
625 In-Reply-To: $header{'message-id'}
626 References: $header{'message-id'}
627 X-$gProject-PR-Message: ack $ref
629 Thank you for the problem report you have sent regarding $gProject.
630 This is an automatically generated reply, to let you know your message has
631 been received. It is being forwarded to the developers mailing list for
632 their attention; they will reply in due course.
634 If you wish to submit further information on your problem, please send
635 it to $ref\@$gEmailDomain (and *not* to
636 $baddress\@$gEmailDomain).
638 Please do not reply to the address at the top of this message,
639 unless you wish to report a problem with the $gBug-tracking system.
642 (administrator, $gProject $gBugs database)
644 } elsif ($codeletter ne 'U') {
645 &htmllog("Acknowledgement","sent",$replyto,
646 ($veryquiet ? "Extra info received and filed, but not forwarded." :
647 $codeletter eq 'M' ? "Extra info received and forwarded to maintainer." :
648 "Extra info received and forwarded to list."). $htmlbreak);
649 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
650 From: $gMaintainerEmail ($gProject $gBug Tracking System)
652 Subject: $gBug#$ref: Info received and FILED only
654 Message-ID: <handler.$ref.$nn.ackinfoquiet\@$gEmailDomain>
655 In-Reply-To: $header{'message-id'}
656 References: $header{'message-id'}
657 X-$gProject-PR-Message: ack-info-quiet $ref
659 Thank you for the additional information you have supplied regarding
660 this problem report. It has NOT been forwarded to the developers, but
661 will accompany the original report in the $gBug tracking system. Please
662 ensure that you yourself have sent a copy of the additional
663 information to any relevant developers or mailing lists.
665 If you wish to continue to submit further information on your problem,
666 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
668 Please do not reply to the address at the top of this message,
669 unless you wish to report a problem with the $gBug-tracking system.
672 (administrator, $gProject $gBugs database)
674 From: $gMaintainerEmail ($gProject $gBug Tracking System)
676 Subject: $gBug#$ref: Info received for maintainer only
678 Message-ID: <handler.$ref.$nn.ackinfomaint\@$gEmailDomain>
679 In-Reply-To: $header{'message-id'}
680 References: $header{'message-id'}
681 X-$gProject-PR-Message: ack-info $ref
683 Thank you for the additional information you have supplied regarding
684 this problem report. It has been forwarded to the developer(s) (but
685 not to the mailing list) to accompany the original report.
687 If you wish to continue to submit further information on your problem,
688 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
690 Please do not reply to the address at the top of this message,
691 unless you wish to report a problem with the $gBug-tracking system.
694 (administrator, $gProject $gBugs database)
696 From: $gMaintainerEmail ($gProject $gBug Tracking System)
698 Subject: $gBug#$ref: Info received (was $subject)
699 Message-ID: <handler.$ref.$nn.ackinfo\@$gEmailDomain>
700 In-Reply-To: $header{'message-id'}
701 References: $header{'message-id'}
702 X-$gProject-PR-Message: ack-info-maintonly $ref
704 Thank you for the additional information you have supplied regarding
705 this problem report. It has been forwarded to the developer(s) and
706 to the developers mailing list to accompany the original report.
708 If you wish to continue to submit further information on your problem,
709 please send it to $ref\@$gEmailDomain, as before.
711 Please do not reply to the address at the top of this message,
712 unless you wish to report a problem with the $gBug-tracking system.
715 (administrator, $gProject $gBugs database)
724 open(NEW,">$f.new") || &quit("$f.new: create: $!");
725 print(NEW "$v") || &quit("$f.new: write: $!");
726 close(NEW) || &quit("$f.new: close: $!");
727 rename("$f.new","$f") || &quit("rename $f.new to $f: $!");
731 if (!open(AP,">>db/$ref.log")) {
732 print DEBUG "failed open log<\n";
733 print DEBUG "failed open log err $!<\n";
734 &quit("opening db/$ref.log (li): $!");
736 print(AP "\7\n",@log,"\n\3\n") || &quit("writing db/$ref.log (li): $!");
737 close(AP) || &quit("closing db/$ref.log (li): $!");
741 utime(time,time,"db");
743 while ($u= $cleanups[$#cleanups]) { &$u; }
744 unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
748 &quit("wot no exit");
750 sub chldhandle { $chldexit = 'yes'; }
753 local ($whatobj,$whatverb,$where,$desc) = @_;
754 open(AP,">>db/$ref.log") || &quit("opening db/$ref.log (lh): $!");
757 "<strong>$whatobj $whatverb</strong> to <code>".&sani($where).
758 "</code>:<br>\n". $desc.
759 "\n\3\n") || &quit("writing db/$ref.log (lh): $!");
760 close(AP) || &quit("closing db/$ref.log (lh): $!");
765 map { $_->address() }
766 map { Mail::Address->parse($_) } @_;
771 local ($msg,@recips) = @_;
772 if ($recips[0] eq '' && $#recips == 0) { @recips= ('-t'); }
773 open(AP,">>db/$ref.log") || &quit("opening db/$ref.log (lo): $!");
774 print(AP "\2\n",join("\4",@recips),"\n\5\n$msg\n\3\n") ||
775 &quit("writing db/$ref.log (lo): $!");
776 close(AP) || &quit("closing db/$ref.log (lo): $!");
778 print DEBUG "mailing to >",join('|',@recips),"<\n";
779 $SIG{'CHLD'}='chldhandle';
780 #print DEBUG "mailing sigchild set up<\n";
783 #print DEBUG "mailing opened pipe fork<\n";
784 defined($c) || die $!;
785 #print DEBUG "mailing opened pipe fork ok $c<\n";
786 if (!$c) { # ie, we are in the child process
787 #print DEBUG "mailing child<\n";
788 unless (open(STDERR,">&STDOUT")) {
789 #print DEBUG "mailing child opened stderr<\n";
790 print STDOUT "redirect stderr: $!\n";
791 #print DEBUG "mailing child opened stderr fail<\n";
793 #print DEBUG "mailing child opened stderr fail exit !?<\n";
795 #print DEBUG "mailing child opened stderr ok<\n";
797 #print DEBUG "mailing child forked again<\n";
798 defined($c) || die $!;
799 #print DEBUG "mailing child forked again ok $c<\n";
800 if (!$c) { # ie, we are the child process
801 #print DEBUG "mailing grandchild<\n";
802 exec '/usr/lib/sendmail','-f'."$gMaintainerEmail",'-odi','-oem','-oi',get_addresses(@recips);
803 #print DEBUG "mailing grandchild exec failed<\n";
805 #print DEBUG "mailing grandchild died !?<\n";
807 #print DEBUG "mailing child not grandchild<\n";
808 print(D $msg) || die $!;
809 #print DEBUG "mailing child printed msg<\n";
811 #print DEBUG "mailing child closed pipe<\n";
812 die "\n*** command returned exit status $?\n" if $?;
813 #print DEBUG "mailing child exit status ok<\n";
815 #print DEBUG "mailing child exited ?!<\n";
817 #print DEBUG "mailing parent<\n";
819 #print DEBUG "mailing parent results emptied<\n";
820 while( $chldexit eq 'no' ) { $results.= $_; }
821 #print DEBUG "mailing parent results read >$results<\n";
823 #print DEBUG "mailing parent results closed<\n";
824 $results.= "\n*** child returned exit status $?\n" if $?;
825 #print DEBUG "mailing parent exit status ok<\n";
826 $SIG{'CHLD'}='DEFAULT';
827 #print DEBUG "mailing parent sigchild default<\n";
828 if (length($results)) { &quit("running sendmail: $results"); }
829 #print DEBUG "mailing parent results ok<\n";
832 sub checkmaintainers {
833 return if $maintainerschecked++;
834 return if !length($s_package);
835 open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
837 m/^(\S+)\s+(\S.*\S)\n$/ || &quit("maintainers bogus \`$_'");
838 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
839 $maintainerof{$1}= $2;
842 $anymaintfound=0; $anymaintnotfound=0;
843 for $p (split(m/[ \t?,()]+/,$s_package)) {
845 if (defined($maintainerof{$p})) {
846 print DEBUG "maintainer add >$p|$maintainerof{$p}<\n";
847 $addmaint= $maintainerof{$p};
848 push(@maintaddrs,$addmaint) unless
849 $addmaint eq $replyto || grep($_ eq $addmaint, @maintaddrs);
852 print DEBUG "maintainer none >$p<\n";