Recently people on my mailing list have complained of receiving two
emails instead of one each time I send them a letter. I use a web
interface that I built to manage a very simple list, which takes a
message from a form, and mass-mails it to the list. The key subroutine
is "publish", which calls a file reading library routine I call
"ReadF", and another library routine to communicate with the sendmail
program I call "MailM". Everything in the code is simple... seems
straightforward. There are no black box module calls. This could
probably run in Perl 4. The list has been checked several times and is
completely clean of duplicate email addresses. Can anyone see a reason
why sendmail might be sending the message in $in{'message'} to everyone
twice?
- James
sub publish {
$BaseDir = "/usr/local/etc/httpd/data";
&ReadF('master.data');
foreach (@FileArray) {
&MailM("ceo\@fat24.com","ceo\@fat24.com",$_,$in{'subject'},$in{'message'
},0,0,0,1); }
}
sub MailM {
if ($_[8]) { open (MAIL, "|/bin/sendmail -t") ||
&OpenError('bin/sendmail'); }
else { open (MAIL, "|/bin/sendmail -odq -t") ||
&OpenError('bin/sendmail'); }
if ($_[1]) { print MAIL "Return-Path: $_[1]\n"; }
print MAIL "Content-return: allowed\n";
print MAIL "From: $_[0]\n";
if ($_[1]) { print MAIL "Reply-To: $_[1]\n"; }
print MAIL "Subject: $_[3]\n";
print MAIL "To: $_[2]\n";
if ($_[5]) { print MAIL "Cc: $_[5]\n"; }
if ($_[6]) { print MAIL "Bcc: $_[6]\n"; }
if ($_[7] eq 'e') { print MAIL "Content-Type: text/plain;
charset=\"iso-8859-1\"\n"; }
elsif ($_[7] eq 'h') { print MAIL "Content-Type: text/html;
charset=\"iso-8859-1\"\n"; }
elsif ($_[7] eq 'm') { print MAIL "Content-Type: multipart/mixed\n"; }
if ($_[9]) { print "Bounces-to: $_[9]\n"; }
print MAIL "Importance: high\n";
print MAIL "X-Priority: 1\n\n";
print MAIL "$_[4]\n";
close (MAIL);
}
sub ReadF {
@FileArray = ();
open (DATA, "<$BaseDir/$_[0]") || &OpenError($_[0]);
flock(DATA, 1);
@FileArray = <DATA>;
close (DATA);
foreach (@FileArray) { chomp($_); }
return @FileArray;
}
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm
- [Boston.pm] Communication Problem with sendmail??? James Linden Rose, III

