imap

Mark all messages as read in an imap folder

The follow script marks all files in a folder as read. You need to pass hostname, username and password as commandline parameters to the script and the script is hardwired to mark all files in a folder call “INBOX.spam” (Cyrus IMAP folder naming convention). #!/usr/bin/perl -w use strict; use Mail::IMAPClient::BodyStructure; use Mail::IMAPClient; my ($serv, $usr, $pwd) = (@ARGV); # server, username and password as comandline parameters... my $imap = Mail::IMAPClient->new(Server=>$serv,User=>$usr,Password=>$pwd); my @folders = $imap->folders; foreach my $f (@folders) { print "$f is a folder with ", $imap->message\_count($f), " messages.

Which IMAP-folders exist?

The following script will make a list of which folders exist in an IMAP account. The script requires you pass hostname, accountname and password on the commandline, but it should be quite easy to change as you like. #!/usr/bin/perl -w use strict; use Mail::IMAPClient::BodyStructure; use Mail::IMAPClient; my ($serv, $usr, $pwd) = (@ARGV); # server, username and password as comandline parameters... my $imap = Mail::IMAPClient->new(Server=>$serv,User=>$usr,Password=>$pwd); my @folders = $imap->folders; foreach my $f (@folders) { print "$f is a folder with ", $imap->message\_count($f), " messages.

Color code your mail

It seems most software has a lot of features, that we don’t know about or don’t use. Some of these features can actually prove themselves highly valuable in the every usage of a given program, and one of the small but powerful tips is how to color code your mail. I used to have an inbox with more than a thousand messages lying around. Through some heavy vetting and through cleaning it’s rarely below a hundred messages.