[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AttachmentDir when relative

Hi, everyone,

I'm moving to a new server and thought I'd update my MHonArc. There have been some nice changes! For one thing, def-mime.mrc looks like it'll mean a lot fewer error messages.

But I couldn't get a relative AttachmentDir to work out of the box. When I tried that, it got created in the working directory (the one with mhonarc in it) and not out the outdir.

I nosed around a little, and it seems to work now with a couple changes to write_attachment in mhmimetypes.pl. First, toward the beginning:

    if (!$pathname) {
	$pathname = $OUTDIR;
	$rel_outdir = 1;
    } elsif (not OSis_absolute_path($pathname)) { # new section
	$pathname = $OUTDIR . $DIRSEP . $pathname;
	$rel_outdir = 1;

And then toward the end:

    if ($rel_outdir) {
	$pathname  = $OUTDIR;
	$pathname .= $DIRSEP . $AttachmentDir if ($AttachmentDir);
	$pathname .= $DIRSEP . $path if ($pathname);
	$pathname .= $DIRSEP . $fname;
	$url       = join('/', $OUTDIR, $url)  if $SINGLE;

I don't understand why the latter section is even necessary, haven't $pathname and $url already been calculated? Anyway...

It's a nice idea to have a separate place for attachments. My outdir's getting crowded! Hey, how about subdirectories for the msg files? Maybe based on the PG number of the index that they're listed on?


[Index of Archives]     [Bugtraq]     [Yosemite News]     [Mhonarc Home]