How do you change thunderbird temporary file storage?

I have a workaround: Thunderbird uses the standard environment variable $TMP by default to determine where to store temporary files. It also uses this folder when you select to "Open" a mail attachment.

Therefore I have simply made a simple script to set this environment variable before launching thunderbird. I have modified my thunderbird shortcuts to use this script.

#!/bin/sh
export TMP=/media/truecrypt1/scratch
nohup thunderbird &

I would still be interested if anyone else has a more elegant solution; perhaps one that only affects the storage location of "Opened" attachments.