April 2010
We generate a list of mail addresses of users that have logged in during the past three months. To populate a ListServ mailing list with thes addresses, we use the script:
<snip> #!/bin/bash LUF=/tmp/distinct-users-last-x.txt # LAST-USERS-FILE rm -f ${LUF} wget -O ${LUF} http://lwp23.service.rug.nl/lwpuserlogger/distinct-users-last-x.php { \ echo 'QUIET DELETE LWPUSERS *@*' for LINE in $(cat ${LUF}) ; do echo "QUIET ADD LWPUSERS ${LINE} *" done }|mailx -s '' -c "j.bokma@rug.nl" -a "From: j.bokma@rug.nl" LISTSERV@RUG.NL
DELETE listname
*@* and add listname
mailaddress
are often used LISTSERV commands.
QUIET
means that no notification will be sent (to the mail address that is being added).
It is also necessary to set
Validate= No
in the configuration of the mailing list, otherwise reconfiguration of the list through mail will not succeed unless the request is confirmed by the list owner(s).