Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: MAIL, MAILPATH and maildir support



On Jun 3,  8:02am, Clint Adams wrote:
} Subject: Re: MAIL, MAILPATH and maildir support
}
} > Recursively stat() an entire directory tree??
} > Does anyone really make use of this feature?
} 
} Yes, people use this.

Never with upwards-pointing symlinks, obviously.

} Well, it's MAILPATH, not GENERICFILEPATH.  There are a limited number of
} mailbox formats that pose significance to the shell.

I know of at least four that aren't simple files, and there's always
going to be yet another one.  I'd just rather not start down the road.

On Jun 3,  2:20pm, Oliver Kiddle wrote:
} Subject: Re: MAIL, MAILPATH and maildir support
}
} Bart Schaefer wrote:
} > 
} > Perhaps checkmailpath is a candidate for some kind of loadable module ...
} 
} In my opinion, it would be useful to put all of the mail related
} handling in a loadable module and then make that module quite powerful

On Jun 3,  4:08pm, Peter Stephenson wrote:
} Subject: Re: MAIL, MAILPATH and maildir support
}
} A module with more powerful mail commands is a reasonable idea, but I have
} some reservations.  First, if this is going to be a largish add-on, basic
} UNIX mail-file checking (as it currently exists) should probably stay in
} the basic shell, since pretty much everybody (? I presume) uses that ---
} hence exporting it just gets you all the stuff in the module and doesn't in
} practice save anything.  Second, with the plethora of mail systems (the
} maildir one is just one example), a general module for mail handling is a
} big undertaking.
 
One possibility is to make an IMAP module along the lines of the zftp
module.  Another is to make a "bridge module" that links zsh with, say,
c-client (the U. of Washington's mail client library, which is itself
extensible to new formats and already supports at least 10 plus three
revisions of IMAP and two revisions of POP -- but not maildir).

Neither of those address the issue of getting the appropriate part of
such a module invoked automatically when mailpath is checked.

} As for things like the patch that started all this: it looks to me like it
} could be written efficiently enough as a shell function to be run from one
} of the functions periodic or precmd.

The mail check is performed at approximately the same time as precmd or
periodic, so perhaps that's good enough.  However, maybe we should
consider having a special function name (like precmd and preexec) that,
if it's defined, is called in place of the built-in mail-check procedure.
That would provide the necessary hook to run a zmodload'd builtin for
mail checks (by calling the module from the special function).

Or we could make checkmailpath into a builtin command that happens to be
run every MAILCHECK seconds, so that a module could override it.  I can
say with a fair degree of confidence that previous zsh maintainers would
vote in favor of using the existing precmd/periodic mechanism, but the
problem with that is that you can't set it up "transparently" to use the
standard set of shell variables (because you can't -stop- zsh from doing
the check on its own if those variables are set).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author