Archive for the ‘evolution’ Category

Howto: Random E-mail Signature in Evolution

Thursday, October 18th, 2007

I include Latin phrases in my e-mail signature at work. It’s a fun little thing I do just to make people interested.

So I decided to make a signature that would include a random Latin phrase in every e-mail I send. Thankfully, Evolution makes this easy.

First, I make a text file which I call sigquotes.txt , and stash it in my home directory, under a folder for personal items. I put one quote per line.

Next, I have to write a little ditty to grab a random line from that file and output the results. I used PHP for this, but almost anything could have worked. I dump the following into sigrand.php :
<?
$quoteFile = "/home/icanhaslinux/personal/sigquotes.txt";

$fp = fopen($quoteFile, "r");
$content = fread($fp, filesize($quoteFile));
$quotes = explode("\n",$content);
fclose($fp);

srand((double)microtime()*1000000);
$index = (rand(1, sizeof($quotes)) - 1);

echo "________<br>LightningCrash<br>Resident Unix Witchdoctor<br><br>";
echo $quotes[$index] . "<br>";
?>

Easy enough. I had problems getting the php itself to run as a script, so I had to make another short script to launch the PHP file. I put the following into sigrand.sh :

/usr/bin/php5-cgi -q /home/icanhaslinux/personal/sigrand.php

I chmod +x sigrand.sh and go on my way to the next step.

I fire up Evolution, go to Edit->Preferences. I go to Composer Preferences and click on Signatures. Then I click on the “Add Script” button, name it Random Latin, navigate to /home/icanhaslinux/personal, and select sigrand.sh as my signature script.

That part is done. Now to make it default for my outgoing e-mail. From the Preferences page, I click edit on my e-mail account. On this page, I have a drop-down box where I can select my signature for this account. I select Random Latin, of course. I then click OK and Close.

Now, to test it out, just fire up a new e-mail.

Until next time!
-LightningCrash

EDIT:   It’s been requested that I make clear what license this code is issued under. I consider the code snippets on this article to be public domain and not subject to licensing. Use the code in this article as you see fit.

Getting Evolution mail into Gmail

Friday, August 24th, 2007

Recently, I got into the Gmail kick and decided to get all of my POP e-mail accounts pointing to Gmail. The search functionality just really made it worthwhile.

However, I was posed with a problem: I had almost 2 years worth of e-mail in Evolution. How do I get my Evolution Inbox to the land of Gmail? (Oddly enough, a lot of this e-mail went from Outlook 2003 -> Thunderbird for Windows -> Evolution)

Fortunately, Evolution makes this easy for sysadmin types. Evolution will export e-mail in mbox format.

In Evolution, you’ll want to dump all of your e-mail back into one folder, if you had filters that sorted it to hell and back. Then, you’ll want to hit Select All, and then File->Save Message. Name it something meaningful, and add .mbox on the end if you wish. I compressed the little booger into a tarball and then gzipped it.

Now on my e-mail server, which runs Qpopper and Exim, I made a new e-mail account. I uploaded the mbox archive to my home directory on my mail server, extracted it, and shoved it over to the /var/spool/mail directory in place of the original spool file for the new account I made.

Then I just pointed Gmail at the new account. Presto! I have all of my old e-mail in Gmail.

I really can’t believe I didn’t think of it before.

I’m considering offering a free service where you can upload an mbox file into a webapp, and then a temporary POP account from that mbox will be made just so you can pull the e-mail in to Gmail or etc.

Leave me your thoughts in the comments!