noahgibbs: Me and my teddy bear at Karaoke after a day of RubyKaigi in HIroshima in 2017 (choo-choo (dzaa!))
[personal profile] noahgibbs
Lately I've been posting DHP invitations from my work email address, the NVidia one. If you respond to me at that address, I'm 90% guaranteed not to be able to reply on the weekend of the party. That means that if you want to contact me about party stuff, DO NOT just reply to the invitation. You can "reply all", which will actually only send to me (at my regular non-work address) and Brian since everybody else is carefully BCC'd.

Anybody know a good simple Unix mailer that will allow you to send mail from a script and add a really large number of names to the BCC list? I'm at a loss so far, and it seems like an easy problem. I've been too lazy to look up the SMTP protocol and write one myself, but this is getting to be a pain. And SMTP can't be that hard.

Alternately, one of the various generous folk who've talked about setting up a real mailing list for this might come through on that, but I'm not holding my breath :-)

Date: 2003-12-06 10:57 am (UTC)
From: [identity profile] sui66iy.livejournal.com
You can probably generalize this to do what you want in approximately 35 seconds:

http://www.python.org/doc/current/lib/SMTP-example.html

Also, you could set the reply-to header, which I think most mail clients respect these days.

Date: 2003-12-06 04:16 pm (UTC)
From: [identity profile] luwenth.livejournal.com
Dude, it would take me all of 4 minutes. You just gotta tell me when you want those 4 minutes to start.

I am planning on re-arranging mailling lists, but I can take another
one into consideration as I do that.

Date: 2003-12-07 01:01 am (UTC)
tshuma: (Default)
From: [personal profile] tshuma
Tag! You're here too!

Date: 2003-12-07 02:14 am (UTC)
From: [identity profile] luwenth.livejournal.com
*laugh* Yes, yes I am!




Does this mean I need to find another medium that we both share and tag you there?

why not sendmail?

Date: 2003-12-15 12:52 am (UTC)
From: [identity profile] plambert.livejournal.com
am i missing something, sir? try:

% sendmail -i -t < msg-to-send.text

and edit msg-to-send.text to have all your recipients on the Bcc: line?

it has to be message with valid headers and body, like:
To: foo@bar.tld
From: foo@bar.tld
CC: foo@bar.tld, foo@bar.tld, foo@bar.tld
Bcc: foo@bar.tld, foo@bar.tld, foo@bar.tld
Subject: foo

howdy!  blah blah blah

if your sendmail has a limit on the Bcc: line length (it's unlikely you'd hit it, but hey...) then you could easily write a script to break it up. heck, even xargs and a perl one-liner could do it, frighteningly enough...

--plambert

Re: why not sendmail?

Date: 2003-12-15 02:09 am (UTC)
From: [identity profile] angelbob.livejournal.com
That'd probably work. My two or three attempts in that direction all failed miserably, so I didn't want to keep trying and send out a bunch of broken invitations to various fragments of the invitation list. But yeah, that seems like it'd work. I'll try it.

Several people have just offered to set it up, saying it'd take no serious time to do. I'm tempted to take one of them up on it, but that also requires more ongoing effort on my part to maintain it. I'll try what you suggest above. If it works, it'll be the most painless way, going forward.

Well, okay, something based on a message template and a perl s/foo/blah/ one-liner will probably be what I do since I maintain the list of addresses in a text file. But, y'know, pretty much what you have above, but without the manual substitutions.

That's assuming it all works, naturally. There's probably some reason that every GUI or GUIish mail program I've tried on Unix chokes on enormous BCC lines, but damned if I know what it is. The one time I've successfully sent the invite from my machine, I used (gag) Netscape Mail, and just let it sit for many minutes.

It worked, though, eventually.



Date: 2003-12-21 12:10 pm (UTC)
From: [identity profile] grendelkhan.livejournal.com
If this problem is still open, here's a perl script that should do it. Having no SMTP server of my own, I'd recommend that you test it out first. I cribbed most of it from here (http://members.toast.net/strycher/perl/example_net_smtp.htm), with this (http://search.cpan.org/~roode/Time-Format-0.13/Format.pm) used to format the date in the header.

#!/usr/bin/perl -w
use strict;

use Net::SMTP;
use Time::Format qw(%time);

$SMTP_HOST = 'mailserver.com';

my $addresses;
open (FH, 'addresses.txt', 'r');
while () { push @$addresses, chomp $_ };
close FH;

send_it('me@foo.com',$addresses,'Big Announcement!',
	'Meet me at the witching hour');

sub send_it {
	my ($from, $to, $subj, $msg) = @_;

	my $smtp = Net::SMTP->new($SMTP_HOST,
		Debug => 1);

	if(!defined($smtp) || !($smtp)) {
		print "SMTP ERROR: Unable to open smtp session.\n";
		return 0;
	}

	$smtp->mail($from);
	$smtp->recipient(@$to);

	my $header = <<EOH
MIME-Version: 1.0
From: $from
To: [hidden]
Date: $time{'Day, dd Mon yyyy hh:mm:ss tz'}
Subject: $subj

EOH
	$smtp->data($msg);

	$smtp->quit;
}


Let me know how that works out for you.

December 2024

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 10th, 2026 08:07 pm
Powered by Dreamwidth Studios