2 # $Id: process.in,v 1.65 2003/04/24 02:24:55 cjwatson Exp $
10 $config_path = '/etc/debbugs';
11 $lib_path = '/usr/lib/debbugs';
13 require "$config_path/config";
14 require "$lib_path/errorlib";
15 $ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'};
17 chdir( "$gSpoolDir" ) || die "chdir spool: $!\n";
19 #open(DEBUG,"> /tmp/debbugs.debug");
21 open DEBUG, ">/dev/null";
23 defined( $intdate= time ) || &quit( "failed to get time: $!" );
26 m/^([BMQFDU])(\d*)\.\d+$/ || &quit("bad argument");
28 $tryref= length($2) ? $2+0 : -1;
31 if (!rename("incoming/G$nn","incoming/P$nn"))
33 $_=$!.''; m/no such file or directory/i && exit 0;
34 &quit("renaming to lock: $!");
37 $baddress= 'submit' if $codeletter eq 'B';
38 $baddress= 'maintonly' if $codeletter eq 'M';
39 $baddress= 'quiet' if $codeletter eq 'Q';
40 $baddress= 'forwarded' if $codeletter eq 'F';
41 $baddress= 'done' if $codeletter eq 'D';
42 $baddress= 'submitter' if $codeletter eq 'U';
43 $baddress || &quit("bad codeletter $codeletter");
44 $baddressroot= $baddress;
45 $baddress= "$tryref-$baddress" if $tryref>=0;
47 open(M,"incoming/P$nn");
54 print DEBUG "###\n",join("##\n",@msg),"\n###\n";
56 chop($tdate= `date -u '+%a, %d %h %Y %T GMT'`);
58 Received: via spool by $baddress\@$gEmailDomain id=$nn
59 (code $codeletter ref $tryref); $tdate
62 # header and decoded body respectively
63 my (@headerlines, @bodylines);
65 my $parser = new MIME::Parser;
66 mkdir "$gSpoolDir/mime.tmp", 0777;
67 $parser->output_under("$gSpoolDir/mime.tmp");
68 my $entity = eval { $parser->parse_data(join('',@log)) };
70 if ($entity and $entity->head->tags) {
71 @headerlines = @{$entity->head->header};
74 my $entity_body = getmailbody($entity);
75 @bodylines = $entity_body ? $entity_body->as_lines() : ();
78 # set $i to beginning of encoded body data, so we can dump it out
81 ++$i while $msg[$i] =~ /./;
83 # Legacy pre-MIME code, kept around in case MIME::Parser fails.
84 for ($i = 0; $i <= $#msg; $i++) {
86 last unless length($_);
87 while ($msg[$i+1] =~ m/^\s/) {
91 push @headerlines, $_;
94 @bodylines = @msg[$i..$#msg];
97 for my $hdr (@headerlines) {
100 &finish if m/^x-loop: (\S+)$/i && $1 eq "$gMaintainerEmail";
101 my $ins = !m/^subject:/i && !m/^reply-to:/i && !m/^return-path:/i
102 && !m/^From / && !m/^X-Debbugs-CC:/i;
103 $fwd .= $hdr."\n" if $ins;
104 # print DEBUG ">$_<\n";
105 if (s/^(\S+):\s*//) {
107 print DEBUG ">$v=$_<\n";
110 print DEBUG "!>$_<\n";
115 shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;
117 # Strip off RFC2440-style PGP clearsigning.
118 if (@bodylines and $bodylines[0] =~ /^-----BEGIN PGP SIGNED/) {
119 shift @bodylines while @bodylines and length $bodylines[0];
120 shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;
121 for my $findsig (0 .. $#bodylines) {
122 if ($bodylines[$findsig] =~ /^-----BEGIN PGP SIGNATURE/) {
123 $#bodylines = $findsig - 1;
127 map { s/^- // } @bodylines;
130 # extract pseudo-headers
131 for my $phline (@bodylines)
133 last if $phline !~ m/^([\w]+):\s*(\S.*)/;
134 my ($fn, $fv) = ($1, $2);
135 print DEBUG ">$fn|$fv|\n";
139 print DEBUG ">$fn~$fv<\n";
143 $fwd .= join("\n",@msg[$i..$#msg]);
145 print DEBUG "***\n$fwd\n***\n";
147 if (defined $header{'resent-from'} && !defined $header{'from'}) {
148 $header{'from'} = $header{'resent-from'};
150 defined($header{'from'}) || &quit("no From header");
151 $replyto= defined($header{'reply-to'}) ? $header{'reply-to'} : $header{'from'};
154 $_= "$2 <$1>" if m/^([^\<\> \t\n\(\)]+) \(([^\(\)\<\>]+)\)$/;
156 print DEBUG "replytocompare >$replytocompare<\n";
158 if (!defined($header{'subject'}))
162 Your message did not contain a Subject field. They are recommended and
163 useful because the title of a $gBug is determined using this field.
164 Please remember to include a Subject field in your messages in future.
167 # RFC822 actually lists it as an `optional-field'.
169 $subject= '(no subject)';
171 $subject= $header{'subject'};
175 $subject =~ s/^Re:\s*//i; $_= $subject."\n";
176 if ($tryref < 0 && m/^Bug ?\#(\d+)\D/i) {
182 $bfound= &lockreadbugmerge($tryref);
186 &htmllog("Reply","sent", $replyto,"Unknown problem report number <code>$tryref</code>.");
187 &sendmessage(<<END, '');
188 From: $gMaintainerEmail ($gProject $gBug Tracking System)
190 Subject: Unknown problem report $gBug#$tryref ($subject)
191 Message-ID: <handler.x.$nn.unknown\@$gEmailDomain>
192 In-Reply-To: $header{'message-id'}
193 References: $header{'message-id'} $s_msgid
195 X-$gProject-PR-Message: error
197 You sent a message to the $gBug tracking system which gave (in the
198 Subject line or encoded into the recipient at $gEmailDomain),
199 the number of a nonexistent $gBug report (#$tryref).
201 This may be because that $gBug report has been resolved for more than $gRemoveAge
202 days, and the record of it has been expunged, or because you mistyped
203 the $gBug report number.
205 Your message was dated $header{'date'} and was sent to
206 $baddress\@$gEmailDomain. It had
207 Message-ID $header{'message-id'}
208 and Subject $subject.
210 It has been filed (under junk) but otherwise ignored.
212 Please consult your records to find the correct $gBug report number, or
213 contact me, the system administrator, for assistance.
216 (administrator, $gProject $gBugs database)
218 (NB: If you are a system administrator and have no idea what I am
219 talking about this indicates a serious mail system misconfiguration
220 somewhere. Please contact me immediately.)
227 &filelock('lock/-1');
230 if ($codeletter eq 'D' || $codeletter eq 'F')
232 if ($replyto =~ m/$gBounceFroms/o ||
233 $header{'from'} =~ m/$gBounceFroms/o)
235 &quit("bounce detected ! Mwaap! Mwaap!");
237 $markedby= $header{'from'} eq $replyto ? $replyto :
238 "$header{'from'} (reply to $replyto)";
239 if ($codeletter eq 'F') {
240 (&appendlog,&finish) if length($s_forwarded);
241 $receivedat= "forwarded\@$gEmailDomain";
242 $markaswhat= 'forwarded';
243 $set_forwarded= $header{'to'};
244 if ( length( $gListDomain ) > 0 && length( $gFowardList ) > 0 ) {
245 $generalcc= "$gFowardList\@$gListDomain";
250 (&appendlog,&finish) if length($s_done);
251 $receivedat= "done\@$gEmailDomain";
253 $set_done= $header{'from'};
254 if ( length( $gListDomain ) > 0 && length( $gDoneList ) > 0 ) {
255 $generalcc= "$gDoneList\@$gListDomain";
261 &htmllog("Warning","sent",$replyto,"Message ignored.");
262 &sendmessage(<<END, '');
263 From: $gMaintainerEmail ($gProject $gBug Tracking System)
265 Subject: Message with no $gBug number ignored by $receivedat
267 Message-ID: <header.x.$nn.warnignore\@$gEmailDomain>
268 In-Reply-To: $header{'message-id'}
269 References: $header{'message-id'} $s_msgid
271 X-$gProject-PR-Message: error
273 You sent a message to the $gProject $gBug tracking system old-style
274 unified mark as $markaswhat address ($receivedat),
275 without a recognisable $gBug number in the Subject.
276 Your message has been filed under junk but otherwise ignored.
278 If you don't know what I'm talking about then probably either:
280 (a) you unwittingly sent a message to done\@$gEmailDomain
281 because you replied to all recipients of the message a developer used
282 to mark a $gBug as done and you modified the Subject. In this case,
283 please do not be alarmed. To avoid confusion do not do it again, but
284 there is no need to apologise or mail anyone asking for an explanation.
286 (b) you are a system administrator, reading this because the $gBug
287 tracking system is responding to a misdirected bounce message. In this
288 case there is a serious mail system misconfiguration somewhere - please
289 contact me immediately.
291 Your message was dated $header{'date'} and had
292 message-id $header{'message-id'}
293 and subject $subject.
295 If you need any assistance or explanation please contact me.
298 (administrator, $gProject $gBugs database)
307 $noticeccval.= join(', ', grep($_ ne $replyto,@maintaddrs,@addsrcaddrs));
308 $noticeccval =~ s/\s+\n\s+/ /g;
309 $noticeccval =~ s/^\s+/ /; $noticeccval =~ s/\s+$//;
311 if (length($noticeccval)) { $noticecc= "Cc: $noticeccval\n"; }
312 if (length($generalcc)) { $noticecc.= "Bcc: $generalcc\n"; }
314 @process= ($ref,split(/ /,$s_mergedwith));
317 for $ref (@process) {
318 if ($ref != $orgref) {
320 &lockreadbug($ref) || die "huh ? $ref from $orgref out of @process";
322 $s_done= $set_done if defined($set_done);
323 $s_forwarded= $set_forwarded if defined($set_forwarded);
324 my $hash = get_hashname($ref);
325 &overwrite("db-h/$hash/$ref.status",
326 "$s_originator\n$s_date\n$s_subject\n$s_msgid\n".
327 "$s_package\n$s_keywords\n$s_done\n$s_forwarded\n$s_mergedwith\n$s_severity\n");
328 &bughook('change',$ref,
329 "$s_originator\n$s_date\n$s_subject\n$s_msgid\n".
330 "$s_package\n$s_keywords\n$s_done\n$s_forwarded\n$s_mergedwith\n$s_severity\n");
332 open(O,"db-h/$hash/$ref.report") || &quit("read original report: $!");
333 $x= join('',<O>); close(O);
334 if ($codeletter eq 'F') {
335 &htmllog("Reply","sent",$replyto,"You have marked $gBug as forwarded.");
336 &sendmessage(<<END."---------------------------------------\n".join( "\n", @msg ), '');
337 From: $gMaintainerEmail ($gProject $gBug Tracking System)
339 ${noticecc}Subject: $gBug#$ref: marked as forwarded ($s_subject)
340 Message-ID: <header.$ref.$nn.ackfwdd\@$gEmailDomain>
341 In-Reply-To: $header{'message-id'}
342 References: $header{'message-id'} $s_msgid
344 X-$gProject-PR-Message: forwarded $ref
345 X-$gProject-PR-Package: $s_package
346 X-$gProject-PR-Keywords: $s_keywords
348 Your message dated $header{'date'}
349 with message-id $header{'message-id'}
350 has caused the $gProject $gBug report #$ref,
352 to be marked as having been forwarded to the upstream software
353 author(s) $s_forwarded.
355 (NB: If you are a system administrator and have no idea what I am
356 talking about this indicates a serious mail system misconfiguration
357 somewhere. Please contact me immediately.)
360 (administrator, $gProject $gBugs database)
365 &htmllog("Reply","sent",$replyto,"You have taken responsibility.");
366 &sendmessage(<<END."--------------------------------------\n".$x."---------------------------------------\n".join( "\n", @msg ), '');
367 From: $gMaintainerEmail ($gProject $gBug Tracking System)
369 ${noticecc}Subject: $gBug#$ref: marked as done ($s_subject)
370 Message-ID: <handler.$ref.$nn.ackdone\@$gEmailDomain>
371 In-Reply-To: $header{'message-id'}
372 References: $header{'message-id'} $s_msgid
374 X-$gProject-PR-Message: closed $ref
375 X-$gProject-PR-Package: $s_package
376 X-$gProject-PR-Keywords: $s_keywords
378 Your message dated $header{'date'}
379 with message-id $header{'message-id'}
380 and subject line $subject
381 has caused the attached $gBug report to be marked as done.
383 This means that you claim that the problem has been dealt with.
384 If this is not the case it is now your responsibility to reopen the
385 $gBug report if necessary, and/or fix the problem forthwith.
387 (NB: If you are a system administrator and have no idea what I am
388 talking about this indicates a serious mail system misconfiguration
389 somewhere. Please contact me immediately.)
392 (administrator, $gProject $gBugs database)
395 &htmllog("Notification","sent",$s_originator,
396 "$gBug acknowledged by developer.");
397 &sendmessage(<<END.join("\n",@msg),'');
398 From: $gMaintainerEmail ($gProject $gBug Tracking System)
400 Subject: $gBug#$ref acknowledged by developer
402 Message-ID: <handler.$ref.$nn.notifdone\@$gEmailDomain>
403 In-Reply-To: $s_msgid
404 References: $header{'message-id'} $s_msgid
405 X-$gProject-PR-Message: they-closed $ref
406 X-$gProject-PR-Package: $s_package
407 X-$gProject-PR-Keywords: $s_keywords
408 Reply-To: $ref\@$gEmailDomain
410 This is an automatic notification regarding your $gBug report
412 which was filed against the $s_package package.
414 It has been closed by one of the developers, namely
417 Their explanation is attached below. If this explanation is
418 unsatisfactory and you have not received a better one in a separate
419 message then please contact the developer, by replying to this email.
422 (administrator, $gProject $gBugs database)
432 if ($codeletter eq 'U') {
433 &htmllog("Warning","sent",$replyto,"Message not forwarded.");
434 &sendmessage(<<END, '');
435 From: $gMaintainerEmail ($gProject $gBug Tracking System)
437 Subject: Message with no $gBug number cannot be sent to submitter !
439 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
440 In-Reply-To: $header{'message-id'}
441 References: $header{'message-id'} $s_msgid
443 X-$gProject-PR-Message: error
445 You sent a message to the $gProject $gBug tracking system send to $gBug
446 report submitter address $baddress\@$gEmailDomain, without a
447 recognisable $gBug number in the Subject. Your message has been filed
448 under junk but otherwise ignored.
450 If you don't know what I'm talking about then probably either:
452 (a) you unwittingly sent a message to $baddress\@$gEmailDomain
453 because you replied to all recipients of the message a developer sent
454 to a $gBug's submitter and you modified the Subject. In this case,
455 please do not be alarmed. To avoid confusion do not do it again, but
456 there is no need to apologise or mail anyone asking for an
459 (b) you are a system administrator, reading this because the $gBug
460 tracking system is responding to a misdirected bounce message. In this
461 case there is a serious mail system misconfiguration somewhere - please
462 contact me immediately.
464 Your message was dated $header{'date'} and had
465 message-id $header{'message-id'}
466 and subject $subject.
468 If you need any assistance or explanation please contact me.
471 (administrator, $gProject $gBugs database)
477 if (!defined($pheader{'package'})) {
478 &htmllog("Warning","sent",$replyto,"Message not forwarded.");
479 &sendmessage(<<END."---------------------------------------------------------------------------\n".join("\n", @msg), '');
480 From: $gMaintainerEmail ($gProject $gBug Tracking System)
482 Subject: Message with no Package: tag cannot be processed!
484 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
485 In-Reply-To: $header{'message-id'}
486 References: $header{'message-id'} $s_msgid
488 X-$gProject-PR-Message: error
490 Your message didn't have a Package: line at the start (in the
491 pseudo-header following the real mail header), or didn't have a
492 pseudo-header at all.
494 This makes it much harder for us to categorise and deal with your
495 problem report. Please _resubmit_ your report to $baddress\@$gEmailDomain
496 and tell us which package the report is on. For help, check out
497 http://$gWebDomain/Reporting$gHTMLSuffix.
499 Your message was dated $header{'date'} and had
500 message-id $header{'message-id'}
501 and subject $subject.
502 The complete text of it is attached to this message.
504 If you need any assistance or explanation please contact me.
507 (administrator, $gProject $gBugs database)
513 $s_package= $pheader{'package'};
517 if (defined($pheader{'version'})) {
518 $s_versions = $pheader{'version'};
519 $s_versions =~ s/\s+/ /;
520 # BUG: need to bounce unknown versions back to submitter here
523 $s_fixed_versions= '';
524 if (defined($pheader{'fixed-in-version'})) {
525 $s_fixed_versions = $pheader{'fixed-in-version'};
526 $s_fixed_versions =~ s/\s+/ /;
530 if (defined($pheader{'keywords'})) {
531 $s_keywords= $pheader{'keywords'};
532 } elsif (defined($pheader{'tags'})) {
533 $s_keywords= $pheader{'tags'};
535 if (length($s_keywords)) {
537 my %gkws = map { ($_, 1) } @gTags;
538 foreach my $kw (sort split(/[,\s]+/, lc($s_keywords))) {
539 push @kws, $kw if (defined $gkws{$kw});
541 $s_keywords = join(" ", @kws);
544 if (defined($pheader{'severity'}) || defined($pheader{'priority'})) {
545 $s_severity= $pheader{'severity'};
546 $s_severity= $pheader{'priority'} unless ($s_severity);
547 $s_severity =~ s/^\s*(.+)\s*$/$1/;
549 if (!grep($_ eq $s_severity, @severities, "$gDefaultSeverity")) {
552 Your message specified a Severity: in the pseudo-header, but
553 the severity value $s_severity was not recognised.
554 The default severity $gDefaultSeverity is being used instead.
555 The recognised values are: $gShowSeverities.
557 # if we use @gSeverityList array in the above line, perl -c gives:
558 # In string, @gSeverityList now must be written as \@gSeverityList at
559 # process line 452, near "$gDefaultSeverity is being used instead.
563 &filelock("nextnumber.lock");
564 open(N,"nextnumber") || &quit("nextnumber: read: $!");
565 $v=<N>; $v =~ s/\n$// || &quit("nextnumber bad format");
566 $ref= $v+0; $v += 1; $newref=1;
567 &overwrite('nextnumber', "$v\n");
569 my $hash = get_hashname($ref);
570 &overwrite("db-h/$hash/$ref.log",'');
571 &overwrite("db-h/$hash/$ref.status",
572 "$replyto\n$intdate\n$subject\n$header{'message-id'}\n".
573 "$s_package\n$s_keywords\n\n\n\n$s_severity\n$s_versions\n".
574 "$s_fixed_versions\n");
576 "$replyto\n$intdate\n$subject\n$header{'message-id'}\n".
577 "$s_package\n$s_keywords\n\n\n\n$s_severity\n$s_versions\n".
578 "$s_fixed_versions\n");
579 &overwrite("db-h/$hash/$ref.report",
580 join("\n",@msg)."\n");
585 print DEBUG "maintainers >@maintaddrs<\n";
587 $orgsender= defined($header{'sender'}) ? "Original-Sender: $header{'sender'}\n" : '';
588 $newsubject= $subject; $newsubject =~ s/^$gBug#$ref:*\s*//;
590 $xcchdr= $header{ 'x-debbugs-cc' };
591 if ($xcchdr =~ m/\S/) {
592 push(@resentccs,$xcchdr);
593 $resentccexplain.= <<END;
595 As you requested using X-Debbugs-CC, your message was also forwarded to
597 (after having been given a $gBug report number, if it did not have one).
601 if (@maintaddrs && ($codeletter eq 'B' || $codeletter eq 'M')) {
602 push(@resentccs,@maintaddrs);
603 $resentccexplain.= <<END." ".join("\n ",@maintaddrs)."\n";
605 Your message has been sent to the package maintainer(s):
609 push(@resentccs, @addsrcaddrs);
611 $veryquiet= $codeletter eq 'Q';
612 if ($codeletter eq 'M' && !@maintaddrs) {
616 You requested that the message be sent to the package maintainer(s)
617 but either the $gBug report is not associated with any package (probably
618 because of a missing Package pseudo-header field in the original $gBug
619 report), or the package(s) specified do not have any maintainer(s).
621 Your message has *not* been sent to any package maintainers; it has
622 merely been filed in the $gBug tracking system. If you require assistance
623 please contact $gMaintainerEmail quoting the $gBug number $ref.
627 $resentccval.= join(', ',@resentccs);
628 $resentccval =~ s/\s+\n\s+/ /g; $resentccval =~ s/^\s+/ /; $resentccval =~ s/\s+$//;
629 if (length($resentccval)) {
630 $resentcc= "Resent-CC: $resentccval\n";
633 if ($codeletter eq 'U') {
634 &htmllog("Message", "sent on", $s_originator, "$gBug#$ref.");
635 &sendmessage(<<END,$s_originator,@resentccs);
636 Subject: $gBug#$ref: $newsubject
637 Reply-To: $replyto, $ref-quiet\@$gEmailDomain
638 ${orgsender}Resent-To: $s_originator
639 ${resentcc}Resent-Date: $tdate
640 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
641 Resent-Sender: $gMaintainerEmail
642 X-$gProject-PR-Message: report $ref
643 X-$gProject-PR-Package: $s_package
644 X-$gProject-PR-Keywords: $s_keywords
647 } elsif ($codeletter eq 'B') {
648 &htmllog($newref ? "Report" : "Information", "forwarded",
649 join(', ',"$gSubmitList\@$gListDomain",@resentccs),
650 "<code>$gBug#$ref</code>".
651 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
653 &sendmessage(<<END,"$gSubmitList\@$gListDomain",@resentccs);
654 Subject: $gBug#$ref: $newsubject
655 Reply-To: $replyto, $ref\@$gEmailDomain
656 Resent-From: $header{'from'}
657 ${orgsender}Resent-To: $gSubmitList\@$gListDomain
658 ${resentcc}Resent-Date: $tdate
659 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
660 Resent-Sender: $gMaintainerEmail
661 X-$gProject-PR-Message: report $ref
662 X-$gProject-PR-Package: $s_package
663 X-$gProject-PR-Keywords: $s_keywords
666 } elsif (@resentccs) {
667 # D and F done far earlier; B just done - so this must be M or Q
668 # We preserve whichever it was in the Reply-To (possibly adding
670 &htmllog($newref ? "Report" : "Information", "forwarded",
672 "<code>$gBug#$ref</code>".
673 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
675 &sendmessage(<<END,@resentccs);
676 Subject: $gBug#$ref: $newsubject
677 Reply-To: $replyto, $ref-$baddressroot\@$gEmailDomain
678 Resent-From: $header{'from'}
679 ${orgsender}Resent-To: $resentccval
681 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
682 Resent-Sender: $gMaintainerEmail
683 X-$gProject-PR-Message: report $ref
684 X-$gProject-PR-Package: $s_package
685 X-$gProject-PR-Keywords: $s_keywords
690 $htmlbreak= length($brokenness) ? "<p>\n".&sani($brokenness)."\n<p>\n" : '';
691 $htmlbreak =~ s/\n\n/\n<P>\n\n/g;
692 if (length($resentccval)) {
693 $htmlbreak = " Copy sent to <code>".&sani($resentccval)."</code>.".
697 &htmllog("Acknowledgement","sent",$replyto,
699 "New $gBug report received and filed, but not forwarded." :
700 "New $gBug report received and forwarded."). $htmlbreak);
701 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
702 From: $gMaintainerEmail ($gProject $gBug Tracking System)
704 Subject: $gBug#$ref: Acknowledgement of QUIET report
706 Message-ID: <handler.$ref.$nn.ackquiet\@$gEmailDomain>
707 In-Reply-To: $header{'message-id'}
708 References: $header{'message-id'}
710 X-$gProject-PR-Message: ack-quiet $ref
711 X-$gProject-PR-Package: $s_package
712 X-$gProject-PR-Keywords: $s_keywords
713 Reply-To: $ref-quiet\@$gEmailDomain
715 Thank you for the problem report you have sent regarding $gProject.
716 This is an automatically generated reply, to let you know your message
717 has been received. It has not been forwarded to the developers or
718 their mailing list; you should ensure that the developers are aware of
719 the problem you have entered into the system - preferably quoting the
720 $gBug reference number, #$ref.
722 If you wish to submit further information on your problem, please send it
723 to $ref-$baddressroot\@$gEmailDomain (and *not*
724 to $baddress\@$gEmailDomain).
726 Please do not reply to the address at the top of this message,
727 unless you wish to report a problem with the $gBug-tracking system.
730 (administrator, $gProject $gBugs database)
732 From: $gMaintainerEmail ($gProject $gBug Tracking System)
734 Subject: $gBug#$ref: Acknowledgement of maintainer-only report
736 Message-ID: <handler.$ref.$nn.ackmaint\@$gEmailDomain>
737 In-Reply-To: $header{'message-id'}
738 References: $header{'message-id'}
740 X-$gProject-PR-Message: ack-maintonly $ref
741 X-$gProject-PR-Package: $s_package
742 X-$gProject-PR-Keywords: $s_keywords
743 Reply-To: $ref-maintonly\@$gEmailDomain
745 Thank you for the problem report you have sent regarding $gProject.
746 This is an automatically generated reply, to let you know your message has
747 been received. It is being forwarded to the developers (but not the mailing
748 list, as you requested) for their attention; they will reply in due course.
750 If you wish to submit further information on your problem, please send
751 it to $ref-$baddressroot\@$gEmailDomain (and *not*
752 to $baddress\@$gEmailDomain).
754 Please do not reply to the address at the top of this message,
755 unless you wish to report a problem with the $gBug-tracking system.
758 (administrator, $gProject $gBugs database)
760 From: $gMaintainerEmail ($gProject $gBug Tracking System)
762 Subject: $gBug#$ref: Acknowledgement ($subject)
763 Message-ID: <handler.$ref.$nn.ack\@$gEmailDomain>
764 In-Reply-To: $header{'message-id'}
765 References: $header{'message-id'}
767 X-$gProject-PR-Message: ack $ref
768 X-$gProject-PR-Package: $s_package
769 X-$gProject-PR-Keywords: $s_keywords
770 Reply-To: $ref\@$gEmailDomain
772 Thank you for the problem report you have sent regarding $gProject.
773 This is an automatically generated reply, to let you know your message has
774 been received. It is being forwarded to the developers mailing list for
775 their attention; they will reply in due course.
777 If you wish to submit further information on your problem, please send
778 it to $ref\@$gEmailDomain (and *not* to
779 $baddress\@$gEmailDomain).
781 Please do not reply to the address at the top of this message,
782 unless you wish to report a problem with the $gBug-tracking system.
785 (administrator, $gProject $gBugs database)
787 } elsif ($codeletter ne 'U' and
788 $header{'precedence'} !~ /\b(?:bulk|junk|list)\b/) {
789 &htmllog("Acknowledgement","sent",$replyto,
790 ($veryquiet ? "Extra info received and filed, but not forwarded." :
791 $codeletter eq 'M' ? "Extra info received and forwarded to maintainer." :
792 "Extra info received and forwarded to list."). $htmlbreak);
793 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
794 From: $gMaintainerEmail ($gProject $gBug Tracking System)
796 Subject: $gBug#$ref: Info received and FILED only
798 Message-ID: <handler.$ref.$nn.ackinfoquiet\@$gEmailDomain>
799 In-Reply-To: $header{'message-id'}
800 References: $header{'message-id'}
802 X-$gProject-PR-Message: ack-info-quiet $ref
803 X-$gProject-PR-Package: $s_package
804 X-$gProject-PR-Keywords: $s_keywords
805 Reply-To: $ref-quiet\@$gEmailDomain
807 Thank you for the additional information you have supplied regarding
808 this problem report. It has NOT been forwarded to the developers, but
809 will accompany the original report in the $gBug tracking system. Please
810 ensure that you yourself have sent a copy of the additional
811 information to any relevant developers or mailing lists.
813 If you wish to continue to submit further information on your problem,
814 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
816 Please do not reply to the address at the top of this message,
817 unless you wish to report a problem with the $gBug-tracking system.
820 (administrator, $gProject $gBugs database)
822 From: $gMaintainerEmail ($gProject $gBug Tracking System)
824 Subject: $gBug#$ref: Info received for maintainer only
826 Message-ID: <handler.$ref.$nn.ackinfomaint\@$gEmailDomain>
827 In-Reply-To: $header{'message-id'}
828 References: $header{'message-id'}
830 X-$gProject-PR-Message: ack-info-maintonly $ref
831 X-$gProject-PR-Package: $s_package
832 X-$gProject-PR-Keywords: $s_keywords
833 Reply-To: $ref-maintonly\@$gEmailDomain
835 Thank you for the additional information you have supplied regarding
836 this problem report. It has been forwarded to the developer(s) (but
837 not to the mailing list) to accompany the original report.
839 If you wish to continue to submit further information on your problem,
840 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
842 Please do not reply to the address at the top of this message,
843 unless you wish to report a problem with the $gBug-tracking system.
846 (administrator, $gProject $gBugs database)
848 From: $gMaintainerEmail ($gProject $gBug Tracking System)
850 Subject: $gBug#$ref: Info received (was $subject)
851 Message-ID: <handler.$ref.$nn.ackinfo\@$gEmailDomain>
852 In-Reply-To: $header{'message-id'}
853 References: $header{'message-id'}
855 X-$gProject-PR-Message: ack-info $ref
856 X-$gProject-PR-Package: $s_package
857 X-$gProject-PR-Keywords: $s_keywords
858 Disabled-Doogie-Reply-To: $ref\@$gEmailDomain
860 Thank you for the additional information you have supplied regarding
861 this problem report. It has been forwarded to the developer(s) and
862 to the developers mailing list to accompany the original report.
864 If you wish to continue to submit further information on your problem,
865 please send it to $ref\@$gEmailDomain, as before.
867 Please do not reply to the address at the top of this message,
868 unless you wish to report a problem with the $gBug-tracking system.
871 (administrator, $gProject $gBugs database)
880 open(NEW,">$f.new") || &quit("$f.new: create: $!");
881 print(NEW "$v") || &quit("$f.new: write: $!");
882 close(NEW) || &quit("$f.new: close: $!");
883 rename("$f.new","$f") || &quit("rename $f.new to $f: $!");
887 my $hash = get_hashname($ref);
888 if (!open(AP,">>db-h/$hash/$ref.log")) {
889 print DEBUG "failed open log<\n";
890 print DEBUG "failed open log err $!<\n";
891 &quit("opening db-h/$hash/$ref.log (li): $!");
893 print(AP "\7\n",@{escapelog(@log)},"\n\3\n") || &quit("writing db-h/$hash/$ref.log (li): $!");
894 close(AP) || &quit("closing db-h/$hash/$ref.log (li): $!");
898 utime(time,time,"db");
900 while ($u= $cleanups[$#cleanups]) { &$u; }
901 unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
905 &quit("wot no exit");
907 sub chldhandle { $chldexit = 'yes'; }
910 local ($whatobj,$whatverb,$where,$desc) = @_;
911 my $hash = get_hashname($ref);
912 open(AP,">>db-h/$hash/$ref.log") || &quit("opening db-h/$hash/$ref.log (lh): $!");
915 "<strong>$whatobj $whatverb</strong> to <code>".&sani($where).
916 "</code>:<br>\n". $desc.
917 "\n\3\n") || &quit("writing db-h/$hash/$ref.log (lh): $!");
918 close(AP) || &quit("closing db-h/$hash/$ref.log (lh): $!");
923 map { $_->address() }
924 map { Mail::Address->parse($_) } @_;
928 local ($msg,@recips) = @_;
929 if ($recips[0] eq '' && $#recips == 0) { @recips= ('-t'); }
930 $msg = "X-Loop: $gMaintainerEmail\n" . $msg;
932 my $hash = get_hashname($ref);
933 #save email to the log
934 open(AP,">>db-h/$hash/$ref.log") || &quit("opening db-h/$hash/$ref.log (lo): $!");
935 print(AP "\2\n",join("\4",@recips),"\n\5\n",@{escapelog($msg)},"\n\3\n") ||
936 &quit("writing db-h/$hash/$ref.log (lo): $!");
937 close(AP) || &quit("closing db-h/$hash/$ref.log (lo): $!");
939 #if debbuging.. save email to a log
940 # open AP, ">>debug";
941 # print AP join( '|', @recips )."\n>>";
942 # print AP get_addresses( @recips );
943 # print AP "<<\n".$msg;
944 # print AP "\n--------------------------------------------------------\n";
949 $SIG{'CHLD'}='chldhandle';
950 #print DEBUG "mailing sigchild set up<\n";
953 #print DEBUG "mailing opened pipe fork<\n";
954 defined($c) || die $!;
955 #print DEBUG "mailing opened pipe fork ok $c<\n";
956 if (!$c) { # ie, we are in the child process
957 #print DEBUG "mailing child<\n";
958 unless (open(STDERR,">&STDOUT")) {
959 #print DEBUG "mailing child opened stderr<\n";
960 print STDOUT "redirect stderr: $!\n";
961 #print DEBUG "mailing child opened stderr fail<\n";
963 #print DEBUG "mailing child opened stderr fail exit !?<\n";
965 #print DEBUG "mailing child opened stderr ok<\n";
967 #print DEBUG "mailing child forked again<\n";
968 defined($c) || die $!;
969 #print DEBUG "mailing child forked again ok $c<\n";
970 if (!$c) { # ie, we are the child process
971 #print DEBUG "mailing grandchild<\n";
972 exec '/usr/lib/sendmail','-f'."$gMaintainerEmail",'-odq','-oem','-oi',get_addresses(@recips);
973 #print DEBUG "mailing grandchild exec failed<\n";
975 #print DEBUG "mailing grandchild died !?<\n";
977 #print DEBUG "mailing child not grandchild<\n";
978 print(D $msg) || die $!;
979 #print DEBUG "mailing child printed msg<\n";
981 #print DEBUG "mailing child closed pipe<\n";
982 die "\n*** command returned exit status $?\n" if $?;
983 #print DEBUG "mailing child exit status ok<\n";
985 #print DEBUG "mailing child exited ?!<\n";
987 #print DEBUG "mailing parent<\n";
989 #print DEBUG "mailing parent results emptied<\n";
990 while( $chldexit eq 'no' ) { $results.= $_; }
991 #print DEBUG "mailing parent results read >$results<\n";
993 #print DEBUG "mailing parent results closed<\n";
994 $results.= "\n*** child returned exit status $?\n" if $?;
995 #print DEBUG "mailing parent exit status ok<\n";
996 $SIG{'CHLD'}='DEFAULT';
997 #print DEBUG "mailing parent sigchild default<\n";
998 if (length($results)) { &quit("running sendmail: $results"); }
999 #print DEBUG "mailing parent results ok<\n";
1002 sub checkmaintainers {
1003 return if $maintainerschecked++;
1004 return if !length($s_package);
1005 open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
1009 m/^(\S+)\s+(\S.*\S)\s*\n$/ || &quit("maintainers bogus \`$_'");
1010 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
1011 $maintainerof{$1}= $2;
1014 open(MAINT,"$gMaintainerFileOverride") || die &quit("maintainers.override open: $!");
1018 m/^(\S+)\s+(\S.*\S)\s*\n$/ || &quit("maintainers.override bogus \`$_'");
1019 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
1020 $maintainerof{$1}= $2;
1023 open(SOURCES,"$gPackageSource") || &quit("pkgsrc open: $!");
1025 next unless m/^(\S+)\s+\S+\s+(\S.*\S)\s*$/;
1031 $anymaintfound=0; $anymaintnotfound=0;
1032 for $p (split(m/[ \t?,()]+/,$s_package)) {
1034 if (defined $gSubscriptionDomain) {
1035 if (defined($pkgsrc{$p})) {
1036 push @addsrcaddrs, "$pkgsrc{$p}\@$gSubscriptionDomain";
1038 push @addsrcaddrs, "$p\@$gSubscriptionDomain";
1041 if (defined($maintainerof{$p})) {
1042 print DEBUG "maintainer add >$p|$maintainerof{$p}<\n";
1043 $addmaint= $maintainerof{$p};
1044 push(@maintaddrs,$addmaint) unless
1045 $addmaint eq $replyto || grep($_ eq $addmaint, @maintaddrs);
1048 print DEBUG "maintainer none >$p<\n";
1049 push(@maintaddrs,$gUnknownMaintainerEmail) unless $anymaintnotfound;
1050 $anymaintnotfound++;