Use reply-to if present for originator's email address.
This commit is contained in:
parent
df8ee64647
commit
8f4e2716ec
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=2455
2 changed files with 36 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
# $Id: query-pr.cgi,v 1.5 1998-01-22 02:31:11 fenner Exp $
|
# $Id: query-pr.cgi,v 1.6 1998-02-19 20:14:53 fenner Exp $
|
||||||
|
|
||||||
$ENV{'PATH'} = "/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin";
|
$ENV{'PATH'} = "/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin";
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ unless (open(Q, "query-pr --restricted -F $pr 2>&1 |")) {
|
||||||
$inhdr = 1;
|
$inhdr = 1;
|
||||||
$multiline = 0;
|
$multiline = 0;
|
||||||
$from = "";
|
$from = "";
|
||||||
|
$replyto = "";
|
||||||
|
|
||||||
while(<Q>) {
|
while(<Q>) {
|
||||||
chop;
|
chop;
|
||||||
|
@ -72,11 +73,24 @@ while(<Q>) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/^From:\s*(.*)$/) {
|
# In e-mail header
|
||||||
|
if ($inhdr && /^From:\s*(.*)$/i) {
|
||||||
$from = $1;
|
$from = $1;
|
||||||
($email = $from) =~ s/.*<(.*)>.*/$1/;
|
$from =~ s/.*<(.*)>.*/$1/;
|
||||||
$email =~ s/\s*\(.*\)\s*//;
|
$from =~ s/\s*\(.*\)\s*//;
|
||||||
|
}
|
||||||
|
if ($inhdr && /^Reply-to:\s*(.*)$/i) {
|
||||||
|
$replyto = $1;
|
||||||
|
$replyto =~ s/.*<(.*)>.*/$1/;
|
||||||
|
$replyto =~ s/\s*\(.*\)\s*//;
|
||||||
|
}
|
||||||
|
|
||||||
|
# End of e-mail header
|
||||||
|
if ($inhdr && /^$/) {
|
||||||
|
$from = $replyto if ($replyto);
|
||||||
|
$email = $from;
|
||||||
$email .= '@freebsd.org' unless ($email =~ /@/);
|
$email .= '@freebsd.org' unless ($email =~ /@/);
|
||||||
|
$inhdr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/^>Responsible:/) {
|
if (/^>Responsible:/) {
|
||||||
|
@ -92,7 +106,6 @@ while(<Q>) {
|
||||||
|
|
||||||
if (/^>Number:/) {
|
if (/^>Number:/) {
|
||||||
$number = &getline($_);
|
$number = &getline($_);
|
||||||
$inhdr = 0;
|
|
||||||
} elsif (/^>Category:/) {
|
} elsif (/^>Category:/) {
|
||||||
$cat = &getline($_);
|
$cat = &getline($_);
|
||||||
} elsif (/^>Synopsis:/) {
|
} elsif (/^>Synopsis:/) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
# $Id: query-pr.cgi,v 1.5 1998-01-22 02:31:11 fenner Exp $
|
# $Id: query-pr.cgi,v 1.6 1998-02-19 20:14:53 fenner Exp $
|
||||||
|
|
||||||
$ENV{'PATH'} = "/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin";
|
$ENV{'PATH'} = "/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin";
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ unless (open(Q, "query-pr --restricted -F $pr 2>&1 |")) {
|
||||||
$inhdr = 1;
|
$inhdr = 1;
|
||||||
$multiline = 0;
|
$multiline = 0;
|
||||||
$from = "";
|
$from = "";
|
||||||
|
$replyto = "";
|
||||||
|
|
||||||
while(<Q>) {
|
while(<Q>) {
|
||||||
chop;
|
chop;
|
||||||
|
@ -72,11 +73,24 @@ while(<Q>) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/^From:\s*(.*)$/) {
|
# In e-mail header
|
||||||
|
if ($inhdr && /^From:\s*(.*)$/i) {
|
||||||
$from = $1;
|
$from = $1;
|
||||||
($email = $from) =~ s/.*<(.*)>.*/$1/;
|
$from =~ s/.*<(.*)>.*/$1/;
|
||||||
$email =~ s/\s*\(.*\)\s*//;
|
$from =~ s/\s*\(.*\)\s*//;
|
||||||
|
}
|
||||||
|
if ($inhdr && /^Reply-to:\s*(.*)$/i) {
|
||||||
|
$replyto = $1;
|
||||||
|
$replyto =~ s/.*<(.*)>.*/$1/;
|
||||||
|
$replyto =~ s/\s*\(.*\)\s*//;
|
||||||
|
}
|
||||||
|
|
||||||
|
# End of e-mail header
|
||||||
|
if ($inhdr && /^$/) {
|
||||||
|
$from = $replyto if ($replyto);
|
||||||
|
$email = $from;
|
||||||
$email .= '@freebsd.org' unless ($email =~ /@/);
|
$email .= '@freebsd.org' unless ($email =~ /@/);
|
||||||
|
$inhdr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/^>Responsible:/) {
|
if (/^>Responsible:/) {
|
||||||
|
@ -92,7 +106,6 @@ while(<Q>) {
|
||||||
|
|
||||||
if (/^>Number:/) {
|
if (/^>Number:/) {
|
||||||
$number = &getline($_);
|
$number = &getline($_);
|
||||||
$inhdr = 0;
|
|
||||||
} elsif (/^>Category:/) {
|
} elsif (/^>Category:/) {
|
||||||
$cat = &getline($_);
|
$cat = &getline($_);
|
||||||
} elsif (/^>Synopsis:/) {
|
} elsif (/^>Synopsis:/) {
|
||||||
|
|
Loading…
Reference in a new issue