Fortune Cookie Signature for Thunderbird
I’ve been using Thunderbird to take care of my emails lately, I’ve found I like using a mail client with IMAP slightly better than logging onto web mail interfaces. As such, I’ve been customizing Thunderbird to be exactly what I like it to be. I decided I wanted my signature to be my name, email address, and a different saying each time.
Here’s how I customized my signature in Thunderbird to auto-rotate fortunes.
First of all, I wrote a short script:
#!/bin/sh NAME="<big>Kevin DuBois</big>" EMAIL="kdub432@gmail.com" FORTUNE="<small><em>"`/usr/games/fortune -n 80 -s`"</em></small>" echo <html><body>"${NAME}${EMAIL}${FORTUNE}"</body></html> > /home/kdub/docs/signature.html
This script creates the signature I wanted whenever its run, with a different 80 character or shorter fortune attached to the end. I used the classic program “fortune” (included by default on most distributions) to generate the fortune. They’re all pretty creative fortunes, of equal or higher quality than you’d find in a fortune cookie. :P
Next, to make this rotate fortunes, I added this script to crontab…
Run
crontab -enext, add
*/5 * * * * /home/kdub/source/scripts/fortune.sh
Note:For both this, and the script, adjust pathnames accordingly to where you want the signature file to live, and where you want the script to live. As you see, I keep my signature file in ~/docs and my script in the directory I keep my scripts.
Finally, navigate to “Account Settings” in Thunderbird’s menus, and add the html file the script generates as your signature. See screenshot for where this is done. (Click to enlarge) 
With this, every time you write a new email, you’ll have a new fortune to send, auto-provided for you!
Side note: Be careful if you’ve installed the “offensive fortunes pack”. (Debian package ‘fortunes-off’).




July 17th, 2009 at 10:12 am
echo “${NAME}${EMAIL}${FORTUNE}” > /home/kdub/docs/signature.html
Should be
echo ‘”${NAME}${EMAIL}${FORTUNE}”‘ > /home/kdub/docs/signature.html ?
Also HTML emails gross :)
July 17th, 2009 at 10:13 am
oops, the html formatting…. Either way, I meant to just say you need to put ”’ around the echo html code.
August 2nd, 2009 at 1:35 am
That’s quite an original idea. Well done.
August 5th, 2009 at 6:38 pm
I’ve had a quick look at your site, it looks very interesting. Maybe you’d like to send a synopsis through for us to publish for you? Please make it as factual as possible and include a short bio of yourself and a link to your site at the end.