/[docman]/contrib/sendlogins.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /contrib/sendlogins.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Thu Apr 12 10:27:56 2001 UTC (22 years, 11 months ago) by dpavlin
Branch: MAIN
File MIME type: text/plain
perl script to send notifications of open accounts

1 dpavlin 1.1 #!/usr/local/bin/perl -w
2    
3     # usage: cat .htusers | sendlogins.pl http://docmain.domain.com/
4    
5     my $debug=1;
6    
7     my $in_mail=$0;
8     $in_mail=~s/\.pl/.txt/;
9    
10     my $url=$ARGV[0];
11    
12     $|++;
13    
14     while(<STDIN>) {
15     chomp;
16     chomp;
17    
18     ($login,$fullname,undef,$email) = split(/:/,$_);
19     my $host=$email;
20     $host=~s/^[^@]@*//g;
21    
22     if (defined $debug) {
23     open(MAIL,">> /tmp/mailfoo") || die "$!";
24     } else {
25     open(MAIL,"| /usr/lib/sendmail -t") || die "sendmail: $!";
26     }
27    
28     print MAIL "To: $fullname <$email>\n";
29    
30     open(IN,"$in_mail") || die "in mail: $!";
31     while(<IN>) {
32     chomp;
33     chomp;
34     s/##login##/$login/g;
35     s/##url##/$url/g;
36     s/##pop3host##/$host/g;
37     print MAIL "$_\n";
38     }
39     close(IN);
40     close(MAIL);
41     print "." if ($debug);
42     }
43    

  ViewVC Help
Powered by ViewVC 1.1.26