2 |
|
|
3 |
# usage: cat .htusers | sendlogins.pl http://docmain.domain.com/ |
# usage: cat .htusers | sendlogins.pl http://docmain.domain.com/ |
4 |
|
|
5 |
my $debug=1; |
#my $debug=1; |
6 |
|
|
7 |
my $in_mail=$0; |
my $in_mail=$0; |
8 |
$in_mail=~s/\.pl/.txt/; |
$in_mail=~s/\.pl/.txt/; |
9 |
|
|
10 |
my $url=$ARGV[0]; |
my $url=$ARGV[0]; |
11 |
|
|
12 |
|
if (! $url) { |
13 |
|
print STDERR "To send announcement to all users in .htusers file use\n"; |
14 |
|
print STDERR "$0 http://docman.site.com/ < .htusers\n"; |
15 |
|
exit 1; |
16 |
|
} |
17 |
|
|
18 |
$|++; |
$|++; |
19 |
|
|
20 |
while(<STDIN>) { |
while(<STDIN>) { |
23 |
|
|
24 |
($login,$fullname,undef,$email) = split(/:/,$_); |
($login,$fullname,undef,$email) = split(/:/,$_); |
25 |
my $host=$email; |
my $host=$email; |
26 |
$host=~s/^[^@]@*//g; |
$host=~s/^[^@]*@//g; |
27 |
|
|
28 |
if (defined $debug) { |
if (defined $debug) { |
29 |
open(MAIL,">> /tmp/mailfoo") || die "$!"; |
open(MAIL,">> /tmp/mailfoo") || die "$!"; |