X11 check e-mail


Please note that this blog has been moved.

Now it has its own domain: mynixworld.info🙂

If you want to read the latest version of this article (recommended) please click here and I open the page for you.

I don’t like to have Thunderbird open all the time just to be able to check my e-mail every 5 minutes. Also, to open/close my e-mail client every 5 minutes is not a solution too. I found another simple solution:

  • install net-mail/fetchmail utility which is able to retrieve you email from your POP3,IMAP,ETRN or ODMR e-mail accounts
  • set up a .fetchmailrc file in your home directory; there you can specify the accounts settings that will be checked every 5 minutes
  • start fetchmail utility (in background, as a daemon) at session start-up
  • fetchmail daemon will check your .fetchmailrc specified accounts every 5 minutes and if a new email comes into your accounts you will see a notification balloon on your screen

Your .fetchmailrc file content could be something like this:

#File : .fetchmailrc
set postmaster "local_user"

poll imap.gmail.com with proto IMAP and options no dns
user '<your account name>' pass '<account password>' is 'local_user' here options ssl mda "notify-send -i /usr/share/icons/Tango/48x48/actions/mail-message-new.png -c mail -u normal <your account name> %F"
... repeat the above line for every IMAP accounts you want to check (eg: your GMail accounts)

More information about that you can find at: http://www.freebsd.org/doc/handbook/mail-fetchmail.html

Start fetchmail as daemon at session start-up

In Xfce you can set up a Application Autostart (which are supposed to start at session start up):

  • Settings -> Session and Startup -> Application Autostart tab
  • define a new application autostart as bellow:
    • name: fetchmail (in fact it doesn’t matter how you will name it)
    • command: fetchmail -d 300 (-d means run fetchmail as daemon, 300 means run it every 300 seconds ~ 5min)

So, the daemon will start when your X session starts and then will check those email accounts defined in .fetchmailrc file for every 300 seconds (~ 5min).

When a new message arrive you will be notified by a balloon message like the one bellow:
fetchmail

About Eugen Mihailescu

Always looking to learn more about *nix world, about the fundamental concepts of arithmetic, algebra and geometry. I am also passionate about programming, database and systems administration.
This entry was posted in linux, X11 and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s