U can use checkgmail package for it...
For installation add these repos in the aptitude source list
$ gedit /etc/apt/sources.list
add the lines
deb http://asher256-repository.tuxfamily.org dapper main dupdate french
deb http://asher256-repository.tuxfamily.org ubuntu main dupdate french
now update the aptitude and install checkgmail
$ aptitude update
$ aptitude install checkgmail
we can invoke the application from command prompt..
$ checkgmail
If there is no luck with first command try this
$ checkgmail -no_cookies
(google has disabled cookies for security reasons it seems...I had to give the -no_cookies to work in my system)
Now you can fill in the account details and other option in the interface which comes up...
If there is a proxy you may need to set the https proxy also before running the command
export https_proxy = https://[proxyadress]:[port]
U might get a better explanation at
http://www.debianadmin.com/gmail-notifier-for-ubuntu.html
