Mail

Gmail filter feature wanted

I’ve been moving a fairly large part of my private mail to my Gmail account.  Gmail do have some amazing features for searching, labeling and handling mail and the virtually unlimited storage is also pretty cool - Much cooler than keeping a huge mail-archive on an IMAP-server or having it on a local fragile hard disk.

One of the more recent things I’ve started using GMail for is backups of this site. With the wp-db-backup plugin for Wordpress a backup of the entired database is mail to my gmail account every 24 hours and using filters I’m applying a ”backup”-label and auto-archiving it (and avoiding noise in inbox).

GMail filter/spam buglike feature

Gmail from Google is usually great, but it does have some bug-like features.

One of the most annoying is when your inbound mail is tagged with a label and should have been auto-archived, but is caught by their spam filter and placed in the spam folder. Discovering and finding the mail in the spam folder is easy, but when you tell Gmail, that the mail isn’t spam, it doesn’t pop in to the archive (where the filter-rule should have put it). It pops back into the inbox, and you can then archive from there.

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.n";
}

exit();

POP3: List messages in mailbox

Lists sender and subject on all mails in mailbox. MIME::WordDecoder is used to parse heads as most mails often has ISO-8859-1 encoded parts. It should be save to test it on any mailbox as it dosn’t change or remove anything from the mailbox.

#!/usr/local/bin/perl -w
use strict;
use Mail::POP3Client;
use MIME::WordDecoder;

my ($serv, $usr, $pwd) = (@ARGV); # server, username and password as comandline parameters...

my $wd = default MIME::WordDecoder;

my $pop = new Mail::POP3Client( USER => $usr, PASSWORD => $pwd, HOST => $serv );
print "Found " . $pop->Count() . " messages.n";
for (my $i = 1; $i <= $pop->Count(); $i++) {
  foreach ( $pop->Head( $i ) ) {
    if (/^(From|Subject):s+/i) {
  print $wd->decode($\_);
    }
  }
  print "n";
}

exit();

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.n";
}

exit();

GTD: Inbox Messages Zero

It took just over a year, but I’ve finally done it. My inbox contains zero messages. It is a little bit scary, since it hasn’t been empty for the past… well since it was created over a decade ago. I’m not sure it’ll stay there on a daily basis, but I’m quite sure it’ll never reach the thousands of messages ever again. I’ve have been toying with GTD, and while it would probably be more efficient to dive in and go completely native (in GTD), I’m taking the slow adoption curve and try to adopt practices one step at a time and letting them prove to me, that they actually work.

Not Always Online

With email, instant messaging, texting and mobile phones, we’re always reachable. Being available always can be a problem. Here are a few tips on how to detach your self sometimes and get a little time to get work done. Your email client doesn’t need to be running when your computer is turned on. People sending email doesn’t expect an instant answer. Turn you mail client off, and start it when you switch to ”mail processing mode”. Turn it off again once your done. While the little pop-up notifications may be practical, they do break the attention away from the task being done, when the mail arrive.

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. While a 100 messages isn’t too uncommon its still too many to conquer in a single glance and there are an easy way to break it down further.

Managing email

It seems most people are capable of launching an email application and do understand most of the technical skills required to use the application. It does however also seem that a fairly large part of the same people lack the social intelligence and skills required to make efficient use of their email capabilities. Scanning through my inbox I saw a fair and typical number of examples in the ”bad email usage” category. These include: