[Mailman-Users] playing with mailcmd
Fil
fil at bok.net
Thu Feb 17 17:29:41 CET 2000
Hi,
I like to have an address list-on at server for users to subscribe by email. I
finally found how to do it: just by adding the following line in
/etc/aliases
listname-on: "|formail -I 'Subject: subscribe' |/var/lib/mailman/mail/wrapper mailcmd listname"
It evidently works with any command you might want to try (-off for
unsubscribe, -stop for nomail, etc).
* However, I have a problem with mailcmd: it seems that it takes the address
* not on the "From:" or "Reply-To:" lines, but on the "From" line. This is
* not good behaviour, as this line is quite often not the real email address
* of the user, but its POP address.
Then adding these lines automatically to the output of bin/newlist is the
following simple patch. Enjoy!
*** newlist Thu Feb 17 17:25:28 2000
--- newlist-dist Thu Feb 17 17:21:55 2000
***************
*** 110,142 ****
print '''
Entry for aliases file:
## %(listname)s mailing list
## created: %(date)s %(user)s
%(list)s "|%(wrapper)s post %(listname)s"
%(admin)s "|%(wrapper)s mailowner %(listname)s"
%(request)s "|%(wrapper)s mailcmd %(listname)s"
%(owner1)s %(listname)s-admin
%(owner2)s %(listname)s-admin
- %(on)s "|formail -I'Subject: subscribe'|%(wrapper)s mailcmd %(listname)s"
- %(off)s "|formail -I'Subject: unsubscribe'|%(wrapper)s mailcmd %(listname)s"
''' % {'listname': list_name,
'list' : "%-24s" % (list_name + ":"),
'wrapper' : '%s/wrapper' % mm_cfg.WRAPPER_DIR,
'admin' : "%-24s" % ("%s-admin:" % list_name),
'request' : "%-24s" % ("%s-request:" % list_name),
'owner1' : "%-24s" % ("owner-%s:" % list_name),
'owner2' : "%-24s" % ("%s-owner:" % list_name),
'date' : time.strftime('%d-%b-%Y', time.localtime(time.time())),
'user' : getusername(),
- 'on' : "%-24s" % ("%s-on:" % list_name),
- 'off' : "%-24s" % ("%s-off:" % list_name),
}
if len(argv) < 5:
print ("Hit enter to continue with %s owner notification..."
% list_name),
sys.stdin.readline()
sendnotice(newlist, list_name, owner_mail, list_pw)
newlist.Unlock()
--- 110,138 ----
More information about the Mailman-Users
mailing list