head	3.1;
branch	3.1.1;
access;
symbols;
locks;
comment	@# @;


3.1
date	96.10.30.23.41.13;	author hzoli;	state Exp;
branches
	3.1.0.0
	3.1.1.0;
next	3.0;

3.0
date	96.10.30.23.39.35;	author hzoli;	state Exp;
branches
	3.0.1.0;
next	;

3.0.1.0
date	96.10.30.23.40.21;	author hzoli;	state Exp;
branches;
next	;

3.1.0.0
date	96.10.30.23.41.58;	author hzoli;	state Exp;
branches;
next	;

3.1.1.0
date	96.12.21.02.35.24;	author hzoli;	state Exp;
branches;
next	;


desc
@Zsh function to check for new mails in mail folders
@


3.1
log
@# branch point
@
text
@#! /usr/local/bin/zsh
#
# This autoloadable function checks the folders specified as arguments
# for new mails.  The arguments are interpeted in exactly the same way
# as the mailpath special zsh parameter (see zshparam(1)).
#
# If no arguments are given mailpath is used.  If mailpath is empty, $MAIL
# is used and if that is also empty, /var/spool/mail/$LOGNAME is used.
# This function requires zsh-3.0.1 or newer.
#
# Zoltn Hidvgi <hzoli@@cs.elte.hu>
#

local file message

for file in "${@@:-${mailpath[@@]:-${MAIL:-/var/spool/mail/$LOGNAME}}}"
do
	message="${${(M)file%%\?*}#\?}"
	file="${file%%\?*}"
	if [[ -d "$file" ]] then
		file=( "$file"/**/*(.ND) )
		if (($#file)) then
			checkmail "${^file}\?$message"
		fi
	elif test -N "$file"; then  # this also sets $_ to $file
		print -r -- "${(e)message:-You have new mail.}"
	fi
done
@


3.1.1.0
log
@#
@
text
@@


3.1.0.0
log
@# create 3.1.0 branch
@
text
@@


3.0
log
@# bounce the revision numbers to 3.0
@
text
@@


3.0.1.0
log
@# create 3.0.1 branch
@
text
@@
