in reply to give perl an email
However, if you're just wanting to put mail into a Mhonarc archive, here's some code I use to do that:
Make sure the mail daemon has permission to run this script, and that it has permission to create subdirectories in your archive directory.my $mhonarc = "/usr/local/bin/mhonarc"; # Path to Mhonarc executable my $archive = "/home/httpd/html/archive"; # Path to archive my $rcfile = "/home/httpd/mhonarc.rc"; # Path to Mhonarc rcfile my ($m,$y) = (localtime(time))[4,5]; $m++; $y+=1900; my $month = sprintf("%04d%02d", $y, $m); # make a directory name like +YYYYMM unless (-e "$archive/$month") { mkdir("$archive/$month", 0775) || die "Couldn't make new archive dir: $!\n"; } open(OUT, "|$mhonarc -add -rcfile $rcfile -outdir $archive/$month -qui +et") || die "Couldn't open mhonarc: $!\n"; while(<STDIN>) { print OUT; } close (OUT);
|
|---|