#!/usr/bin/perl -w use strict; # First print for the main spool, then iterate through maildirs. print <<1EOF box /var/mail/chris title Incoming polltime 5 headertime 2 1EOF ; opendir DIR, "/home/chris/maildir/"; my @dirs = readdir(DIR); foreach my $spool (sort @dirs) { unless ($spool eq '.' or $spool eq '..') { print "box /home/chris/maildir/$spool\n"; print "title $spool\n"; print "headertime 0\n\n"; } }