Pop-up notifications for new mail on the iPhone

Okay, I promise this will be the last iPhone post for at least a little while.

After successfully getting push e-mail working on my iPhone, I got greedy and wanted to have a pop-up notification and sound alert when I got a new message. So here’s what I did:

1) Grabbed a copy of IMAProwl from here and put it in /home/IMAProwl on my server.

2) Installed Ruby 1.9.0 with the OpenSSL module

3) Installed the Prowl gem for Ruby (via WebhostManager after installing Ruby)

4) Created an account at Prowl

5) Purchased the Prowl app in the AppStore

6) Created a file named .imaprowl.conf in the IMAProwl directory with the following contents:

## -*- encoding: utf-8 -*-
##
## example configuration (version >= 1.2)
##
## if undefine LogDir, Debug mode is forcefully enabled.
LogDir: /home/IMAProwl/logs/
Debug: false
Daemon: true

## API Key can be defined up to 5-keys with comma separated values.
Prowl:
APIKey: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

## IMAP Accounts.
Accounts:
-
Application: MyEmail
User: a@aa.com
Pass: mYpAsSwOrD
Host: server.aa.com
BodyLength: 100
SubjectLength: 20
Priority: 0
Format: "%{subject} (%{name} <%{addr}>)"
Timeout: 7    # Timeout for NoResponse during IDLE. Recommend you set 6-7 for GMail. (in minutes)
Enable: True

The host will vary depending on what your server name is. Might even be mail.domain.com. Of course, you will need to put your own e-mail address and password in there and insert your APIKey from the Prowl website.

7) Ran the command

ruby imaprowl.rb -c .imaprowl.conf

8) Configured the sounds in my Prowl app on my iPhone and sent myself a message. It worked!

I imagine this might be possible even if you don’t have your own server. You might want to check with your webhost and see if they have Ruby and if they will install the Prowl gem for you.

Be Sociable, Share!



5 Responses to “Pop-up notifications for new mail on the iPhone”

  1. Heh, I don’t have an iPhone but at least looking at this code for what you are doing it looks interesting to say the least ;-)

  2. Francesco says:

    Please make an app for it… I would pay 1 Euro for it. It definetly is a feature I would like for my iphone as well, even though I don’t have the programming skills to apply what you explained.

    Thank you

    • casey says:

      There actually is an app for that already. The thing is, if you don’t do it yourself it has to be done on someone else’s server, and that means you have to give them your password. Not a good idea, in my opinion.

      • Francesco says:

        Ah, I see… too bad then. BTW I have now solved anyway my problem by purchsing gmail push app (1.5€), that does everything I want (pops up a sms-like notification each time I receive an email and it works great. It does the trick because I have centralized all my email accounts on gmail, so I receive everything over there.

        Cheers mates and thx anyway
        Francesco

    • casey says:

      Great! Glad to hear you got everything working the way you wanted it.