Another mail checker (for IMAP servers)

Esteemed fellows,

Here is a short Perl script to check for new e-mail messages directly on IMAP servers, without downloading the messages.

I use it from a menu, but, with little effort, you can adapt it to open from a button.

A mandatory screenshot:

PROS:

  • Multiple mail accounts (IMAP), each one on a menu
  • Any number of messages (well, if you have hundreds of new mails, you will have hundreds of menus…)
  • You may have different MUAs to read your e-mail. i.e.: mutt to read mail from mail.foo.com, thunderbird for mail from mail.bar.com, etc.

CONS:

  • Slow if you have a slow internet connection, or a slow IMAP server, or lots of new mails, or many accounts.

REQUIREMENTS:

  • At least, an IMAP account
  • Perl
  • Perl module: Mail::IMAPTalk (available on CPAN):
# perl -MCPAN -e shell 'install Mail::IMAPTalk'

INSTALL:

  1. get the Perl script from simplicidade.com/permanente/ … ap_menu.pl;
  2. put the script wherever you wish;
  3. configure your accounts:
...
	1 => {
		SERVER_NAME => 'Foo', # Any name you wish
		SERVER_ADDRESS => 'mail.foo.com',
		USERNAME => 'user@foo.com',
		PASSWORD => 'pass',
		MUA => '/usr/local/bin/mrxvt -e /usr/local/bin/mutt',
	},
...
  1. make it executable (chmod 755);
  2. add an entry on FvWM rootmenu (or other at your option) + "Mail" Popup MenuMail
  3. add the following lines to your .fvwmrc
#--------------------- CHECK MAIL ---------------------#
AddToMenu MenuMail
+ DynamicPopupAction Function MenuFvwmMail

DestroyFunc MenuFvwmMail
AddToFunc MenuFvwmMail
+ I DestroyMenu recreate MenuMail
+ I AddToMenu MenuMail
+ I PipeRead '/path/to/script/fvwm_imap_menu.pl'
#--------------------- END CHECK MAIL ---------------------#

BUGS:

  • Sometimes menu doesn’t refresh. Am I missing something here?

Miguel

[color=red]Edited by theBlackDragon:
–> moved from Screenshots & configs[/color]