---
title: Gmail With Push On iPhone Using Prowl And Your Own Webserver
date: 2009-08-12 22:58:56
permalink: https://lesterchan.net/blog/2009/08/12/gmail-with-push-on-iphone-using-prowl-and-your-own-webserver/
author: Lester Chan
categories:
  - Programming
tags:
  - Gmail
  - iPhone
  - iPhone 3G
  - iPhone 3GS
  - Prowl
  - push
  - tutorial
---

Before I start this tutorial, I would like to give **full credits** to **[crimsontwo from xSellize forums](http://www.xsellize.com/showthread.php?t=51739)** and **[joshua.menke from cocoaforge](http://forums.cocoaforge.com/viewtopic.php?f=45&t=20355)**. I merely improve on crimsontwo’s work.

In the thread, [Gmail + push on iPhone w/ Prowl](http://www.xsellize.com/showthread.php?t=51739) on xSellize forums, crimsontwo gave instructions on how to run the Prowl python script on your iphone. The downside to it is that if your iPhone connection change from EDGE to 3G or 3G to Wifi or any vice versa, the script will be disconnected from Gmail. To solve this problem, he recommends you to upload the script to your own web server instead.

**You need to have SSH access to your web server as well as Python installed in your web server** which is not covered in this tutorial.

So here we go:

1. Get [Prowl from App Store](http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=320876271) for US$2.99
2. Register your Prowl account at [http://prowl.weks.net/register.php](https://prowl.weks.net/register.php)
3. Once registered, click on **[Settings Tab](https://prowl.weks.net/settings.php)**
4. Under API key, click on **Generate API Key Button** and note copy down your generated API Key
5. Download the required files in a zip, called, **[Gmail With Push On iPhone Using Prowl](https://lesterchan.net/download/32/)**
6. Using [WinZip](http://www.winzip.com/), extract the zip file which you have downloaded from Step 5
7. You should see a folder called **gmail\_and\_prowl**
8. Open the file **main.py** using NotePad or WordPad
9. You should see these lines on line 11 to 13:  
    > prowl\_apikey = “your\_prowl\_api\_key”  
    > IMAP\_USERNAME = “your\_gmail\_username”  
    > IMAP\_PASSWORD = “your\_gmail\_password”
10. Replace the text **your\_prowl\_api\_key**, **your\_gmail\_username** and **your\_gmail\_password** accordingly and save it
11. Using your FTP, upload the folder **gmail\_and\_prowl** to your home directory in your webserver
12. Login using SSH and browse to the path where you uploaded **gmail\_and\_prowl**, for example, /home/username/gmail\_and\_prowl/
13. Type this command: > nohup python main.py &gt; /dev/null 2&gt;&amp;1 &amp;
14. The PID of the process which is executing the script will be displayed. You may want to know that number down, just in case you need to kill the process.
15. You can now log out from the SSH and send a test email to your Gmail account