Terminate if the tty is gone
[infodrom/newmail] / newmail.1
1 .\"  Copyright (c) 2004,6  Joey Schulze <joey@infodrom.org>
2 .\"
3 .\"  This program is free software; you can redistribute it and/or modify
4 .\"  it under the terms of the GNU General Public License as published by
5 .\"  the Free Software Foundation; either version 2 of the License, or
6 .\"  (at your option) any later version.
7 .\"
8 .\"  This program is distributed in the hope that it will be useful,
9 .\"  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 .\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 .\"  GNU General Public License for more details.
12 .\"
13 .\"  You should have received a copy of the GNU General Public License
14 .\"  along with this program; if not, write to the Free Software
15 .\"  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 .\"
17 .TH NEWMAIL 1 "February 8th, 2006" "Infodrom Oldenburg" "Mail Utilities"
18 .SH NAME
19 newmail \- biff like tool for the terminal
20 .SH SYNOPSIS
21 .B newmail
22 .RB [ \-b ]
23 .RB [ \-h ]
24 .RB [ "\-i \fIinterval\fB" ]
25 .RB [ \-r ]
26 .RB [ \-w ]
27 .RI [ " mbox " [...]]
28 .SH DESCRIPTION
29 The newmail program monitors a given set of mailboxes and looks for
30 new mail.  If new mail is received the sender and subject will be
31 written on the terminal it was started from.  By default
32 .B newmail
33 puts itself in the background so the console is still usable.
34
35 .B newmail
36 is able to monitor arbitrary numbers of mailbox files.  If no mailbox
37 was specified on the commandline it will monitor the default mailbox,
38 which may be overwritten by the
39 .B MAIL
40 environment variable.
41
42 If more than one mailbox is being monitored, a prefix is printed for
43 each mail line so the user can distinguish between the different
44 mailbox files.  By default the prefix is the name of the mailbox
45 without its path.
46
47 If a mailbox is specified as
48 .IR path = string
49 then
50 .I string
51 will be used as prefix for mails received in the mailbox denoted by
52 .IR path .
53
54 .B newmail
55 is able to decode header lines when non-ascii characters are
56 transported.  They will be displayed properly if the locale
57 .RB ( LC_CTYPE )
58 is set accordingly.
59 .SH OPTIONS
60 .TP
61 .B \-b
62 Ring a bell after one or more incoming mails have been detected for at
63 least one mailbox.
64 .TP
65 .B \-h
66 Print a help message.
67 .TP
68 .BI \-i " interval"
69 Set the interval between two mailbox checks to
70 .IR interval " seconds."
71 The default is 60 seconds which is suffient for the terminal.  For the
72 use inside of a window or dock application a lower value may be
73 prudent.
74 .TP
75 .B \-r
76 Emit raw data from the mail.  This will bypass routines to decode
77 character encodings used for mail headers as described in RFC 2047.
78 This may be useful for
79 window applications that want to decode the strings on their own.
80 .TP
81 .B \-w
82 Run as window application.  This will prevent
83 .B newmail
84 from moving itself into the background so its output can be used as
85 input for a window application.  This will also change the output
86 format slightly and prevent a bell to be rung after new mail has been
87 received.
88 .SH "OUTPUT FORMAT"
89 The output format differs from being read by humans and programs
90 .RB ( \-w ).
91
92     newmail:
93        >> Mail from <from> - <subject>
94        >> Priority mail from <from> - <subject>
95     
96        >> <folder>: Mail from <from> - <subject>
97        >> <folder>: Priority mail from <from> - <subject>
98     
99     newmail -w:
100        <from> - <subject>
101        Priority: <from> - <subject>
102     
103        <folder>: <from> - <subject>
104        <folder>: Priority: <from> - <subject>
105
106 It should be easy for third party programs which are interested in such
107 information to parse the output when
108 .B newmail
109 is running with the
110 .B \-w
111 option.
112 .SH ENVIRONMENT
113 .B newmail
114 supports the following environment variables:
115 .TP
116 LANG
117 Locale setting for the output character set. 
118 .TP
119 LC_CTYPE
120 Locale setting only for the output character set. 
121 .TP
122 MAIL
123 Full path of the user's spool mailbox.
124 .SH NOTES
125 This program is inspired by the
126 .B newmail
127 program from the Elm interactive mail program.  It is a rewrite from
128 scratch though.
129
130 Many thanks go to Dave Taylor and the Elm Development Group who have
131 provided me with a great mail program for several years.  Many
132 additional thanks go to the former lead developer Dave Taylor who
133 started the program back in 1986.
134 .SH "SEE ALSO"
135 .BR locale (7).
136 .SH AUTHOR
137 Joey Schulze <joey@infodrom.org>