[Mailman-Users] Re: Posting to list via mailman archives

Paul H Byerly paul at thcwd.com
Mon Jun 2 18:57:59 CEST 2003

Steve  wrote:
>I'm wondering if anyone has ever set up their mailman archives so
>that people can reply to list messages directly from the web page. I
>know it would be trivial to add a mailto link to the list address on
>the archive html pages, but I'm thinking more like some sort of
>script that would not use mailto -- instead it would provide a text
>edit box to the user, and when they clicked "send" a well-formed mail
>would be sent to the list address, with the appropriate subject line,
>correct headers, etc.

      I'm working on it and am part way there.  I'm using Matt's formmail 
script <http://www.scriptarchive.com/formmail.html>.  The script is set to 
only accept mail to my server, so I think it's secure.
      I have private archives, and I pick up the users e-mail with a cookie 
when they log in.  The mail is sent with that e-mail address, so it shows 
from them on the list, and it is moderated or not depending on how the 
individual e-mail is flagged.
      I have not had a chance to dig into it, but I think the subject and 
quote can be done with information available from mailman.

      To start with you want Richard Barrett's patch 
that allows you to use modified templates 
in   $prefix/lists/<listname>/<language>/

      Below is what I have in the private.html file.  This grabs the user 
e-mail when they log in:
     <title>%(realname)s Private Archives Authentication</title>
   expireDate = new Date

   userName = ""
   if (document.cookie != "") {
     userName = document.cookie.split("=")[1]

   function setCookie() {
     userName = document.myForm.username.value
     document.cookie = "userName="+userName+";expires=" + 
<body bgcolor="#ffffff">
<FORM NAME=myForm METHOD=POST ACTION="%(action)s/">
         <B><FONT COLOR="#000000" SIZE="+1">%(realname)s Private
             Archives Authentication</FONT></B>
         <TD><div ALIGN="Right">Email address:</div></TD>
         <TD><INPUT TYPE="text" value="enter e-mail here" name=username 
       <TD><div ALIGN="Right">Password:</div></TD>
       <TD><INPUT TYPE="password" NAME="password" SIZE="30"></TD>
       <td colspan=2 align="middle"><INPUT type="SUBMIT"
                                           value="Let me in...">
       <p><strong><em>Important:</em></strong> From this point on, you
       must have cookies enabled in your browser, otherwise no
       administrative changes will take effect.

       <p>Session cookies are used in Mailman's
       administrative interface so that you don't need to
       re-authenticate with every administrative operation.  This
       cookie will expire automatically when you exit your browser, or
       you can explicitly expire the cookie by hitting the
       <em>Logout</em> link under <em>Other Administrative
       Activities</em> (which you'll see once you successfully log in).


      Copy article.html from templates into 
$prefix/lists/<listname>/<language>/  and make what ever changes you want 
to add a link to the posting form on the bottom of each archived post.  I did:

<a href="/mailman/private/<listname>/webpost.shtml">Reply</a>

      Then in $prefix/archives/private/<listname> I have the following 

eMail = (document.cookie.split("=")[1]).split(";")[0]
    if  (document.cookie != "") {
    document.write("You are logged in as: "+ eMail)

function delCookie () {
  if (document.cookie !="") {
    if (confirm("Do you want to delete the cookies?")) {
      thisCookie = document.cookie.split(";")
      expireDate = new Date

     for (i=0; i<thisCookie.length; i++) {
        cookieName = thisCookie[i].split("=")[0]
        document.cookie = cookieName + "=;expires=" + expireDate.toGMTString()
     document.write ("<H1>Number of cookies deleted: " + thisCookie.length 
+ "</H1>")

function fillForm ()  {
document.theForm.email.value = eMail
   <TITLE>Web Posting Form</TITLE>
<P ALIGN=Center>
<p align="center"><a href="#" onClick="delCookie()">Click here to log out.</a>
<P ALIGN=Center>
                         Post from web form for Mailman.<br>
       <TD>&nbsp; &nbsp; This form now takes the "from" e-mail from a 
cookie that is formed when the e-mail and password
are entered!!
         <P ALIGN=Left>
         <FORM NAME=theForm ACTION = "http://SERVER 
NAME/cgi-bin/FormMail.pl"  METHOD = "POST">
           <INPUT type=hidden name="recipient" value="LIST ADDRESS">
           <INPUT type=hidden name="redirect" value="URL OF PAGE TO GO TO 
           <INPUT type=hidden name="email" value="">
           <INPUT type=text name="subject" value="">
           <TEXTAREA NAME="-" ROWS="16" COLS="60" 
           <INPUT TYPE=reset value="Reset">
           <INPUT TYPE=submit value="SEND IT!">

      This is rough, and still has some working notes imbedded in it, but 
it should get you going.  Contact me off list if you need to.  And if you 
have any ideas on picking up subject and quote let me know.

<>< Paul 

More information about the Mailman-Users mailing list