My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Wiki pages
Links

reMail downloads all your email to your iPhone and searches it instantly.

reMail was acquired by Google in February of 2010, and we've decided open source the product: Read the reMail open source announcement for details

Here's a a list of products based on reMail open souce code.

How to Build

You will need a Mac to do this.

  • Install the following:
    1. The latest version of XCode from http://developer.apple.com/ - we have tested reMail with XCode 3.1.3 and 3.2.1
    2. git: http://help.github.com/mac-git-installation/
    3. mercurial / hg: http://mercurial.berkwood.com/
  • Clone the repository ($ hg clone https://remail-iphone.googlecode.com/hg/ remail-iphone) - Note: do this in a path that has no spaces. Some developers have reported they're having trouble building in a path with spaces.
  • Open a terminal, cd into the source directory. Build the dependencies via:
  • $ sh pull_dependencies.sh
This can take up to an hour. It will download all the dependencies (three20, Mailcore) and then build all the crypto libraries. Mailcore and three20 will be in directories on the same level as your ReMailIPhone directory, so don't be surprised when you see them there.
  • Open ReMailIPhone.xcodeproject
  • Click "Build and Debug"

You should consider following the author, @gabor for occasional reMail updates.

If you want to release your own, rebranded version of reMail in the App Store, read RebrandingRemail.

Project ideas

These are inspired by the top recent feature requests. Please contact the author if you want to work on any of these, and I'll try my best to support you. You'll need to find out how to contact me (not very hard). The number in parenthesis is a difficulty rating from 1-5.

  1. Landscape mode (3.5/5)
  2. Password / lock screen (3/5)
  3. Add more account types (Mobile Me, GMX, etc) to config menu (1/5)
  4. Autocomplete previous searches, not just names (2/5)
  5. Pre-sync headers of all emails, then sync contents (5/5)
  6. Download all attachments by default (2/5)
  7. Re-scan folders and delete messages that have been deleted on the server (4/5)
  8. Localize into more languages: Currently, reMail is localized into German (well) and French (badly). You could help by translating into more languages. (1/5)
  9. In search results, see which folder an email is in. (1/5)

See ProjectIdeaDetails for more.

Is reMail Rocket Science?

No. The UI is a UITouch application with some elements from three20 for displaying search snippets with markup. A stack of two libraries - MailCore and libetpan - are used to download emails from the store. Emails are stored in Sqlite3 databases sharded by time slices.

How the Datastore Works

Here's a rough overview of the data flow in reMail:

Emails are stored in sqlite databases named email-X.edb, where X is a number. Each timeslice covers roughly 3 days, as controlled by EmailProcessor.dbNumForDate.

There is a central contacts db which is used to autocomplete names. Each contact entry also includes the youngest and oldest time slice in which emails from that contact occur. This way, search results for people are served up almost instantly.

There is a UID DB (somewhat misnamed) which stores hashes (not ids) of already downloaded emails so we can avoid downloading them again.

The code includes a slightly modified Sqlite3 with better search snippet generation (the snippets generated by sqlite's built-in fts3 module are too short for our purposes, and don't include which of the fields matched).

SyncManager also kicks off running ImapSync, which in turn uses ImapFolderWorker to download each each email in that folder (newest emails first). ImapFolderWorker calls the SyncManager singleton with status updates which are then displayed to the user in HomeScreenViewController (somewhat hackie, but oh well). SyncManager also stores the folder state in property list files (.plist). For each folder, it lists the range of sequence numbers that have already been synced.

EmailProcessor takes the data from ImapFolderWorker (passed asynchronously via an NSOperationQueue) and writes it into the databases we mentioned above.

AttachmentDownloader is used to download attachments when you first open them.

How the UI works

reMail's UI is a UITouch application. Here's a chart that reflects the control flow in the application. Take the names in the boxes and add ...ViewController.m to find the source file. Add ".xib" to find the nib with the relevant data.

The Home screen view controller manages the toolbar on the bottom with status information.

Potentially Useful Code for Your Project

Even if you don't want to contribute, you may be able to use this code for your own project:

  • In-App Store: implements an In-App Store. I left the code in there even though it's not used any more.
  • Buchheit Timer: Prints timing information for blocks of code. Named for Paul Buchheit who came to YC and suggested that we time everything in our code.

Dependencies

reMail uses a number of third party dependencies: MailCore, libetpan, three20, etc. These are not included in the project for two reasons: First, we don't want to keep updating these libraries. Second, For US export control reasons, we can't include libetpan's dependencies: OpenSSL and cyrus-sasl.

Instead, we included a script called pull_dependencies.sh to download and build reMail's dependencies.

Powered by Google Project Hosting