in reply to Mailing List

foreach(keys %emails) { my ($name, $add1, $add2, $city, $zip, $country) = split(/::/, $ +emails{$_}); # Email Subs, special commands my $editmes = $message; # let's not edit $messa +ge $editmes =~ s/\[name\]/$name/g; #[name] = user name $editmes =~ s/\[time\]/$time/g; #[time] = time sent $editmes =~ s/\[unsub\]/$unsub/g; #[unsub] = unsubscribe +email my $editsig = $signature; # let's not edit $signa +ture $editsig =~ s/\[name\]/$name/g; #[name] = user name $editsig =~ s/\[time\]/$time/g; #[time] = time sent $editsig =~ s/\[unsub\]/$unsub/g; #[unsub] = unsubscribe +email my $editsub = $subject; # let's not edit $subje +ct $editsub =~ s/\[name\]/$name/g; # [name] = user name + open( MAIL, "| $sendmail -t" ); print MAIL "To: $_\n"; print MAIL "From: $adminmail\n"; print MAIL "Subject: $editsub\n\n"; print MAIL "$editmes\n"; if ($use ne "" && $signature ne "" ) { print MAIL "$editsig\n"; } print MAIL ".\n"; close(MAIL); }

The problem with this setup is that, if your mailing list contains a vast quantity of recipients, you put a big load on the system/MTA, for you open a connection for each individual recipient. A "better" way to me, would be the use of one e-mail with the recipients listed in the Bcc field. That would dramastically take some load of the script, for this way, only one connection will be made to $sendmail. The script would be faster too :)

But implementing this Bcc way, would take away the "personalized" e-mails system you implemented (the [name] stuff wouldn't work anymore). It's up to anyone, of course, but I would sacrifice the personal touch over the speed increase and load decrease.

I am interested in your motive that made you write this script though. There are some rather good mailing list programs, such as Majordomo (Perl :), Mailman (Python/C) out there already. Not even mentioning googling.

--
b10m

Replies are listed 'Best First'.
Re: Re: Mailing List
by sulfericacid (Deacon) on Jan 01, 2004 at 21:22 UTC
    Thank you for your comments on the script. I had a feeling that when the database of names got large enough that it would take a lot longer for the system to complete the task..but I personally won't ever have that many people in my list.

    I didn't quite understand your idea, but I wouldn't take that route if it takes away the function of [name]. That's one of the reasons I went with writing my own script, besides the fact I really wanted to see if I could write one.

    Thanks for your comments.



    "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

    sulfericacid