#!/usr/bin/perl sub aac{ my($gac5, $jpg9, $c06p, $e2pf, $bjcg, $e09k, $gn8b, $doea, $bk2d) = @_; if (lc $mailusing eq 'sendmail') { if ($username) { open (MAIL, "|$mailprog -t -f \"$jpg9\" ") || print ("Can't open $mailprog!\n"); } else { open (MAIL, "|$mailprog -t") || print ("Can't open $mailprog!\n"); } print MAIL "To: $gac5\n"; print MAIL "From: $e09k <$jpg9>\n"; print MAIL "Reply-To: $e09k <$jpg9>\n"; print MAIL "Subject: $c06p\n"; print MAIL "MIME-Version: 1.0\n"; print MAIL "Content-Type: multipart/alternative\;\n boundary=boundary42\n"; print MAIL "--boundary42\n"; if (($bk2d) || (!($doea))) { print MAIL "Content-Type: text/plain; charset=\"ISO-8859-1\"\n"; print MAIL "Content-Transfer-Encoding: 8bit\n\n"; $gn8b =~ s/\r//g; print MAIL "$gn8b"; print MAIL "\n\n"; if (!($doea)) { print MAIL "--boundary42--\n"; } else { print MAIL "--boundary42\n"; } } if ($doea) { print MAIL "Content-Type: text/html; charset=\"ISO-8859-1\"\n"; print MAIL "Content-Disposition: inline\n"; print MAIL "Content-Transfer-Encoding: 8bit\n\n"; $e2pf =~ s/\r//g; print MAIL "$e2pf"; print MAIL "\n\n"; print MAIL "--boundary42--\n"; } print MAIL "\n\n"; close MAIL; } else { $j48a = &aad($gac5, $jpg9, $c06p, $e2pf, $bjcg, $e09k, $gn8b, $doea, $bk2d); if ($j48a < 1) {print "
\nSendmail error # $j48a
\n";} } } sub aad{ my ($gac5, $jpg9, $c06p, $e2pf, $bjcg, $e09k, $gn8b, $doea, $bk2d) = @_; my ($eplb) = $jpg9; if (!$gac5) { return -8; } my ($h9gj, $jolj, $g133); my ($fj18) = 2; my ($gjel) = 1; $h9gj = (getprotobyname('tcp'))[2]; $jolj = 25; $kb2k = ($smtp_addr =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) ? pack('C4',$1,$2,$3,$4) : (gethostbyname($smtp_addr))[4]; if (!defined($kb2k)) { return -1; } if (!socket(S, $fj18, $gjel, $h9gj)) { return -2; } if (!connect(S, pack('Sna4x8', $fj18, $jolj, $kb2k))) { return -3; } select(S); $| = 1; select(STDOUT); $_ = ; if (/^[45]/) { close S; return -4; } print S "helo localhost\r\n"; $_ = ; if (/^[45]/) { close S; return -5; } print S "mail from: <$jpg9>\r\n"; $_ = ; if (/^[45]/) { close S; return -5; } print S "rcpt to: <$gac5>\r\n"; $_ = ; if (/^[45]/) { close S; return -6; } print S "data\r\n"; $_ = ; if (/^[45]/) { close S; return -5; } print S "To: $gac5\r\n"; print S "From: $e09k<$jpg9>\r\n"; print S "Reply-to: $e09k<$eplb>\r\n" if $eplb; print S "Subject: $c06p\r\n"; print S "MIME-Version: 1.0\r\n"; print S "Content-Type: multipart/alternative\;\n boundary=boundary42\r\n"; print S "--boundary42\r\n"; if (($bk2d) || (!($doea))) { print S "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\n"; print S "Content-Transfer-Encoding: 8bit\r\n\r\n"; print S "$gn8b\n"; if (!($doea)) { print S "--boundary42--\r\n"; } else { print S "--boundary42\r\n"; } } if ($doea) { print S "Content-Type: text/html; charset=\"ISO-8859-1\"\r\n"; print S "Content-Transfer-Encoding: 8bit\r\n\r\n"; $e2pf =~ s/\r//g; print S "$e2pf"; print S "--boundary42--\r\n"; } print S "\r\n.\r\n"; $_ = ; if (/^[45]/) { close S; return -7; } print S "quit\r\n"; $_ = ; close S; return 1; } sub aab{ if ($c057{'to_lists'} eq choose) { print "Content-type: text/html\n\n"; print "Don't forget to choose a list to send your mailing to!
"; exit; } open (PASSWORD, "$passfile/password.txt"); $agdf = ; close (PASSWORD); chop ($agdf) if ($agdf =~ /\n$/); if ($c057{'password'}) { $h4pj = crypt($c057{'password'}, "aa"); } else { print "Content-type: text/html\n\n"; &ad0; &ac1; print qq— \n
\n \n \n \n \n \n \n
\n


Subscribe\n Me Status:
\n Password Error!

\n \n

Please press your browser's BACK button. Be sure to enter your Administration Password correctly.

\n
\n\n—;&ab9; &aap; exit; } unless ($h4pj eq $agdf) { print "Content-type: text/html\n\n"; &ad0; &ac1; print qq— \n
\n \n \n \n \n \n \n
\n


Subscribe\n Me Status:
\n Password Error!

\n \n

Incorrect Password. Please press your browser's back button and be sure to enter the correct Administration Password.

\n
\n\n—;&ab9; &aap; exit; } $d767 = fork(); print "Content-type: text/html \n\n fork failed: $!" unless defined $d767; if ($d767) { if ($c057{'testmailing'}) { &abf($cp1c); exit(0); } else { print "Content-type: text/html \n\n"; &ad0; &ac1; print qq—

\n \n \n \n \n \n
\n \n

Subscribe\n Me Status: Mailing Success!

\n \n

Your mailing is now being sent to your Subscribe Me mailing list! When your mailing is completed, you should receive and automated e-mail from Subscribe Me which will let you know the status of your mailing and the number of addresses delivered to.

\n \n

Thank you for\n using Subscribe Me. Please let us know if there any improvements you\n would like us to consider for the next release of our program, at\n cgi\@elitehost.com.

\n
\n\n—;&ab9; &aap; exit(0); } } else { close (STDOUT); open (DB, "<$lists/lists.db"); if ($LOCK_EX){ flock(DB, $LOCK_EX); } @f121 = ; close (DB); foreach $ed48(@f121) { @b736 = split(/\|/,$ed48); if ($b736[0] == $c057{'to_lists'}) { $cp1c = $b736[2]; $e09k = $b736[1]; if ($b736[6] eq '0') { $f87k = $ENV{'SERVER_NAME'}; } else { $f87k = $b736[6]; } last; } } if ($c057{'message'}) { $doea = 1; } if ($c057{'message_textonly'}) { $bk2d = 1; } open (TEMP,">$memberinfo/$c057{'to_lists'}-$ghko-$k89p-$dg3p-message.txt"); if ($LOCK_EX){ flock(TEMP, $LOCK_EX); } print TEMP "$c057{'message'}"; close(TEMP); open (TEMP3,">$memberinfo/$c057{'to_lists'}-$ghko-$k89p-$dg3p-message-textonly.txt"); if ($LOCK_EX){ flock(TEMP3, $LOCK_EX); } print TEMP3 "$c057{'message_textonly'}"; close(TEMP3); open (FILE,"<$lists/$c057{'to_lists'}.signature"); @kjmf = ; close(FILE); unless (($c057{'testmailing'})) { open (LOG, ">$maildir/$c057{'to_lists'}-$ghko-$k89p-$dg3p.txt"); &aca("$c057{'to_lists'}list"); open (DATDUPES,"<$lists/$c057{'to_lists'}.list"); if ($LOCK_EX){ flock(DATDUPES, $LOCK_EX); } @g6cf = ; close(DATDUPES); open (DATDUPES2,">$lists/$c057{'to_lists'}.list"); if ($LOCK_EX){ flock(DATDUPES2, $LOCK_EX); } foreach $ed48(@g6cf) { chomp($ed48); $g6cf{$ed48} = 1; } while (($k85c,$dl7m) = each(%g6cf)) { print DATDUPES2 "$k85c\n"; } close(DATDUPES2); &acc("$c057{'to_lists'}list"); if (-e "$removes/$c057{'to_lists'}.list") { &aca("$c057{'to_lists'}removes"); undef $/; open (LIST1,"<$removes/$c057{'to_lists'}.list"); if ($LOCK_EX){ flock(LIST1, $LOCK_EX); } $ec0d = ; close (LIST1); $/ = "\n"; (@k84a) = split(/\n/, $ec0d); foreach $b85f(@k84a) { chomp($b85f); $hpo6 =~ s/\r//; $hpo6 =~ s/\s//g; chomp($ggn8); open (DAT,"<$lists/$c057{'to_lists'}.list"); if ($LOCK_EX){ flock(DAT, $LOCK_EX); } @g6cf = ; close(DAT); $k1a6 = 0; open (DAT,">$lists/$c057{'to_lists'}.list"); if ($LOCK_EX){ flock(DAT, $LOCK_EX); } foreach $ed48(@g6cf) { chomp($ed48); if ($b85f ne $ed48) { print DAT "$ed48\n"; } } } close(DAT); unlink("$removes/$c057{'to_lists'}.list"); &acc("$c057{'to_lists'}removes"); } if (-e "$bounces/$c057{'to_lists'}.unsubscribe") { &aca("$c057{'to_lists'}unsubscribe"); undef $/; open (LIST1,"<$bounces/$c057{'to_lists'}.unsubscribe"); if ($LOCK_EX){ flock(LIST1, $LOCK_EX); } $ec0d = ; close (LIST1); $/ = "\n"; (@k84a) = split(/\n/, $ec0d); foreach $b85f(@k84a) { chomp($b85f); $hpo6 =~ s/\r//; $hpo6 =~ s/\s//g; chomp($ggn8); open (DAT,"<$lists/$c057{'to_lists'}.list"); if ($LOCK_EX){ flock(DAT, $LOCK_EX); } @g6cf = ; close(DAT); $k1a6 = 0; open (DAT,">$lists/$c057{'to_lists'}.list"); if ($LOCK_EX){ flock(DAT, $LOCK_EX); } foreach $ed48(@g6cf) { chomp($ed48); if ($b85f ne $ed48) { print DAT "$ed48\n"; } } } close(DAT); unlink("$bounces/$c057{'to_lists'}.unsubscribe"); &acc("$c057{'to_lists'}unsubscribe"); } } if ($c057{'testmailing'}) { @g6cf = $cp1c; } else { &aca("$c057{'to_lists'}list"); open (LIST,"<$lists/$c057{'to_lists'}.list"); if ($LOCK_EX){ flock(LIST, $LOCK_EX); } @g6cf = ; close (LIST); &acc("$c057{'to_lists'}list"); } $cdcn = @g6cf; unless ($c057{'testmailing'}) { $c057{'invitation'} =~ s/\r//g; @ki9p = split (/\n/,$c057{'invitation'}); push(@g6cf, @ki9p); $djb9 = @g6cf; $b3bf = 0; $d836 = 1; $i93h = ""; } foreach $ed48(@g6cf) { if ($c057{'sendbatches'} eq 'on') { if ($b3bf == "$c057{'bnumber'}") { &aaf($e09k); sleep ($c057{'every'}); $b3bf = "0"; } } chomp($ed48); $ed48 =~ s/\r//; $e2pf = ""; $gn8b = ""; if ($d836 > $cdcn) { $i93h = "1"; $h27l = $ed48; $h27l =~ s/\@/\=\:/g; $e2pf .= "$c057{'invitation_text'}
"; $e2pf .= "Subscribe $ed48
"; $e2pf .= "-" x 75 . "
"; $gn8b .= "$c057{'invitation_text'}\r\n"; $gn8b .= "http:\/\/$f87k$dj6h?a=1&l=$c057{'to_lists'}&e=$h27l\r\n"; $gn8b .= "-" x 75 . "\r\n\r\n"; } open (TEMP2,"<$memberinfo/$c057{'to_lists'}-$ghko-$k89p-$dg3p-message.txt"); if ($LOCK_EX){ flock(TEMP2, $LOCK_EX); } @db87 = ; close (TEMP2); open (TEMP4,"<$memberinfo/$c057{'to_lists'}-$ghko-$k89p-$dg3p-message-textonly.txt"); if ($LOCK_EX){ flock(TEMP4, $LOCK_EX); } @aokf = ; close (TEMP4); foreach $hmff(@db87) { if ($c057{'tracking'}) { $hmff =~ s/page=http:\/\//page=/g; $hmff =~ s/page=/http:\/\/$f87k$dj6h?which=$c057{'to_lists'}-$ghko-$k89p-$dg3p&page=/; $hmff =~ s/address=/address=$ed48/; } $e2pf =~ s/\r//g; $e2pf .= "$hmff"; unless ($d836 > 1) { print LOG "$hmff"; } } foreach $bbc8(@aokf) { if ($c057{'tracking'}) { $bbc8 =~ s/page=http:\/\//page=/g; $bbc8 =~ s/page=/http:\/\/$f87k$dj6h?which=$c057{'to_lists'}-$ghko-$k89p-$dg3p&page=/; $bbc8 =~ s/address=/address=$ed48/; } $gn8b =~ s/\r//g; $gn8b .= "$bbc8"; unless ($d836 > 1) { print LOG "$bbc8"; } } $e2pf .="\r\n\r\n"; $gn8b .="\r\n\r\n"; foreach $hpo6(@kjmf) { $e2pf .= "

$hpo6

"; $gn8b .= "$hpo6"; unless ($d836 > 1) { print LOG "$hmff"; } } $e2pf .="\r\n\r\n"; $gn8b .="\r\n\r\n"; if ($c057{'unsubscribe_address'} && (!($i93h))) { $e2pf .= "

"; $e2pf .= "-" x 75 . "
"; $e2pf .= "To be unsubscribed from the $b736[1] mailing list, simply click on the link below:
"; $h27l = $ed48; $h27l =~ s/\@/\=\:/g; $e2pf .= "Unsubscribe $ed48
"; $e2pf .= "

"; } if ($c057{'no_credit'}) { $e2pf .="\r\n\r\n"; $gn8b .="\r\n\r\n"; } unless ($c057{'no_credit'}) { $e2pf .= "

This mailing proudly powered by Subscribe Me™ Professional - Enterprise Edition

\r\n\r\n"; } if ($c057{'unsubscribe_address'} && (!($i93h))) { $gn8b .= "-" x 75 . "\r\n"; $gn8b .= "To be unsubscribed from the $b736[1] mailing list "; $gn8b .= "simply click on the link below \r\n"; $h27l = $ed48; $h27l =~ s/\@/\=\:/g; $gn8b .= "http://$f87k$dj6h?r=1&l=$c057{'to_lists'}&e=$h27l\r\n"; $gn8b .= "\r\n\r\n"; } if ($c057{'no_credit'}) { $e2pf .="\r\n\r\n"; $gn8b .="\r\n\r\n"; } unless ($c057{'no_credit'}) { $gn8b .= "This mailing proudly powered by Subscribe Me(TM) Professional - Enterprise Edition\r\n"; $gn8b .= "http://www.subscribemepro.com\r\n"; } &aac("$ed48","$cp1c","$c057{'mail_subject'}","$e2pf",0,"$b736[1]","$gn8b","$doea","$bk2d"); close (LOG); unless ($c057{'testmailing'}) { &aag; } $d836++; $b3bf++; } } unlink("$memberinfo/$c057{'to_lists'}-$ghko-$k89p-$dg3p-message.txt"); $d836--; unless ($c057{'testmailing'}) { &abe; } } sub aaf{ $e09k = shift(); $e2pf = ""; $gn8b = ""; $e2pf .= "Your Subscribe Me Mass Mailing is currently in progress.\n\n"; $gn8b .= "Your Subscribe Me Mass Mailing is currently in progress.\n\n"; $e2pf .= "Your current Subscribe Me batch mailing has sent to $b3bf e-mail addresses\n"; $gn8b .= "Your current Subscribe Me batch mailing has sent to $b3bf e-mail addresses\n"; $e2pf .= "and is now on hold. The next batch of mailings will be in $c057{'every'} seconds\n\n"; $gn8b .= "and is now on hold. The next batch of mailings will be in $c057{'every'} seconds\n\n"; $e2pf .= "Automated Subscribe Me Responder\n\n"; $gn8b .= "Automated Subscribe Me Responder\n\n"; &aac("$cp1c","$cp1c","Subscribe Me Mass Mailing Status!","$e2pf",0,"$e09k","$gn8b"); } sub aae{ } sub aag{ open (MAILDIR, ">$maildir/$c057{'to_lists'}-$ghko-$k89p-$dg3p-count.txt"); if ($LOCK_EX){ flock(MAILDIR, $LOCK_EX); } print MAILDIR "$d836,$ed48,$b736[1]\n"; close(MAILDIR); } 1;