Showing posts with label email. Show all posts
Showing posts with label email. Show all posts

Wednesday, December 13, 2006

Removing an Address Book from Thunderbird

Thoroughly use and test a couple dozen email programs and you'll find few better than Thunderbird. Maybe one will have an editor you like better. Maybe another is geekier, in the sense that you can navigate everywhere without touching the mouse. There may well be an email client that allows you to easily send automated emails or to harvest email addresses from mail received. But Thunderbird does a lot well and comfortably. If you're a beginning or average or even an advanced email user and want to use just one email application for all normal email needs, Thunderbird's not a bad choice.

As much as Thunderbird has to offer in ease of use and functionality, it doesn't have the best interface for managing multiple address books or even managing just one address book with multiple email accounts. One significant feature Thunderbird lacks is the ability to completely remove one of several address books.

If you have an address book you no longer need and is just getting in the way, you'll find no button to click nor any menu item for deleting it. You'll have to resort to hand-editing files, files which, moreover, aren't really designed for humans to open up and make changes to. In fact, at the top of the file we'll be editing it says, "Do not edit this file." Actually we'll be following that warning because we'll be creating a new file and editing that one.

Screenshot showing multiple address books in Thunderbird.
Figure 1. Screen shot of the upper-left corner of Thunderbird's Compose window, after clicking on the drop-down menu of address books. Everything but the drop-down menu is dimmed. This graphic shows eight address books, one of which will be removed. Because Thunderbird allows the configuration of windows in several different ways, your Compose window may look different from this.

The first thing to do is to identify the address book to be removed. This is easy. Type Alt-n to open the "Compose" window as if you were writing a new message, click on the bar below "Address Book", and in the dropdown menu (shown in the graphic to the left) note the name of the address book to be removed. In this exercise we'll be removing the one called "dems".

The next thing to do is to shut down Thunderbird. This is necessary because Thunderbird writes updates to various files while running, including files we'll be editing. To avoid having our edits overwritten by a running Thunderbird, click File | Quit.

Now we need to find the appropriate files to edit, prefs.js and one other one. These are generally put into a directory (or "folder") under one called .thunderbird under your home directory. But this directory can have different names, and even different locations, depending upon how you configured Thunderbird and which operating system you're using. So go to a terminal window and type

find ~/.thunderbird -name prefs.js

Using the cd command, go to the directory where this file is found (or, if you find more than one prefs.js, its most recent instance). The directory in question on my Thunderbird installation (version 1.5.0.8 on Linux) is under the ~/.thunderbird directory, specifically, it's ~/.thunderbird/cx7ws9zz.default; the actual name of this second directory on your machine will almost certainly be different.

Note for MacIntosh and Windows users: The few commands used here— find, ls, mv, and grep— are basic commands used in Linux and UNIX. If you're working on a Mac with OS X, you already have versions of all these commands, so you need only to open up a terminal window and type them in. Windows users can probably make due with its search utility and the DIR and REN commands. Users of either of these operating systems, and others even more obscure, can obtain GNU versions of these commands (and many other handy tools) free of cost in packages available at http://www.gnu.org/software/coreutils/coreutils.html, http://directory.fsf.org/grep.html, and http://directory.fsf.org/findutils.html.

The files listed there— displayed by the ls command— are those below. You should have pretty much the same.

$ ls
6400567.s        compatibility.ini  ImapMail        panacea.dat
abook-1.mab      components.ini     impab-1.mab     persdict.dat
abook-2.mab      compreg.dat        impab-2.mab     pgprules.xml
abook-3.mab      cookies.txt        impab.mab       prefs.js
abook-4.mab      defaults.ini       install.log     prefs.js.bak
abook-5.mab      downloads.rdf      key3.db         secmod.db
abook-6.mab.bak  extensions         localstore.rdf  training.dat
abook.mab        extensions.cache   lock            US
abook.mab.bak    extensions.ini     Mail            virtualFolders.dat
cert8.db         extensions.rdf     mailViews.dat   xpti.dat
chrome           history.mab        mimeTypes.rdf   XUL.mfasl

Before altering prefs.js at all, we'll run cp prefs.js prefs.js.bak to make a backup copy of it. This backup file is just a precaution, used only in the event we want to undo the changes we'll be making. Next we take a peek into prefs.js to find the name of the address book we want to get rid of. Doing a grep of prefs.js for the name of the address book (dems), as below, will show the several lines you'll need to delete:

$ grep dems prefs.js
user_pref("ldap_2.servers.dems.description", "dems");
user_pref("ldap_2.servers.dems.dirType", 2);
user_pref("ldap_2.servers.dems.filename", "abook-5.mab");
user_pref("ldap_2.servers.dems.isOffline", false);
user_pref("ldap_2.servers.dems.protocolVersion", "2");
user_pref("ldap_2.servers.dems.replication.lastChangeNumber", 0);

Take note of the third line, the one specifying the filename, here abook-5.mab. Whatever filename is given in this line of your output will be dealt with shortly.

Note concerning Windows editors: This prefs.js file is an example of what is known as a "flat ASCII file," that is, a file containing at most only the 128 characters used in the first days of the personal computer. An editor such as Microsoft's Word silently and secretly and automatically inserts many other kinds of characters into a file during editing. For our purposes here this is not good, not good at all. So to avoid turning your file into garbage, use a different editor, one which will not corrupt the file with non-ASCII characters. Emacs is a great alternative, another GNU product, and an editor which handles just about any kind of file you might want to throw at it. It's open source, available for just about every operating system on the planet, and free and available right now at http://www.gnu.org/software/emacs/.

Next fire up your best editor, delete the six lines grep told us about, and save and close the file. Be sure to remember the name of the filename (e.g., abook-5.mab) because the next step is to rename it, like so:

mv abook-5.mab abook-5.mab.bak

Now you can restart Thunderbird. Check to ensure that the address books are functioning as desired and that only the correct one has been deleted. If everything is working fine— and you can take your good time to ascertain this, even a week or two— you can safely remove the two bak files you created.

And you're done. Reflect a moment on the methods used here, like giving a file a different name instead of deleting it and creating a backup file before making any changes to a critical file. These precautions mean that if something goes wrong, it's possible to put the files back to how they were previously. Having a way certain to back out of changes made also means that you can be more adventurous with your system, and make changes just to see what they will do. This will enable you to play around more with your system, learn more about it, and make it work the way you want it to. Learn to do this and you've done more more than simply learn how to delete an address book. You're on the way to becoming a savvy hacker.

Wednesday, October 11, 2006

Modifying Thunderbird's Reply Header

Mozilla Thunderbird is an email program which is feature rich, user friendly, and free. Brought to you by the Mozilla Foundation, it's an open source product that runs on Linux, Windows, and MacIntosh OS X. Configuring some of Thunderbird's more obscure features can be a bit tricky, or at least not obvious without some relevant documentation. Configuring the "reply header" is one of these.

What's a Reply Header?

When you reply to an email in Thunderbird, you can include the text of the email you're replying to. This is referred to as "quoting" and the text of the message you're replying to is called the "quote". After you click on the Reply button to open up a window in which to compose your reply, but before you even begin typing, the body of the message of the email to which you're replying will be automatically inserted into your Compose window. (If Thunderbird isn't doing this for you, go to Edit > Account Settings... > Composition & Addressing and check the box next to "Automatically quote the original message when replying".)

Say you want to reply to an email from your good friend Angelina Jolie. You've hit Reply and Thunderbird has opened the Compose window, and the text of the email you're replying to, the "quoted text", has been magically inserted. There'll also be a line like Angelina Jolie said: automatically generated and placed immediately above what Angelina Jolie wrote to you. This is the reply header. Personally, I like to have the date and time included in the reply header, as in

Angelina Jolie said on 10/09/2006 10:38 AM:

because it reminds me, and Angelina too, when she sent me her email. There's a thousand reasons why this is a good idea, most of which are based on the premise that good communication requires context. Unfortunately, including the date and time in the reply header isn't the default behavior for Thunderbird. Moreover, Thunderbird doesn't provide any documentation on how to configure it, nor is it at all intuitive to figure out. So in the interest of better communications, here's how it's done.

Accessing the Preferences

In the Thunderbird main window (or the Compose window), go to the "Edit" menu, select "Preferences" to open up the preferences window, click on the "Advanced" icon (the gear) top-right, and then, if necessary, on the "General" tab. In this view, click on the button which says "Config Editor...". This will bring up the "about:config" window. In the text box at the very top of it type in "reply" (without the quote marks). This will, in effect, do a search on all the preferences containing the word "reply" and therewith narrow down the number of items you'll have to scroll through to find the ones you'll need to change. Here's the preference items we'll need to concern ourselves with:

Preference Name  Value
mailnews.reply_header_type  3
mailnews.reply_header_authorwrote  %s wrote
mailnews.reply_header_ondate  on %s
mailnews.reply_header_separator   
mailnews.reply_header_colon  :

For brevity's sake, a couple nonrelevant columns have been left out of the table above.

The values listed in the table above will probably be different from the ones you have. If you did have the same values as those above, your reply header would look something like this:

Angelina Jolie wrote on 10/09/2006 10:38 AM:

To make a change to a preference, right-click on it to bring up a small pop-up window. This little window will give some editing options: "Copy Name", "Copy Value", "New", "Modify", and perhaps "Reset". Click on "Modify". This will bring up another little window with text in an edit box containing that preference's current setting. Just edit it to look how you you want it to be.

For example, if you do the above to edit the Value for "mailnews.reply_header_authorwrote", it'll probably say "%s wrote" (without the quotes). If, instead of "Angelina Jolie wrote" you'd prefer that the reply header said "Angelina Jolie has written", then type in "%s has written", without the quotes but with the "%s" characters; these two characters are code for the sender, or more precisely, whatever is specified in the "From:" field of the email you are replying to.

Proceed in a similar way to make any other desired changes. For the mailnews.reply_header_ondate preference, again, the "%s" characters are code; in this preference they stand for the date and time. So be sure to include these two characters when you edit this value; "on %s" is an obvious candidate for this preference's value.

Though you might not be able to see it, the value of the mailnews.reply_header_separator preference is a space character. As you might guess, this value specifies the character(s) you want to be used to separate the two parts of the reply header just mentioned. Most people will use a single space character here, but it can be given other characters and more than one of them. Whatever other characters you might enter here, just be sure that the first and last of them is a space character. Otherwise you'll have words running together.

The final character(s) of the reply header will be whatever you specify for mailnews.reply_header_colon. By default it is the colon character (:). But if you wanted to express some creativity, you could set it to something else. For instance, set this preference to ", then wrote no more:" and your reply header will look like this:

Angelina Jolie wrote on 10/09/2006 10:38 AM, then wrote no more:

Last but not least, the value of mailnews.reply_header_type must be the number 3 if you want the sort of reply header shown above. If you enter a 2, then in your reply header the value in mailnews.reply_header_ondate will precede whatever you have for mailnews.reply_header_authorwrote. That is, your reply header will say, on 10/09/2006 10:38 AM Angelina Jolie wrote:. Perhaps this is precisely what you want. But if so, you will probably want to capitalize the first character in the date expression, i.e., make it On %s instead of on %s.

When you've finished making all your changes, click on the "X" in the upper right of the "about:config" window to close it. Your changes will be saved automatically and become effective immediately. Click on "Close" to close the "Thunderbird Preferences" window and return to the Thunderbird main window. Now you're ready to reply to an email and see your new reply header. Give it a try.

Fun and Danger

As you might imagine, you can do a lot with just these five variables and have a lot of fun with them. But remember that whatever reply header you set up will be included in every email reply you send. (Of course you can always edit the reply header for an individual email when it's in the Compose window, but you can forget to do this also.) Something with a comical flair that you might configure now might not seem comical at all to your boss or professor or teacher or someone you're trying to favorably impress. Someone not familiar with email might not understand that a reply header is automatically generated and so doesn't specifically refer to them. Moreover, if you have more than one email address set up in Thunderbird— perhaps one for work or school and another for personal use— the same reply header will be used for each. Thunderbird doesn't currently offer the ability to configure separate reply headers for different email addresses. While creating your reply header, keep all this in mind.

Finally, don't worry about messing things up or breaking Thunderbird so it doesn't work anymore. You can always go back to the small pop-up window mentioned above and click on "Reset" to put any preference value back the way it was before you started. You could even reset all of them and thus, in effect, start over again from the very beginning. The Mozilla folks made it so that anything you do here, whatever silly mistake you might make, can be easily fixed. So don't worry about a thing. Have at it and have fun.

© K e n F i s l e r, 2006. All rights reserved.

5 free Domains with Select Hosting Plans. Get yours!