[rt-devel] Contrib: CreateMessageId (RT2.0)

Bruce Campbell bruce_campbell at ripe.net
Thu Apr 25 07:39:16 EDT 2002

The attached perl script will update the Attachments.MessageId field of
all attachments in an RT database which:

	*) Are a parent attachment (the first one)
	*) Have a Message-Id header in the 'Headers' field
	*) Do not have the MessageId field set (IS NULL)

This is intended to be run on an existing RT database to flesh out
MessageId fields that previously were not set.  Suggested one-off running
method is:

	# While we're still getting output (ie, updating the db)
	while [ "`perl CreateMessageId.pl | wc -l`" -gt "1" ] ; then
		# Sleep for 10 seconds to avoid overloading the database.
		sleep 10

You will need to edit CreateMessageId.pl to refer to your local RT
libraries (see the '!! CHANGEME' lines)

Note that you will need to ensure that your lib/RT/Attachment.pm has been
updated in the following fashion:

> Caution: You will need to allow write access to the MessageId field in the
> _ClassAccessible method of RT::Attachment .  You must know what you are
> doing to take this step, or have certif{ied/able} RT technicians standing
> by.

                             Bruce Campbell                            RIPE
                   Systems/Network Engineer                             NCC
                 www.ripe.net - PGP562C8B1B                      Operations

More information about the Rt-devel mailing list