Article View: news.software.nntp
Article #35983news2mail - header bug + fix
From: Geoff Gibbs
Date: Tue, 16 Mar 1999 00:00
Date: Tue, 16 Mar 1999 00:00
67 lines
2936 bytes
2936 bytes
news2mail has a bug whereby a cross-posted article produces a To:
field with the addresses space delimited. When this goes through
the mail system the addresses get concatenated. What is required
is that the addresses should be comma delimited for the To: field.
I believe that the following patch fixes the problem :-
% diff -c news2mail.orig news2mail
*** news2mail.orig Wed Feb 17 09:58:52 1999
--- news2mail Tue Mar 16 10:57:14 1999
***************
*** 73,90 ****
($token, $lnames) = split /\s+/, $_, 2;
! $addrs = "";
$cnt = 0;
for $ln ( split /\s+/, $lnames ) {
if ( $maddr{ $ln } ) {
$cnt++;
}
- $addrs = join ' ', $addrs, $maddr{ $ln };
}
if ($cnt > 0) {
! mailto($token, $lnames, $addrs);
}
else {
syslog('notice', 'unknown listname %s', $_);
--- 73,99 ----
($token, $lnames) = split /\s+/, $_, 2;
! $addrs = ""; # for a space separated list for sendmail args
! $laddrs = ""; # for a comma separated list for the To field
$cnt = 0;
for $ln ( split /\s+/, $lnames ) {
if ( $maddr{ $ln } ) {
$cnt++;
+ if ($cnt > 1) {
+ $laddrs = join ', ', $laddrs, $ln;
+ $addrs = join ' ', $addrs, $maddr{ $ln };
+ }
+ else {
+ $laddrs = $ln;
+ $addrs = $maddr{ $ln };
+ }
}
}
if ($cnt > 0) {
! ## mailto($token, $lnames, $addrs);
! mailto($token, $laddrs, $addrs);
}
else {
syslog('notice', 'unknown listname %s', $_);
--
Geoff Gibbs
--
UK-Human Genome Mapping Project-Resource Centre,
Hinxton, Cambridge, CB10 1SB, UK
Tel: +44 1223 494530 Fax: +44 1223 494512 E-mail: G.Gibbs@hgmp.mrc.ac.uk
Technical Details
Message-ID:
<7clsfc$rp$1@niobium.hgmp.mrc.ac.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <7clsfc$rp$1@niobium.hgmp.mrc.ac.uk> Subject: news2mail - header bug + fix Date: Tue, 16 Mar 1999 00:00:00 +0000 From: ggibbs@hgmp.mrc.ac.uk (Geoff Gibbs) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 455645220 Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@hgmp.mrc.ac.uk X-Trace: niobium.hgmp.mrc.ac.uk 921597228 889 193.62.192.79 (16 Mar 1999 15:13:48 GMT) Organization: MRC Human Genome Mapping Project Resource Centre Mime-Version: 1.0 NNTP-Posting-Date: 16 Mar 1999 15:13:48 GMT Newsgroups: news.software.nntp