View Full Version : ez mlm subscribe script
jelevin
10-16-2001, 08:59 AM
I would like to tweak the web-based subscription process by modifying the /cgi-sys/ezmlm/SelfServ.pl script. Does anyone know how I can view the perl source code?
Thanks.
Justin
10-16-2001, 03:15 PM
I'll check to see if we've ever made that available or not, but if I recall (it's been a while), it's simply a modified mail form. What it does is sends a message to "listname-subscribe@domain", setting the "From:" address to what the user entered. You could very easily do this in PHP or Perl/sendmail, either from scratch or by modifying any one of the thousands of FormMail-type scripts available.
In any case, I'll check to see if we've ever made that script publically available or not... it was built in around 1998 and modified in '99, and that was the last time I touched it :)
Terra
10-16-2001, 04:56 PM
The SelfServ.pl script is not publicly available, nor was it ever written/intended to be...
You should be able to look at the raw HTML Form code and reverse engineer to write your own script...
--
Terra
sysAdmin
FutureQuest
jelevin
10-16-2001, 09:46 PM
I tried Justin's suggestion, but the ez-mlm tries to subscribe webmaster@mydomain instead of the "From: " address.
This is an automated message from the
safetylist@createsafety.net mailing list.
To confirm that you would like
webmaster@childrensonline.org
...stuff deleted...
--- Below this line is a copy of the request I received.
Return-Path: <webmaster@childrensonline.org>
Received: (qmail 14750 invoked by uid 40101); 17 Oct 2001 01:38:20 -0000
Date: 17 Oct 2001 01:38:20 -0000 Message-ID:
<20011017013820.14749.qmail@six.futurequest.net> From: jlevin@usa.net To:
safetylist-subscribe@mlm.childrensonline.org Subject: Subscribe to
safetylist (from script)
automatic e-mail
Any suggestions?
sheila
10-16-2001, 09:49 PM
How come your message headers like "From" and "Subject" don't appear on a new line, each? Without seeing your script, it is kind of hard to guess what the problem might be, but I wonder that it might not be that you are sending an incorrectly formatted email message? Each of those email message headers should be on new line. The ezMLM software is possibly unable to determine the From address because of your formatting???
Just a wild stab...
jelevin
10-17-2001, 12:13 AM
Thanks for the stab, but I think I figured it out. It's not really the From: header that matters. In order to subscribe name@domain the To: address needs to be
mylist-subscribe-name=domain@mydomain
Bruce
10-17-2001, 12:19 AM
Originally posted by jelevin:
I tried Justin's suggestion, but the ez-mlm tries to subscribe webmaster@mydomain instead of the "From: " address.
Return-Path: <webmaster@childrensonline.org>
From: jlevin@usa.net
ezmlm tries to subscribe the envelope sender address (as indicated by the "Return-Path:" line above), and does not do any scanning of the headers for an email address. To subscribe an arbitrary address, as you discovered, send an email to list-subscribe-username=domain@yourdomain.tld
jelevin
10-17-2001, 08:02 AM
Thanks bruce. My project is to create e-mails inviting folks to subscribe containing clickable links in the form of
http://mydomain/cgi-bin/sub.pl?name@domain
Here's the perl script I put together. I wasn't sure about the e-mail validation part so it is commented out.
#!/usr/bin/perl
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
$mailprog = "|/usr/lib/sendmail -oi -t -odq";
print
header,
start_html("Subscribe to Children's safetylist"),
h1("Subscribe to Children's safetylist");
if (my $error = validate_input()) {
print "Error: $error for $ENV{'QUERY_STRING'}";
print end_html;
} else {
show_thank_you();
print end_html;
mail_request();
}
sub validate_input {
#require Email::Valid;
#validate e-mail address if possible
#return "Bad email address syntax"
# unless Email::Valid->address($ENV{'QUERY_STRING'});
return; # undef says good
}
sub show_thank_you {
print "E-mail address is ", $ENV{'QUERY_STRING'};
$email = $ENV{QUERY_STRING};
$email =~ s/\@/=/;
#print "E-mail address is ", $email;
#print p, "Mail program is ", $mailprog;
print p, "Thank you! You should receive an email confirmation shortly.",
p, "To activate your subscription send a blank reply to this confirmation message.";
}
sub mail_request {
$email = $ENV{QUERY_STRING};
$email =~ s/\@/=/;
open SM, $mailprog
or die "Cannot launch sendmail: $!";
print SM <<END;
From: $ENV{QUERY_STRING}
To: safetylist-subscribe-$email\@mydomain.org
Subject: Subscribe to safetylist (from script)
(automatic e-mail)
END
close SM;
die "sendmail exited with $?" if $?;
}
vBulletin® v3.6.8, Copyright ©2000-2013, Jelsoft Enterprises Ltd.