Turn Thunderbird into the Ultimate Gmail IMAP Client

Article Source

"


Gmail's IMAP support roll-out this week had nerds all atwitter about the possibility of synchronized email access across devices, computers, and clients. IMAP is far superior to regular old POP for fetching your messages and maintaining your folder list whether you're on your iPhone, office or home computer. If IMAP's got you curious but you're not sure what desktop application to use with Gmail, consider the extensible, fast, cross-platform and free Mozilla Thunderbird, our beloved Firefox's little sibling. Here's how to get the full Gmail experience in Thunderbird with IMAP.

What's IMAP?

Internet Message Access Protocol (Wikipedia page) enables email programs to read messages stored on the server. Unlike POP, with IMAP it's as if you're browsing a network drive of files on a remote server with an open, live connection to that server; whenever you open a folder or view a message, it's displayed from that server live. IMAP maintains a constant connection with your server and updates real-time.

Why is IMAP better than POP?

POP downloads and copies new messages to your local inbox. With POP you can download once and disconnect from the server, which is its one advantage. But you cannot download messages that have already been archived and labeled in Gmail via POP, and your client has to poll the server to get new messages. With POP access, if you move a message to a folder or star it in your desktop client, that change is not reflected in Gmail and your messages get out of sync. Any rules or mail filters you set up on one machine with a POP client have to be set up and reprocessed with a fresh download on all your other machines.

Think of POP as copying files from a server to your computer and working with them on your hard drive. Think of IMAP as connecting to a remote server and working with the files saved there.

Why Thunderbird (and not Mail or Outlook)?

We're naturally biased towards open source software here at Lifehacker, but there are good reasons why Thunderbird is the best desktop client choice out there for Gmail IMAP access:

Set up Thunderbird correctly for Gmail IMAP

First things first. Once you're fetching your email via IMAP with Thunderbird (here's Google's tutorial on how to do that), there are two settings you'll want to set manually: specifically, where Thunderbird should store sent messages and drafts. In your IMAP account settings, the Copies & Folders area, be sure to change the default location for Sent and Drafts to [Gmail]/Sent Mail and [Gmail]/Drafts respectively, as shown.

tbird%5BImap%5Dfolders.pngEven after you do this, you'll notice a few strange labels in your Gmail account: [Imap]/Sent, [Imap]/Drafts and [Imap]/Trash. These are Thunderbird's default Sent, Drafts, and Trash folders. Once you make the change to your account settings, you can delete those labels in Gmail and they won't get regenerated. (Note: except for [Imap]/Trash, which I can't rid myself of entirely, since T-bird seems married to it. Bueller? Update: see the next section for the solution to the [Imap]/Trash label.)

Set Thunderbird to use Gmail's Trash folder (UPDATE)

Reader Vanl explains how to set T-bird's trash folder correctly, which involves some Thunderbird configuration editing. Here's how:

  1. From the Tools menu, choose Options.
  2. Go to the "Advanced" Option menu and the "General" tab. Hit the "Config Editor" button next to the "Advanced Configuration" label.
  3. Now you need to look around in there a bit to find which server you need to modify. Using the filter entry box at the top, type in mail.server.server and you will see a list of keys and values. One of those keys will be mail.server.serverX.name, where X is a number and the value is the name of your Gmail IMAP account. Remember X.
  4. Right-click somewhere in the box and select New->String.
  5. A dialog box will pop up asking for the name of your new key. Put in mail.server.serverX.trash_folder_name, where X is the number you remember from above. (For example, mine is mail.server.server2.trash_folder_name.)
  6. A new box will come up asking for the value of your new key. Put in [Gmail]/Trash.tbirdconfig.png
  7. Go to Gmail's web interface and delete the label [Imap]/Trash.
  8. Restart Thunderbird.
Thanks Vanl!

UPDATE 2, Nov 8th: A Gmail IMAP engineer writes in with more information about the implications of the Trash tweak:

Using the [Gmail]/Trash as your Trash folder can lead to some unexpected issues, and the Gmail team doesn't recommend it.

Our recommended client settings page doesn't go far enough to explain why this can be an issue. The problem is that gmail only keeps a single copy of a message with multiple labels. If you apply the Trash label by placing the message in the [Gmail]/Trash folder, you are telling GMail to remove the message from all labels, and GMail will also delete the message in 30 days.

If for some reason you actually expect the message to be in multiple folders, and you delete it from one thinking that only removes it from that folder, if you set your Trash to [Gmail]/Trash, you will mistakenly remove the message from both folders.

So, suppose you have a filter set up to keep a copy of every message in another label/folder, and you normally just go through your inbox in Thunderbird deleting every message, knowing you have a copy saved in another folder, you will be actually deleting both copies. Or maybe you think you are relying on the automatic "second copy" that Gmail has in the "[Gmail]/All Mail" folder: again, moving a message to the Trash will remove it from there as well.

Or, perhaps you mistakenly "copied" a message to another folder, instead of "moving" it, so you then "delete" the copy that was left behind: this will actually delete the message from both places.

In short: If you're using Gmail's Trash folder, expect that all copies of any message you put there will be deleted, not just the one you move there.

How Thunderbird actions map to Gmail

Before we move into Thunderbird tweaks and add-ons, check out this chart of what actions in your client will do in web-based Gmail, courtesy of Google.

Note that Gmail labels do NOT map to Thunderbird's tags. Each label is represented by an old school folder in Thunderbird. If a message has more than one label, it will appear in multiple folders, which is very cool. To label a message in Thunderbird, move it to the appropriate folder. To create a new label in Gmail, create a new folder in Thunderbird, and so forth.

Subfolders and Slash Labels

If you move a message into a subfolder of a folder in Thunderbird, over in web-based Gmail you'll see a label named parent folder/child folder. Conversely, any labels with forward slashes in them will create subfolders in T-bird. You Folders4Gmail users in Better Gmail may absolutely love this. (Note: the Folders4Gmail script has been updated to support the IMAP forward slash as well as a backslash; Better Gmail to follow very soon. Thanks, Sean!)

Combine Gmail's Spam-killer with Thunderbird's Adaptive Junk Filter

Along the same lines as setting the Sent and Drafts folders to align above, if you enable Thunderbird's Junk filter, make sure it moves junk mail to Gmail's Spam folder so that Gmail marks it as spam as well. That way the bird's adaptive filter can teach Gmail as it learns. Here's that setting:

Get Gmail Goodness in Thunderbird

Thunderbird has a few features built-in or easily added that are similar or match Gmail web-based functionality in a rich desktop app. Like:

  • thunderbirdthreads.pngThreaded conversation view. Ok, so it's not quite as nice as Gmail's web-based implementation, but you can view messages by thread. Click on the tiny "display message threads" button to see replies in a hierarchical order in Thunderbird. Image by Digg user D14BL0. Here are the results:

    Collapse the thread by hitting the - sign, and new replies to a message won't create a whole new line in the list.

  • Gmail search operators and keyboard shortcuts. The GMailUI Thunderbird extension adds Gmail keyboard shortcuts (like y to archive, j/k to move up and down the message list), and Gmail advanced search operators to Thunderbird's search box (like subject:hi from:gidget.)

    Set the y key to move messages to your [Gmail]/All Mail folder, which will archive messages in Gmail.

    There are other Thunderbird keyboard shortcut extensions (I'm also partial to TB Quick Move) but nothing as elegant as Gmail Macros on the web side for you Greasemonkey or Better Gmail users. Let us know if you've got a better alternative.

Enjoy Thunderbird-Specific Features

Getting your Gmail in Thunderbird via IMAP means you get T-bird-specific happiness too, like:

  • Sorting messages by size. Anyone who's had a nearly-full Gmail account knows the tedious, manual process that is freeing up space. In Thunderbird, you can do the one thing Google wouldn't let you do in Gmail: Sort your messages by size, so you can target the space hogs. To do so, hit the small button on the right-most side of the column header list, and select Size to show message sizes. Then click the Size header to sort ascending or descending, and delete the hefty messages directly from Thunderbird. Thanks, Vsack!
  • Drag and drop message import. Want to bring old email from other accounts into Gmail? While connected via IMAP, drag other messages stored in Thunderbird to your Gmail folders, for instant import with all the old message headers intact. Much better than the other convoluted methods we've recommended in the past. Thanks, Irian!
  • Reply before or after the quote. You need a Firefox extension like Better Gmail to do this in web-based Gmail, but in Thunderbird you can easily set whether you want your replies to appear above or below quoted text, as shown in your account preferences:

    You can also automatically select the entire quote for easy chopping up in your reply, and set whether your signature appears above or below your quote.

  • Better multiple identity and signature management. Set up multiple "identities" in Thunderbird with email address-specific signatures, which you can't do in web-based Gmail. Hit the "Manage Identities" button in your Account Preferences dialog. The various identities you choose will be available as a dropdown in the From: field in new messages, just like in web-based Gmail. You can also create and automatically attach a vCard to your outgoing messages on a per-identity basis with T-bird, and choose to compose your messages as HTML or plain text per identity, too. (Click to enlarge screenshots of the identity manager.)

    http://lifehacker.com/assets/resources/2007/10/tbirdidmgt-thumb.png

  • Better filters. Gmail's filtering mechanism and interface is OK, but Thunderbird's is better. Case in point: you can specify in what order filters should be applied to incoming messages. Check out our essential email filters for ideas.
  • Manage form letters with the QuickText extension. Easily send canned responses that contain message-specific variables like sender name with the excellent QuickText Thunderbird extension. Here's how to knock down repetitive email with Thunderbird and QuickText.

I've only had limited time with the amazing combination of IMAP, Gmail, and Thunderbird, so I'm sure I missed some things here. How are you using T-bird/Gmail/IMAP? Let us know in the comments.

And for more ways to enhance Thunderbird, check out our previously posted eight killer Thunderbird extensions.

Update: Wired News reports that Gmail's IMAP support isn't full to spec; Google says Gmail's IMAP implementation is "fairly complete" and lists what IMAP features aren't supported.

"

Delete / Remove files by timestamp or age

DelAge32 is a great utility created by Horst Schaeffer where it can delete files by its age.

Source Link

"

DelAge32 is a command line tool that deletes or moves files by age (number of days).

The age is calculated as date difference at local time. By default the "last modified" file stamp is taken to calculate the age (see options /created, /modified and the note about file stamps).

Syntax: DelAge32 filespec days [options]
Examples: DelAge32 C:\some\where\*.* 100 /recurse
DelAge32 there\*.tmp 1 /created /includeRO
Delage32 *.zip 35
filespec File name search pattern (wildcards) with full or relative path.
days Number of days: minimum age of files to delete or move
options Options begin with a slash, case ignored.
All command arguments must be separated by blank space!
/preview The files will not be deleted, but only listed with age.
/created The "created" time stamp is taken to calculate the age. Default is the "last modified" stamp. See note about file stamps (below)
/modified The "last modified" time stamp is taken to calculate the age. This is the default. However, when used in conjunction with the /created option, the most recent one of these two stamps is taken.
/accessed The "last access" time stamp is taken to calculate the age.
/includeRO Include files with Read-Only attribute
/includeH Include files with Hidden attribute (system files always remain untouched)
/recurse Recurse through the entire subdirectory structure (see /rd option to remove empty directories)
/subonly Recurse, but exclude the initial directory
/rd Remove emptied directories by age (according to "created" stamp);
will not remove directories that have already been empty.
/move target Move files instead of deleting; specify target directory. This works across drives.
Note: If a target file exists, it will be overwritten without warning!
/quiet No output (makes no sense with the /preview option). By default all deleted or moved files are listed with age (number of days).
Output can be redirected to a file (OEM format).

In case of any syntax errors the program will take no action.
Maximum length of fully expanded paths: 260 bytes.

Errorlevels: 0: successful, even if no files have qualified
1: invalid path, 255: syntax error
Failed operations: If there are any files that could not be deleted or moved, the output line will be marked with *** failed ***.

Note about file stamps:

Usually you would not expect that a file has been "modified" before it was "created".
However, when a file is copied, for example, the new copy is "created" at the current date (obviously), whereas the "last modified" stamp is taken from the original file, because it is supposed to refer to the contents - not the physical file.

Copyright, Disclaimer

This program is distributed as "freeware," copyright reserved by the author. There are no warranties of any kind, nor any liability by the author. Users accept full responsibility for the use they make of the software and for any damage caused thereby.


Email: horst.schaeffer at gmx.net
Website: http://home.mnet-online.de/horst.muc

"

PHP4 or PHP5 GD Image Library or ImageMagick Error

When you run into this PHP4 or PHP5 error stated below.

“
Critical Error

PHP running on your server does not support the GD Image Library, check with your webhost if ImageMagick is installed.

“

Simply remove the ';' semi-colon from the 'extension=php_gd2.dll' in php.ini

Removing disconnected mailboxes in Exchange Server 2007

Article Source
"
MSFT:

Description: Removes a given user from AD and disconnects their Mailbox
Comamnd: Remove-Mailbox -Identity contoso\john


Description: Removes a given user from AD and purges their mailbox from the database
Command: Remove-Mailbox -Identity contoso\john -Permanent $true


Description:Purges from the database a single already disconnected mailbox. Uses Get-MailboxStatistics to get the identity of the user before passing to remove-mailbox
Command: $Temp = Get-MailboxStatistics | Where {$_.DisplayName -eq 'John Peoples'}
Remove-mailbox -Database Server01\Database01 -StoreMailboxIdentity $Temp.MailboxGuid

Addtional:
Description:Removes all disconnected Mailboxes from a Database
Command: Get-MailboxStatistics -database "server\database" | where {$_.disconnectdate -ne $null} | foreach {Remove-mailbox -database $_.database -storemailboxidentity $_.mailboxguid}
"

Addtional Info - Article Source
"

Exchange Server 2007 doesn't allow us to purge the disconnected mailbox. In order to remove one or multiple disconnected mailboxes we can be performing these steps:

Listing all disconnected mailboxes

Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid

Removing a single entry

Remove-Mailbox -Database -StoreMailboxIdentity -confirm:$false

Removing all users at the same time

$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid

Now that we have all disconnected mailboxes in a var, we can run the following cmdlet to remove all of them:

$users | ForEach { Remove-Mailbox -Database "Mailbox Database" -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }
"

Understanding Exchange 2007 Disconnected Mailboxes

Article Source

"
Exchange 2007
Understanding Disconnected Mailboxes

Applies to: Exchange Server 2007, Exchange Server 2007 SP1 Topic Last Modified: 2007-01-30

In Microsoft Exchange Server 2007, each mailbox consists of an Active Directory directory service user and the mailbox data that is stored in the Exchange mailbox database. (For an illustration of the components of a mailbox, see Figure 1.) All configuration data for a mailbox is stored in the Exchange attributes of the Active Directory user object. The mailbox database contains the mail data that is in the mailbox associated with the user account.

Important:
When you create a mailbox for a new or existing user, the Exchange attributes that are required for a mailbox are added to the user object in Active Directory. The associated mailbox object in the Exchange mailbox database is not created until the mailbox either receives a message or the user logs on to it. If you create a new mailbox, and then remove or disable that mailbox before the mailbox object in the Exchange mailbox database is created, it will not be available as a disconnected mailbox.

Figure 1 Components of a mailbox


Parts that make up a mailbox

A disconnected mailbox is a mailbox object in an Exchange mailbox database that is not associated with an Active Directory user account. When you remove or disable a mailbox, the data that is stored in the Exchange mailbox database is no longer associated with the user account in Active Directory and becomes a disconnected mailbox.

Caution:
If you remove a mailbox, the mailbox data that is stored in the Exchange mailbox database is marked for deletion and the associated user account is also deleted from Active Directory. To retain the user account and only disassociate the mailbox data from the user account, you must disable the mailbox. For detailed instructions, see How to Disable a Mailbox.

To provide a method for recovering mailbox data without having to restore the entire mailbox database, disconnected mailboxes are retained in the mailbox database for a specific amount of time. By default, Exchange retains a disconnected mailbox for 30 days. During this time, the disconnected mailbox can be recovered by associating it with an existing Active Directory user account. To learn more about deleted mailbox retention, see Configuring Deleted Mailbox and Deleted Item Retention.

There are two operations you can perform on a disconnected mailbox:

  • Connect it to an existing user account in Active Directory
  • Permanently delete it from the Exchange mailbox database

Connecting a Disconnected Mailbox

During the time a disconnected mailbox is retained in the Exchange mailbox database, you can connect it to an existing Active Directory user account that is not associated with another mailbox. Scenarios in which you may want to connect a mailbox include the following:

  • You disabled a mailbox and now want to reconnect the mailbox to an Active Directory user account.
  • You removed a mailbox by using the Remove-Mailbox cmdlet without the Permanent or StoreMailboxIdentity parameters and now want to reconnect the mailbox to a different Active Directory user account.
  • You want to convert a user mailbox to a linked mailbox that is associated with a user account external to the forest in which your Exchange organization exists. The resource forest scenario is an example of when you would want to associate a mailbox with an external account. In a resource forest scenario, user objects in the Exchange forest have mailboxes, but the user objects are disabled for logon. You must associate these mailbox objects in the Exchange forest with enabled user objects in the external accounts forest.

You can use the Connect-Mailbox cmdlet in the Exchange Management Shell or the Connect Mailbox wizard in the Exchange Management Console to connect a mailbox. The Connect Mailbox wizard is available from the action pane when you select the Disconnected Mailbox node under Recipient Configuration. For detailed instructions about how to connect a disconnected mailbox, see How to Connect a Mailbox.

After you connect a mailbox to an existing Active Directory user account, that user account becomes the owner of the mailbox and has full access to any content within the mailbox.

Permanently Deleting a Disconnected Mailbox

Exchange retains disconnected mailboxes in the mailbox database based on the deleted mailbox retention settings configured for that mailbox database. After the specified retention period, a disconnected mailbox is permanently deleted from the Exchange mailbox database.

You can also permanently delete a disconnected mailbox at any time by using the Remove-Mailbox cmdlet in the Exchange Management Shell. To do this, you need to set the Permanent parameter to $true when you run the command.

If you want to permanently delete the data within the mailbox database for a previously disconnected mailbox, you must use the StoreMailboxIdentity parameter with the Remove-Mailbox cmdlet. You can use the Get-MailboxStatistics cmdlet to determine the value you need to supply to the StoreMailboxIdentity parameter for a disconnected mailbox. For an example of this scenario, see the third code example in the reference topic Remove-Mailbox.

For detailed syntax and parameter information, see the Remove-Mailbox and Get-MailboxStatistics reference topics.

For detailed information about how to connect a disconnected mailbox, see How to Connect a Mailbox.

For more information about deleted mailbox retention, see Configuring Deleted Mailbox and Deleted Item Retention.

For more information about the Exchange Management Shell cmdlets that relate to disconnected mailboxes, see the following topics:

To learn more about mailboxes, see Understanding Recipients.

To learn more about managing mailboxes, see Managing User Mailboxes.

"