Mailing List Archive

any mailfilter delivering into maildir
Hello everybody,

does someone know if there is a mailfilter (like procmail) that can
deliver into a maildir?

Greetings

Jogi

--

Well, yeah ... I suppose there's no point in getting greedy, is there?

<< Calvin & Hobbes >>
Re: any mailfilter delivering into maildir [ In reply to ]
On Sunday 23 February 97, at 17 h 38, the keyboard of Jochen Heuer
<jogi@planetzork.ping.de> wrote:

> does someone know if there is a mailfilter (like procmail) that can
> deliver into a maildir?

Since procmail can launch any arbitrary program, I suggest to use Russel
Nelson's script to do that. WARNING: I never tested that.

In the ".procmailrc":

MYMAILDIR=/path/to/my/Maildir
# No locks necessary, this is Maildir
:0
| /path/to/nelson/program $MYMAILDIR

The program:

#!/usr/bin/perl
$maildir=shift(@ARGV);
die "Usage" if (! $maildir);
$fn = time.".$$.$0";
open (MAILDIR, ">$maildir/tmp/$fn") || die "$0: open failed:$!";
while (<>)
{ print MAILDIR || die "$0: write failed:$!"; }
close(MAILDIR) || die "$0: close failed:$!";
rename("$maildir/tmp/$fn", "$maildir/new/$fn") || die "$0: rename
failed:$!";

After that, you can start to patch procmail :-)