The way I do it now is that I have to keep a 'Gmail' tab open at all times in my browser to check for new mail. My mails are important and I need instant notifications. I thought of using a client like 'Thunderbird' but it feels to "heavy" for my needs. All I need is instant notifications of a new mail received in my Gmail such that I don't have to keep the browser tab open all the time. Meaning, may be some little script in my Debian system is checking for a new mail after every minute and raises an alarm when there's a new unread email.

If it is able to show me a subject line and 'From' details, that would be a bonus.

I'm open to all kinds of solutions that alert me of a new Google mail such that:

  • I do not have to keep a browser tab open.
  • It does not download any mail to local disk
  • if you're using Chrome give Checker Plus for gmail a shot. Haven't tried it on Debian but works like a charm on Windows – iruvar Jan 10 '15 at 0:00
  • I'm using Chromium on Debian, and checker plus tells me I'm using an unstable channel of chrome, so it won't support it. – learnerX Jan 10 '15 at 12:29

Using a browser add-on is one option, if you've got your browser open doing something anyway.

Or a desktop panel app could notify you when new mail arrives. Like "Xfce4 Mailwatch Plugin" (if you're using XFCE, or like it, can do multiple inboxes) or "gnome-gmail-notifier", there should be several available from searching the repositories for "gmail".

Or CheckGmail, gmail-notify, kgmailnotifier, mail-notification, Mailnag... Install some & try them out.

There should even be some one-line shell scripts that could check for new mail using wget that might be useful, subject & from are in there, somewhere:

  • http://www.shellperson.net/quickly-check-gmail-with-bash/

    ## Quickly checks if I have new gmail
    echo -e "Checking for new messages... \c"
    atomlines=`wget -T 3 -t 1 -q --secure-protocol=TLSv1 \
     --no-check-certificate \
     --user=USERNAME --password=PASSWORD \
     https://mail.google.com/mail/feed/atom -O - \
     | wc -l`
    echo -e "\r\c"
    [ $atomlines -gt "8" ] \
     && echo -e " You have new gmail.  \c" \
     || echo -e " No new gmail.  \c"
  • Using wget to receive an XML atom feed of your Gmail inbox

    wget -O - 'https://USERNAMEHERE:PASSWORDHERE@mail.google.com/mail/feed/atom' --no-check-certificate
  • I used to use gmail-notify (or something close to that) sometime ago, but it was just too clumsy. It's hard to explain but it was unreliable. I thought of writing my own shell script like the one you mention in your solution, but security goes down the drain with such scripts. I am not going to put my Gmail username and password in a plaintext format file. Also, I'm using 'two-factor authentication' on my Gmail. So this won't work. – learnerX Jan 10 '15 at 12:24
  • Ended up using 'Mail notification'. It seems to do the job well for Debian systems. As I was using a two-factor auth, I had to generate an 'app-specific password' for Mail Notification. – learnerX Jan 10 '15 at 12:47
  • Securing your passphrase can be trouble, some of the programs do just use plaintext in your $HOME :-( Others use something similar to gnome-keyring, maybe even the kernel keyring (with keyctl). Or a custom passphrase file in a ram tmpfs or eCryptfs / EncFS... but DIY encryption schemes are often not very secure – Xen2050 Jan 10 '15 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.