16 June 2008 Update: I have updated the notifier - please read here for details
Notification of new mail in my gmail account is very important to me on my desktop and therefore that was the first thing I tried to solve once I set up xmonad and dzen. Fortunately, it wasn't that difficult. The following script checks the mail and formats the output for the latest development version of dzen2 (see previous post).
To use it, add your username and password and edit the other variables to change the color of the output, number of new mails to show and words to show in the subject for each mail. Note that I have opted to put the password in a hidden file with proper permissions and the script reads the file for the password.
You can read more about this and download the script from the dzen wiki here.
This bash script calls the dzenGmailNotify script at specified intervals.
Finally, make the above executable and add this to .xsession to display in dzen.