Archive for category Online Services

Migrate Gmail to Gmail

If you created a new Gmail account and wished you could migrate all your mail from an old Gmail account across, or if you yearned to make a seamless switch from Gmail to Google Apps, then this will provide a solution for you.

The Solution: imapsync

This method uses imapsync and preserves labels and mail, including Sent items. imapsync is available in many linux distributions.

You must have enabled IMAP access on both your source and destination Gmail accounts. If you have enabled the IMAP-Controls feature in Gmail labs you must ensure all labels have been tagged “Show in IMAP”

This script will sync all labels and mail from user1 to user2. The process is done in two steps, first all labels are created, then the mail is copied. Mail from Trash and Spam is excluded.

It requires you have your passwords in $HOME/.imap/passfile1 and passfile2 for authentication.

#!/bin/bash
 
user1='username1@gmail.com'
user2='username2@gmail.com'
 
# escape the @ symbols
user1e=${user1//@/\\@}
user2e=${user2//@/\\@}
 
# Create folders/labels first
imapsync --host1 imap.gmail.com \
--port1 993 --user1 "$user1" \
--passfile1 $HOME/.imap/passfile1 --ssl1 \
--host2 imap.gmail.com \
--port2 993 --user2 "$user2" \
--passfile2 $HOME/.imap/passfile2 --ssl2 \
--syncinternaldates --split1 100 --split2 100 \
--authmech1 LOGIN --authmech2 LOGIN \
--exclude "\[Gmail\].*" \
--justfolders --nofoldersizes
 
# Sync mail, only copy new items
imapsync --host1 imap.gmail.com \
--port1 993 --user1 "$user1" \
--passfile1 $HOME/.imap/passfile1 --ssl1 \
--host2 imap.gmail.com \
--port2 993 --user2 "$user2" \
--passfile2 $HOME/.imap/passfile2 --ssl2 \
--syncinternaldates --split1 100 --split2 100 \
--authmech1 LOGIN --authmech2 LOGIN \
--useheader "Message-ID" --skipsize --allowsizemismatch \
--exclude "\[Gmail\]\/Spam|\[Gmail\]\/Trash" \
--regexmess "s/Delivered-To: $user1e/Delivered-To: $user2e/g"

References

Gmail to Google Apps Email Migration

Migrate email from Gmail to Google Apps

Other Options

Gmail-Backup (not tested)

Python migration script (not tested)

Tags: , , , ,

Deleting in Gmail IMAP

Getting “Delete” to work as expected in Gmail IMAP was surprisingly complicated.

The default action when a client deletes a message is to archive it (ie: move it to “All Mail”). I didn’t like this because then if I accessed the account from POP the deleted mail would still be downloaded.

Recommended IMAP settings tells you all the things NOT to do, but doesn’t give any useful advice on how to setup clients.

Eventually after trying many different settings I realised the simplest method was to tell the client to MOVE the message to the Gmail Trash folder when it is deleted. To do this in Thunderbird2 required manually editing the prefs.js file to specify a custom IMAP trash folder:

user_pref("mail.server.server#.trash_folder_name", "[Gmail]/Trash");

Note that the case of the trash folder name IS important.

Tags: , , ,

Better GMail Sending

Sending email from Gmail without adding on the custom “Sender: youraccount@gmail.com” has been a long requested feature from users. So frequently requested was this feature that search results were flooded with complaints and requests even after Gmail provided a solution and announced it on their blog.

The solution is an enhancement to the “Send as” options that allow you to specify a different “From” address to your Gmail account. Within this is now an option to send the mail via your own server thus completely bypassing Gmail’s outbound SMTP, and thus your mail appears as if it were send from your own host.

For this to work you must have a SMTP account that will accept outgoing mail via Google’s servers (with or without authentication), and be able to verify that you own the email account (which is the same method of verifying that you receive a unique code that is emailed to the account).

References

Send mail from another address without “on behalf of”

Tags:

Multiple accounts with Gmail

There are two separate features of Gmail, that when used together can greatly ease the management of multiple email accounts.

Firstly, setup a mail import using POP3 and select the options “Archive incoming” and “Label incoming”. This will have the effect of labelling all your mail from that account (call it “Account1″) and more importantly NOT displaying it in your regular Inbox.

Now for the magic, go to Gmail Labs and enable “Multiple Inboxes”. At its base this tool simply allows you to have multiple panes above or below your regular Inbox, and the contect of each pane is specified as a Gmail search (can be keyword, label, or anything else).

So set a pane’s search as “is:Account1″, and the mail that is imported by POP3 will show ONLY in this pane, and you can check it at the same time you are checking your Inbox.

References

How to use Gmail’s “Multiple Inboxes” for extra Gmail accounts

Tags:

Whats that song?

I thought I would put a quick link to J Play. This has been a fantastic resource for finding the playlists on Triple J radio, and the playlists are updated up within hours of the songs being aired.

Really, a fantastic resource if you listen to the radio.

Tags: , ,