#392 link in approval request emails directly to the held message

Mailman 2.1
David Miller

The emails currently sent to a list moderator include a
URL you can click to go visit the moderation queue.
But it loads the entire queue. If you get a lot of
spam, you probably have a habit of just ignoring the
approval requests if they're spam. This can make the
size of your queue pretty large after a while (even if
you're using a cron job to expire old requests), and
make it difficult to find the message you want to
approve when you get one worth approving. Include in
the email is an attached email with a 40-digit token
which you can reply to and send a password in order to
approve the message. Trying to remember a list
password when I moderate 85 lists is nuts (that's what
my browser's password autofill is for), and I don't
like the idea of mailing my site password around in

The admindb interface on the Web UI already has the
ability to display a single message (when you click the
[1] or [2] in front of the subject line). So why not
use it, and have the moderator approval request mails
list link directly to that?

This patch modifies admindb in the web interface to
accept a confirmation token in the msgid parameter, in
addition to the sequence ID within the queue. It
decides which it got by checking the length (if it's 40
digits, it's a token), and if it's a token, it looks up
the sequence number and feeds that to the existing
single-message display code.

It also modifies the held message handler to add the
cookie to the variables passed to the message template,
and modifies the postauth.txt template to add that
cookie to the URL included in the email.

With this patch applied, clicking the link in the email
takes you to the single-message view in the request
queue, where you can do what you want with just that

I wrote this patch against 2.1.5 (that's what ships
with RHEL4), but it appears to apply cleanly to 2.1.7 also.


  • David Miller
    David Miller

    Logged In: YES

    Also of note, I only modified the English template... if
    you use other languages (or if this gets taken for a
    release) the same modification will need to be made to the
    postauth.txt template in the other language directories as well.

  • David Miller
    David Miller

    Logged In: YES

    OK, after discussion on IRC, I've modified the patch a bit...

    In order to avoid modifying localized templates, it now
    modifies the admindb_url variable before passing it to the
    template. Also cleaned up some leftover debugging messages.

  • David Miller
    David Miller

    patch to add direct link to held message to approval request mail