Subject: Re: FVWM: "FvwmTaskbar MailBox" with IMAP

From: uday bhaskar <[email-masked]>
Date: Mon, 20 Dec 2004 04:59:36 -0800 (PST)

Hi,

Felt like sharing this. This was what I did.

#!/bin/perl
use Mail::IMAPClient;
$host = "my-mail-server";
$id = "uday";
$pass=xxxxxxxx;
$folder = "INBOX";
$imap = Mail::IMAPClient->new(
Server => $host,
User => $id,
Password=> $pass,
Fast_io=>1,
) or die "Cannot connect to $host as $id: $@";
while (1) {
	$imap->connect;
	$count = 0;
	defined($count = $imap->recent_count($folder))
	or die "Could not recent_count: $@\\n";
	print STDERR "the count is ", $count, " new
messages\n";

	if ($count){
		open MAILFILE, ">mail" or die "unable to open mail
file\n";
		print MAILFILE "new mail";

	}
	$imap->logout;
	close MAILFILE;
	sleep 300;
};

and set fvwmtaskbar to watch on mail file.

Thanks
Uday

On Tue, Apr 20, 2004 at 05:54:06AM -0700, uday bhaskar
wrote:

Sorry for the late reply.

> Not sure if this is the appropriate place to ask
this question, please 
> redirect me to the appropriate palce.
> 
> My question is how do I use the "FvwmTaskbar
MailBox"
> setting when I use IMAP for my mail access. All fvwm
says is add the 
> path. Can someone help me out with how the path has
to be specified. 
> {imap.domain.com}INBOX does not work.

FvwmTaskBar just watches a file for new mails.  You
could use some other program such as fetchmail to
download the mails to a local file.  If this is
inacceptable, you can make some external script that
checks for new mail and writes something to a fake
mailbox,
e.g.:

  #!/bin/sh
  echo > /tmp/have_new_mail
  while true; do
    if new_mail_in_imap_box; then
      echo "new mail" >> /tmp/have_new_mail
    fi
    sleep 300
  done

And tell FvwmTaskBar to watch the /tmp/have_new_mail
file instead of a real mailbox:

  *FvwmTaskBar: MailBox /tmp/have_new_mail

The difficult part is to write the
"new_mail_in_imap_box" command or function.  Since I
never used IMAP, I don't know what tools there are to
do it.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]

		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].