[Mailman-Users] Sequence numbers

Ken Manheimer klm at cnri.reston.va.us
Thu Jan 7 00:39:37 CET 1999


On Wed, 6 Jan 1999, Barry A. Warsaw wrote:

> >>>>> "FC" == Francis Cook <francis at compsoc.man.ac.uk> writes:
> 
>     FC> I was wondering if there was a way of putting a sequence
>     FC> number on the subject line of the list messages. The system we
>     FC> have been using is that every mail message gets a sequence
>     FC> number put in the header or subject line so we can refer to it
>     FC> easily eg:
> 
>     | [maillist msg: 1]
>     | [maillist msg: 2]
>     | etc...
> 
>     FC> How would I go about doing this in Mailman ?
> 
> There's no support for this, but it probably wouldn't be too hard to
> hack in.  You'd probably add this to MailList.Post(), and you'd
> probably want to add a new attribute to the class which is the
> sequence number.  This would get incremented for every message and
> saved to the list's database file.

In fact, a new attribute isn't needed - maillists already maintain a
data member, 'post_id', that's incremented with every posting to a list.
It's used particularly for bounced message tracking, but is incremented
in the .Post() routine barry mentions.  And there's also already some
code in .Post() which does some manipulation of the subject line (look
in the routine for the var 'subject_prefix').  It would be trivial to
include the post_id.  Note that since it's a float, to allow for large
numbers, you'll probably want to use something like:

	str(long(self.post_id))[:-1]

to allow for as large floats as there could be, and pull off the 'L' at
the end of the string representation.

Ken







More information about the Mailman-Users mailing list