# mail checking

If %{maildelay} is nonzero, TF will check for mail every %{maildelay} seconds. TF checks for mail in each file in the space-separated list of files in the %{TFMAILPATH} variable. If %{TFMAILPATH} is not set, TF will check in the single file named by the %{MAIL} variable.

TF considers a mailfile to have unread mail if the file has been written more recently than it has been read. When this changes for any of the monitored files, TF updates the mail indicator on the status line (actually, the "`@mail`" status). When TF determines that a mailfile contains new mail, it calls the MAIL hook, which by default prints "`You have new mail`". If a mailfile is not empty the first time TF checks it, TF just prints "`You have mail`" without calling the MAIL hook.

If an error occurs while checking any file, an error message will be displayed only once, until that error clears up (or changes to a different error), but TF will continue to check that file. To disable checking, even after an error, you must remove the file from %{TFMAILPATH} or %{MAIL}.

The nmail() function returns the number of monitored mail files containing unread mail.

MAIL and/or MAILPATH variables are usually set in the environment before TF starts. If %{MAIL} is not set when TF starts, TF will try to set it to the name of the system mail directory plus your user name (if the system mail directory was defined when TF was installed). If MAILPATH (which uses ":" as a delimiter) is set when TF starts, it is transferred to %{TFMAILPATH} (which uses space as a delimiter).

See: nmail(), variables, special variables, /set, mailing list.

Back to index
Back to tf home page

Copyright © 1998, 1999, 2002, 2003 Ken Keys