LSTOWN-L Archives

LISTSERV List Owners' Forum

LSTOWN-L

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Barak Moshe <[log in to unmask]>
Thu, 13 Feb 1997 13:54:02 +0200
TEXT/PLAIN (117 lines)
Hello all..
As promised, here are the instructions on how to implement subscribing to a
list from the web, with just a click or two.
The Author and the man behind the idea is Dr. Joseph (Yossi) Gil from
the Faculty of Computer Science here. ([log in to unmask])
As he is very busy, he has specifically asked not to send him mail
with questions about this....
Hope you enjoy it!
Moshe



So here it goes as Yossi put it (with some minor modifications):


The idea behind the script is simple.

1. First create a dedicated email account that will do listserv
processing. In this example, it is yogiprint. (this could of course be a mail
alias - no need for a 'real' account here)

2. Second create a .forward file in that account. Here is a sample
such file. The crucial point is to forward via the "|" mechanism
to the main script enclosed below.


"|/home/yogi/printme/forward", \[log in to unmask]

The above also records the messages in my email account for
logging and debugging. But this is not strictly necessary.

3. Create the following script. It is written in awk for simplicity,
but it can be rewritten in Perl for efficiency and generality. It
would be rather simple to generalize it to do other commands, e.g.
subscribe to any list in the world, and/or issue other commands.  The
key idea is to take commands from the Subject line, move them to the
content line, and remove few redundant Header lines.


#!/bin/nawk -f
BEGIN {
        address = "[log in to unmask]"
}
NF == 0 {
        exit
}
$0 ~ "^Subject: Subscribe MYLIST-L$" {
        action = "sub";
        print "action is subscribe"
}
$0 ~ "^Subject: Unsubscribe MYLIST-L$" {
        action = "signoff";
        print "action is unsubscribe"
}
$1 == "To:" {
        $0 = "To: " address
}
$1 ~ "^Content.*:" {
        next
}
$1 ~ "^MIME.*:" {
        next
}
{
        buff = buff $0 "\n"
}
END {
        if (!action)
                exit;
        buff = buff "\n\n" action " MYLIST-L"
        sender = "/usr/lib/sendmail "  address
        print buff |sender
        print "buff = " buff
        print "sender = " sender
}


-- End of Script


The source of the relevant parts of the web page reads like this:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
Stuff deleted....
   <TITLE>MYLIST: MYLIST Reading Assembly</TITLE>
<UL>
<LI>Online subscribtion to the MYLIST mailing list: <A HREF="listserv.html">electronic
mailing list</A>. </LI>

<P><FORM
        method="post"
        action="mailto:[log in to unmask] MYLIST-L"><B><FONT SIZE=+1>Subscribe
to MYLIST with a click!</FONT></B> <INPUT type="submit" value="Subscribe"></FORM><I>Hit
OK if your browser presents a dialog box verifying email submission of
a a form data. <BR>
You will get a request for confirmation of your subscription by return
email. </I><BR>
<BR>
<BR>
</P>

<P><FORM
        method="post"
        action="mailto:[log in to unmask] MYLIST-L"><I><FONT SIZE=-1>You
can also cancel your subscription from here: <INPUT type="submit" value="Unsubscribe"></FORM></FONT>(Same
procedure as subscription)</I><BR>
<BR>
<BR>
</P>

<P>If the above buttons do not work for you, you may want to try more <A HREF="listserv.html">conventional
subscription methods</A>. </P>
Stuff deleted....

ATOM RSS1 RSS2