Fortune Cookie Signature for Thunderbird

Credit: http://oygirl.files.wordpress.comI’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="Kevin DuBois"
EMAIL="kdub432@gmail.com"
FORTUNE=""`/usr/games/fortune -n 80 -s`""
echo "${NAME}${EMAIL}${FORTUNE}" > /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. 😛

Next, to make this rotate fortunes, I added this script to crontab…
Run

 crontab -e

next, 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) Email Screenshot

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’).

This entry was posted in Open Source, Random. Bookmark the permalink.

6 Responses to Fortune Cookie Signature for Thunderbird

  1. drubin says:

    echo “${NAME}${EMAIL}${FORTUNE}” > /home/kdub/docs/signature.html
    Should be
    echo ‘”${NAME}${EMAIL}${FORTUNE}”‘ > /home/kdub/docs/signature.html ?

    Also HTML emails gross 🙂

  2. drubin says:

    oops, the html formatting…. Either way, I meant to just say you need to put ”’ around the echo html code.

  3. tekkie says:

    That’s quite an original idea. Well done.

  4. Zashkaser says:

    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.

  5. Tobia Tesan says:

    Nice tip, thanks a lot!
    Wouldn’t it make more sense to save the signature in RAM (/dev/shm for most distros, or you can add a tmpfs entry in /etc/fstab), though?

  6. theninja says:

    Awesome, thanks for posting this guide! We’re using this in our computer repair shop to give tech tips in our email signatures. Instead of using cron, you can use inotify-tools to change the signature every time the signature file is accessed (meaning you get a different signature each time you compose an email).

Leave a Reply

Your email address will not be published. Required fields are marked *