Wednesday, June 2, 2010

Filter External Email with Gmail

BIS Filtering Functionality with Android Mobile



So, recently I saw the light and picked up a HTC Hero running Android 2.1. I love the thing, but I did run into one issue with it; work email. Before I ditched my Blackberry, I was able to use the BIS (Blackberry Internet Service) Portal to filter my work email, thus receiving only specific messages (such as nagios alerts, important email from co-workers, etc). As I receive on average 600+ messages a day, this was a very critical feature. But when I went to the Android, I noticed that this feature was lacking. On the first night with my fancy new phone and all of my work email being sent to it, I thought the girlfriend was going to find an orifice of mine to place said phone due to it going off every few minutes and waking her up. Well, there had to be a better solution than this, and there is! While surfing around the internet for a possible solution, I came across a blog post of a guy who filtered his G-Mail account for specific emails; I just took it a step further.

What I did was use Gmail's 'Add POP3 Email account' feature to check my work email, then filter based on specific subjects/from/etc. Anything that did not match the filter criteria was automatically deleted without going to the Inbox first. This actually works pretty well, every so often an email will slip through the filter; but that's expected for the amount of email I receive on a daily basis. This not only works for Android type phones, but just about any phone that can receive gmail via the pop3 setting (I'll be testing this on a Palm here shortly). Thus mimicking the handy BIS filtering, and saving your phone from being launched in the air by a significant other who woke up to the message notification for the umpteenth time.



First things first, make sure you have a Gmail account. Yes, this sounds silly that I would mention it...but you never know. Everything else follows in quick steps, so follow along.



1. Log into Google mail

2. Select 'Settings' in Upper right-hand corner of the screen

3. Select ' Accounts and Import' Tab

4. Under 'Check mail using POP3' click the 'Add POP3 email account', a popup box will come up (make SURE you have enabled popups on your browser prior to doing this)

5. Enter the foreign email address (such as: user@somecompany.com and click 'next step'

6. Enter username, password, POP Server, port #, Label incoming messages. Label incoming messages is optional, but it's nice to see where the email came from. In this case, I labeled all incoming messages 'Work'. So when I receive an email on my phone, I can see if it came from work or into my regular gmail account. (VALUABLE STEP: click 'leave mail on server', if you don't; you won't be getting your regular email from user@somecompany.com with whatever MTA that you use)

7. Click 'Add Account'

8. Either select 'Yes, I want to be able to send mail as user@somecompany.com, or No. (for just receiving email, I used the No option, but that's up to you)

9. Click 'Next Step'

10. After your last step, google will go out and fetch your pop3 email from user@somecompany.com, if this is successful than continue on. If it is not successful, make sure your settings for your pop3 account is configured properly (including your password)



Set Filters

Now that you are receiving your user@somecompany.com email, it's time to filter out specific emails that you want to receive on your phone.

1. Click 'Filters' Tab inside of Settings

2. click 'Create New Filter'

3. To: = user@somecompany.com

4. Add: - next to anything you want filtered into your in-box, separated by a comma.

ex: -nagios@somecompany.com,-myboss@somecompany.com

5. Click 'Test Search'. Your excluded filter options should not show up on your search results, which is a good thing; you shouldn't see your filtered objects.

6. Click 'Next Step'

7. Select your option on where to put the un-filtered email. In this case I chose to delete instead of Archive my email.

If you archive your non-filtered email, it can still be read, but won't be going into your google inbox.

8. Click on 'Also apply filter to xxx conversations below'

9. Click 'Create Filter'



What this feature does is the following:

1. Google checks user@somecompany.com's email

2. E-mail is put through the filter that you setup. If from/subject/body/etc matches your - (do not include) filter, than it is delivered into your Gmail

account with the label that you attached to it in the previous steps.

3. If it does not match your (do not include) filter, than the email is automatically deleted (or archived, however you set this up)



There you have it! BIS functionality with Gmail and the android! As I said earlier, based upon the amount of email that you receive, some email's might squeeze by.

But I'll take an extra email or two over 600 of them going to my device.