away-0.9.5/0040755000102000001450000000000007535013033011652 5ustar pepperrogueaway-0.9.5/CVS/0040755000102000001450000000000007533553224012316 5ustar pepperrogueaway-0.9.5/CVS/Root0100644000102000001450000000003107533553103013147 0ustar pepperrogue/home/hrothgar/devel/cvs away-0.9.5/CVS/Repository0100644000102000001450000000001307533553103014403 0ustar pepperrogueaway-0.9.4 away-0.9.5/CVS/Entries0100644000102000001450000000064507533553224013654 0ustar pepperrogue/BUGS/1.5/Sun Aug 11 23:48:55 2002// /COPYING/1.1.1.1/Sun Aug 11 04:56:15 2002// /ChangeLog/1.3/Fri Aug 23 03:42:08 2002// /Makefile/1.1.1.1/Sun Aug 11 04:56:15 2002// /NEWS/1.2/Fri Aug 23 03:42:08 2002// /README/1.3/Fri Aug 23 03:42:18 2002// /TODO/1.2/Mon Aug 12 00:32:49 2002// /away.c/1.14/Thu Aug 22 05:23:39 2002// /away.h/1.4/Mon Aug 12 00:33:03 2002// D/data//// D/doc//// /AUTHORS/1.2/Fri Aug 30 02:20:24 2002// away-0.9.5/AUTHORS0100644000102000001450000000026507533553150012731 0ustar pepperrogueCameron Moore `-> creator Seth Stone |-> suggested turning away into a terminal locking program `-> wrote the original execvp() code away-0.9.5/BUGS0100644000102000001450000000014007525573747012353 0ustar pepperrogueBUG LIST for Away ----------------- Email bug reports to away@unbeatenpath.net - No known bugs away-0.9.5/COPYING0100644000102000001450000004312707525367157012733 0ustar pepperrogue GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. away-0.9.5/ChangeLog0100644000102000001450000000274407531327420013434 0ustar pepperrogue0.9.5: - fixed a signal trapping bug; don't trap SIGHUP - fixed busy loop bug when a mailbox did not exist - fixed printing of mailbox error messages while authenticating - fixed a mailbox comment parsing bug when reading rc files - fixed outdated PAM configuration file 0.9.4: - fixed a bug in handling invalid parameters - fixed a bug in handling invalid conf files - fixed a bug in handling mailboxes - fixed a bug when no rc file was present - added the ability to disable mail checking - added the ability to set the mail checking time interval - added persistent mailbox checking options - changed several command line parameters - major code reorganization 0.9.2: - added getopt code 0.9.0: - finally created a stinkin header file - cleaned and optimized code (as if it were SETI@Home or something) - integrated Seth's -m patch - added Wait command to the rc file - created man pages - created doc/ and data/ dirs in the source tree 0.2.0: - added ability to use an .awayrc config file - added linked list to allow multiple mailboxes - added the version number to the --help output - added the number of secs between each new mail check to the --help output - created away.h and moved relevant code to it - changed the --help message layout - fixed retrieval of username (was relying on env $USER...uck!) 0.1.0: - added terminal locking code and threading associated with it - fixed a problem with looking up the username from a xterm away-0.9.5/Makefile0100644000102000001450000000103207525367157013325 0ustar pepperrogue# Makefile for Away # files and paths SHELL = /bin/sh PREFIX = /usr/local BINARY = away SRC = $(BINARY).c # compiler CC = gcc CFLAGS = -O2 -Wall -D_REENTRANT LIBS = -lpthread -lpam -lpam_misc # alias away all: $(BINARY) # away $(BINARY): $(SRC) $(CC) $(CFLAGS) $(LIBS) $(SRC) -o $(BINARY) # @strip $(BINARY) # make install install: $(BINARY) cp $(BINARY) $(PREFIX)/bin/ cp doc/away.1 $(PREFIX)/man/man1/ cp doc/awayrc.5 $(PREFIX)/man/man5/ cp data/away.pam /etc/pam.d/away # Clean up clean: rm -f $(BINARY) *.o core away-0.9.5/NEWS0100644000102000001450000000066507531327420012361 0ustar pepperrogueVERSION NEWS ============ v0.9.5 ------ * Several important buxfixes in this release, but no functionality changes have been introduced. v0.9.4 ------ * The command-line options have been changed; Some of the old options have been changed to a different letter/word, and some new options have been added. * The rcfile commands have been changed; Some of old commands have been renamed and some new options have been added. away-0.9.5/README0100644000102000001450000000475307531327432012547 0ustar pepperrogue Away ------------- Version 0.9.5 Away is a terminal locking program with the additional ability to check user-defined mailboxes for new mail. Background ---------- Also, like many people (I assume), I always use the `w` command to see what people are doing on a server. I often need to talk with someone online, and it drives me bonkers to see them online but idle for two+ hours. Then I'm stuck with the decision of "should I wait a few minutes and see if they do something?" or "should I just email them since I know they won't be back for another two hours?" Well, to combat this problem, I started this project. My primary goal with writing Away was very simple: write a program to take the place of "-bash" (or whatever shell you hold dear to your heart) in the `w` command's "WHAT" column. Since that time, Away has been transformed into a pretty nice terminal locking program. Legal ----- See the file COPYING for copyright and warranty information. Latest Versions --------------- The latest version of Away can be found at the following location: http://unbeatenpath.net/software/away/ Alternate download location: ftp://wtlug.org/pub/away/ Special thanks to the guys at WTLUG and Leapfrog Technologies. Installation ------------ $ tar zxvf away-x.y.z.tar.gz - or - tar yxvf away-x.y.z.tar.bz2 - or - tar Ixvf away-x.y.z.tar.bz2 $ cd away-x.y.z/ $ make $ su -c "make install" Configuration ------------- Each user may have an ~/.awayrc configuration file in their home directory. For a description and example of the rcfile, see the awayrc(5) man page or the sample awayrc file distributed in this package. Usage ----- See away(1) man page. Contributers ------------ See the AUTHORS file. Bug Reports and Patches ----------------------- Any bug reports and/or patches should be sent to the Away mailing list . See the BUGS file for a list of known bugs. Contact ------- A mailing list has been set up for the discussion of Away. Please send any messages related to Away to the mailing list at . Cameron Moore cameron@unbeatenpath.net $Id: README,v 1.3 2002/08/23 03:42:18 hrothgar Exp $ away-0.9.5/TODO0100644000102000001450000000156307525601061012347 0ustar pepperrogueTODO/WISHLIST for Away ---------------------- Email suggestions to away@unbeatenpath.net - See if we can get around having to depend on the setenv() stuff or at least consolidate the vars into on single var. - Possibly add a hook so that the path to a folder with new mail could be passed to an external command...then that command could print whatever message the user wants to conjure up. use -e option to do this. - Get code from the vlock program to disallow virtual terminal switching...not a priority. - Designate a signal to allow superuser authentication. This would prevent some luser from locking all of the VTs. - GNU-ize (create a configure script, etc; migrate to /data and /src directory structure) - Break up source into more files (help.[ch], mail.[ch], ...) - Maildir folder support (primarily for systems with qmail) - gettext i18n support away-0.9.5/away.c0100644000102000001450000004736407531072533013000 0ustar pepperrogue/* Away - terminal locking program * Copyright (C) 1999-2002 Cameron Moore and others * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Or try here: http://www.fsf.org/copyleft/gpl.html * * $Id: away.c,v 1.14 2002/08/22 05:23:39 hrothgar Exp $ */ #include "away.h" int main(int argc, char **argv) { int option_count = 0; int option_index = 0; int c = 0; short mesg_exec = 0; short restart = 0; signal(SIGINT , SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGTSTP, SIG_IGN); signal(SIGUSR1, SIG_IGN); signal(SIGUSR2, SIG_IGN); if (argc == 1) { short_help(argv[0]); } while ((c = getopt_long(argc, argv, "cCf:FhmpPt:Tv", long_options, &option_index)) && c != -1) { restart = 1; switch (c) { case 'c': setenv(AWAY_MAIL, "1", 1); option_count++; break; case 'C': setenv(AWAY_MAIL, "0", 1); option_count++; break; case 'f': setenv(AWAY_RCFILE, (char *)strdup(optarg), 1); option_count += strchr(argv[option_count],'=') ? 1 : 2; break; case 'F': setenv(AWAY_NORCFILE, "1", 1); option_count++; break; case 'h': ext_help(argv[0]); break; case 'm': mesg_exec = 1; option_count++; break; case 'p': setenv(AWAY_PERSIST, "1", 1); option_count++; break; case 'P': setenv(AWAY_PERSIST, "0", 1); option_count++; break; case 't': if (atoi(optarg) >= MIN_TIME) setenv(AWAY_TIME, (char *)strdup(optarg), 1); option_count += strchr(argv[option_count],'=') ? 1 : 2; break; case 'T': setenv(AWAY_NOTIME, "1", 1); option_count++; break; case 'v': print_version(); break; case '?': fprintf(stderr, "Try `%s --help` for more information.\n", argv[0]); exit(0); break; default: break; } } /* if passed an option, we need to re-exec */ if (restart) { /* make sure we have enough args for a message */ if (option_count+1 == argc) short_help(argv[0]); else re_exec(argc, argv, option_count, mesg_exec); } check_env(); master(); return 0; } /* Master function */ void master(void) { pthread_t mail_thread; short error = 1; struct passwd *pw = NULL; Mailbox *mailboxRoot = NULL; /* get home dir */ pw = getpwuid(getuid()); if (!pw) { fprintf(stderr, "You don't exist!\n"); exit(1); } read_config(&mailboxRoot, pw->pw_dir, pw->pw_name); /* start mail checking thread */ if (CHECK_MAIL != 0) pthread_create(&mail_thread, NULL, (void*)&mail_thread_f, &mailboxRoot); /* lock this sucka up */ while (error) { stall(); /* authenticate the user */ pam_active = 1; error = authenticate(pw->pw_name); pam_active = 0; /* on invalid passwd */ if (error) { printf("\a** Invalid password **\n"); /* mail was found during authentication... */ if ((!notified) && (mail_found)) { printf("\a\n You have new mail in %.200s.\n", found_in); notified = 1; } } } /* while */ /* mail was found during authentication... */ if ((!notified) && (mail_found)) printf("\a\n You have new mail in %.200s.\n", found_in); salutations(); free_mailboxes(mailboxRoot); } /* Authenticate Password */ short authenticate(char *username) { short error; pam_handle_t *pamh = NULL; /* start PAM session for 'away'. * * the session name is what PAM looks for * * in /etc/pam.d/ or /etc/pam.config */ error = pam_start("away", username, &conv, &pamh); /* authenticate user */ if (!error) error = pam_authenticate(pamh, 0); /* close PAM session */ if (pam_end(pamh,error) != PAM_SUCCESS) { pamh = NULL; fprintf(stderr,"away: ** failed to release PAM authenticator\n"); error = 1; } return error; } /* Make a Path */ char *make_path(char *dirs, char *filename) { unsigned int size = 8; char *buffer = (char *) malloc (size), *last = strrchr(dirs, '/'), *format = NULL; if (last != 0 && strlen(last) == 1) format = "%s%s"; else format = "%s/%s"; while (1) { /* try to print in the allocated space. */ int nchars = snprintf (buffer, size, format, dirs, filename); /* if that worked, return the string. */ if (nchars < size) return buffer; /* else try again with twice as much space. */ size *= 2; buffer = (char *) realloc (buffer,size); } } /* Version */ void print_version(void) { printf("away " VERSION "\n"); printf("Copyright (c) 1999-2002 Cameron Moore and others.\n"); printf("This software comes with NO WARRANTY, to the extent permitted by law.\n"); printf("You may redistribute copies of this software under the terms of the\n"); printf("GNU General Public License. For more information about these matters,\n"); printf("see the file named COPYING distributed with this software.\n\n"); printf("To contact the developers, please send mail to <" MLIST ">.\n"); exit (0); } /* Short Help */ void short_help(char *argv0) { fprintf(stderr,"Usage: %s [OPTIONS] message [...]\n", argv0); exit (0); } /* Extended Help */ void ext_help(char *argv0) { printf("Usage: %s [OPTIONS] message [...]\n", argv0); printf("A terminal locking program.\n\n"); printf(" -c, --mail enable checking of mail\n"); printf(" -C, --nomail disable checking of mail\n"); printf(" -f, --rcfile=FILE specifies an alternative configuration file\n"); printf(" -F, --norcfile ignore user configuration file\n"); printf(" -h, --help display this help information\n"); printf(" -m, --message execute showing only the message passed\n"); printf(" to the program\n"); printf(" -p, --persist continue checking for new mail as long as\n"); printf(" there is at least one mailbox that has not\n"); printf(" recieved new mail\n"); printf(" -P, --nopersist stop checking mail if any mailbox is found\n"); printf(" to have new mail\n"); printf(" -t, --time=SECONDS sets the time interval by which the program\n"); printf(" performs its background tasks\n"); printf(" -T, --notime ignore any options to set the time interval\n"); printf(" and use the default of %d seconds\n", TIME); printf(" -v, --version display version copyright information\n\n"); printf("Report bugs to " MLIST ".\n"); exit (0); } /* Stall */ void stall(void) { printf("\n You went away at %.20s", make_time()); printf("\n\n -- Press [Enter] to come back online --\n"); getchar(); } /* Get Current Time */ char *make_time(void) { unsigned int size = 8; char *buffer = (char *) malloc (size); time_t t = time(NULL); struct tm *thetime = localtime(&t); while (1) { /* try to print in the allocated space. */ int nchars = snprintf (buffer, size, "%.02d:%.02d:%.02d", thetime->tm_hour, thetime->tm_min, thetime->tm_sec); /* if that worked, return the string. */ if (nchars < size) return buffer; /* else try again with twice as much space. */ size *= 2; buffer = (char *) realloc (buffer,size); } } /* Salutations */ void salutations(void) { printf("\n Welcome back. It's %.20s\n\n", make_time()); } /* Check for New Mail */ short new_mail(Mailbox *mb) { struct stat status; time_t mailread = 0, mailrecv = 0; if (stat(mb->path, &status) < 0) { /* couldn't stat */ if (!pam_active) { if (access(mb->path, F_OK) == -1) fprintf(stderr, "Could not open %s: file does not exist\n", mb->path); else if (access(mb->path, R_OK) == -1) fprintf(stderr, "Could not open %s: access denied\n", mb->path); else fprintf(stderr, "Could not open %s\n", mb->path); } mail_found = 0; } else if (status.st_size != 0) { mailrecv = status.st_mtime; mailread = status.st_atime; } if ((mailread < mailrecv) && (mb->mtime != mailrecv) && (mb->atime != mailread)) { mb->mtime = mailrecv; mb->atime = mailread; return mail_found = 1; } else { return mail_found = 0; } } /* Mail Thread Function */ void mail_thread_f(Mailbox **root) { Mailbox *mb; short slept = 0; while (1) { mb = *root; while (mb != NULL && (!mail_found || PERSIST)) { if (new_mail(mb)) { found_in = mb->desc; /* make sure the main process has * * time to outputs its stuff... */ if (!slept) { sleep(1); slept++; } if (!pam_active) { printf("\a\n You have new mail in %.200s.\n", found_in); notified = 1; } } mb = mb->next; } /* while */ if (mail_found && !PERSIST) break; sleep(TIME); } /* exit the thread */ pthread_exit(NULL); } /* Get CmdCode */ static CmdCodes get_opcode(const char *cp, const char *filename, int linenum) { unsigned int i; for (i = 0; commands[i].name; i++) if (strcasecmp(cp, commands[i].name) == 0) return commands[i].opcode; fprintf(stderr, "%.200s: line %d: Bad configuration option: %.200s\n", filename, linenum, cp); return oBadCmd; } /* Allocate New Link Node */ static void *my_malloc(int n) { void *p = malloc( (size_t)n ); if (p == NULL) { fprintf(stderr, "Out of Memory"); exit(1); } return p; } /* Setup New Mailbox Container */ static Mailbox *make_cell(void) { Mailbox *m = (Mailbox *) my_malloc(sizeof(Mailbox)); m->path = m->desc = NULL; m->next = NULL; return m; } /* Find New Node and Set String Values */ static Mailbox *snocString(Mailbox *root, char *path, char *desc) { if (root == NULL) { Mailbox *tmp = make_cell(); tmp->path = (char *) my_malloc(5 + strlen(path)); tmp->desc = (char *) my_malloc(5 + strlen(desc)); strcpy(tmp->path, path); strcpy(tmp->desc, desc); return tmp; } else { Mailbox *tmp = root; while (tmp->next != NULL) tmp = tmp->next; tmp->next = snocString(tmp->next, path, desc); return root; } } /* Add New Mailbox to List */ static void add_mailbox(Mailbox **list, char *path, char *desc) { if (path != NULL) { int i, j, k, gotPath = 0; char tmpPath[FILE_NAME_LEN], tmpDesc[FILE_NAME_LEN]; i = 0; while (1) { if (path[i] == 0) break; path += i; i = 0; while (isspace((int)(path[0]))) path++; while (path[i] != 0 && !isspace((int)(path[i]))) i++; if (i > 0) { k = i; if (k > FILE_NAME_LEN-10) k = FILE_NAME_LEN-10; for (j = 0; j < k; j++) tmpPath[j] = path[j]; tmpPath[k] = 0; gotPath = 1; } } i = 0; while (gotPath) { if (desc[i] == 0) break; desc += i; i = 0; while (isspace((int)(desc[0]))) desc++; while (desc[i] != 0) i++; if (i > 0) { k = i; if (k > FILE_NAME_LEN-10) k = FILE_NAME_LEN-10; for (j = 0; j < k; j++) tmpDesc[j] = desc[j]; tmpDesc[k] = 0; APPEND_MAILBOX(*list, tmpPath, tmpDesc); } } } } /* Set Defaults */ void set_defaults(Mailbox **root, char *name) { add_mailbox(root, make_path(_PATH_MAILDIR, name), "INBOX"); } /* Read Configuration File */ void read_config(Mailbox **root, char *homedir, char *username) { FILE *f = NULL; char line[1024], filename[256]; char *cp = NULL, *maildir = ""; unsigned int linenum = 0, opcode = 0; short changed_mail = 0, changed_persist = 0, changed_time = 0; if (RCFILE_OP) snprintf(filename, sizeof filename, "%.200s", rcfile); else snprintf(filename, sizeof filename, "%.100s/%.100s", homedir,rcfile); /* check for existance of conf file */ if (access(filename, F_OK) == -1) { if (RCFILE_OP) { fprintf(stderr, "Could not open %s: file does not exist\n", filename); } set_defaults(root, username); return; } /* check for existance of conf file */ if (access(filename, R_OK) == -1) { fprintf(stderr, "Could not open %s: access denied\n", filename); set_defaults(root, username); return; } /* open rc file */ f = fopen(filename, "r"); if (!f) { set_defaults(root, username); return; } /* go line by line */ while (fgets(line, sizeof(line), f)) { linenum++; /* skip whitespace */ cp = line + strspn(line, WHITESPACE); if (!*cp || *cp == '\n' || *cp == '#'); else { /* get opcode */ cp = strtok(cp, WHITESPACE); opcode = get_opcode(cp, filename, linenum); switch (opcode) { case oMail: /* if changed from command line */ if (MAIL_OP) { cp = strtok(NULL, "\n"); break; } if (changed_mail) { cp = strtok(NULL, WHITESPACE); fprintf(stderr,"%s line %d: multiple Mail commands.\n", filename, linenum); } else { cp = strtok(NULL, WHITESPACE); if (!cp) fprintf(stderr,"%s line %d: missing argument.\n", filename, linenum); else if (strcasecmp(cp,"yes") == 0 || atoi(cp) == 1) CHECK_MAIL = 1; else if (strcasecmp(cp,"no") == 0 || atoi(cp) == 0) CHECK_MAIL = 0; else { fprintf(stderr, "%s line %d: Invalid Mail argument (%.200s).\n", filename, linenum, cp); } changed_mail = 1; } break; case oMaildir: if (!CHECK_MAIL) { cp = strtok(NULL, "\n"); break; } /* save the maildir for building paths to mailboxes */ cp = strtok(NULL, WHITESPACE); if (!cp) fprintf(stderr,"%s line %d: missing argument.\n", filename, linenum); else if (strcmp(cp,maildir) != 0) if (cp[0] == '~') { /* handle references to home dir as ~, ~foo, etc. */ char *save = NULL; cp = strtok_r(cp,"~",&save); if (strstr(cp, "/") != NULL) maildir = strtok_r(cp, "/",&save); else maildir = cp; if (maildir != NULL && strcmp(maildir,username) == 0) cp = strcat(cp=strdup("/"), save); if (cp == NULL) cp = homedir; else cp = strcat(homedir, cp); } maildir = make_path(cp,""); break; case oMailbox: if (!CHECK_MAIL) { cp = strtok(NULL, "\n"); break; } /* append mailbox to maildir and save */ cp = strtok(NULL, WHITESPACE); if (!cp) fprintf(stderr,"%s line %d: missing argument.\n", filename, linenum); else if (strcmp(maildir,"") != 0) { char *desc = strtok(NULL, "\n"); if (!desc) desc = strdup(cp); else if (strstr(desc,"{") && strstr(desc,"}")) { if (*desc == '{') { desc++; desc = strtok(desc,"}"); } else { strtok(desc,"{}"); desc = strtok(NULL,"}"); } } else if (strlen(desc) == strspn(desc, WHITESPACE)) { desc = strdup(cp); } else { fprintf(stderr,"%s line %d: garbage at end of line.\n", filename, linenum); desc = strdup(cp); } add_mailbox(root, make_path(maildir,cp), desc); } else { fprintf(stderr, "%s line %d: Mailbox option needs a Maildir parent.\n", filename, linenum); } break; case oPersist: /* if changed from command line */ if (PERSIST_OP) { cp = strtok(NULL, "\n"); break; } if (changed_persist) { cp = strtok(NULL, WHITESPACE); fprintf(stderr,"%s line %d: multiple Persist commands.\n", filename, linenum); } else { cp = strtok(NULL, WHITESPACE); if (!cp) fprintf(stderr,"%s line %d: missing argument.\n", filename, linenum); else if (strcasecmp(cp,"yes") == 0 || atoi(cp) == 1) PERSIST = 1; else if (strcasecmp(cp,"no") == 0 || atoi(cp) == 0) PERSIST = 0; else { fprintf(stderr, "%s line %d: Invalid Persist argument (%.200s).\n", filename, linenum, cp); } changed_persist = 1; } break; case oTime: /* if changed from command line */ if (TIME_OP) { cp = strtok(NULL, "\n"); break; } /* change TIME */ if (changed_time) { cp = strtok(NULL, WHITESPACE); fprintf(stderr,"%s line %d: multiple Time commands.\n", filename, linenum); } else { cp = strtok(NULL, WHITESPACE); if (!cp) fprintf(stderr,"%s line %d: missing argument.\n", filename, linenum); else if (atoi(cp) >= MIN_TIME) TIME = atoi(cp); else { fprintf(stderr, "%s line %d: Time value less than minimum (%d).\n", filename, linenum, MIN_TIME); TIME = MIN_TIME; } changed_time = 1; } break; default: break; } /* switch */ /* check for garbage at EOL */ if (strtok(NULL, WHITESPACE) != NULL) fprintf(stderr,"%s line %d: garbage at end of line.\n", filename, linenum); } /* else */ } /* while */ fclose(f); /* if no mailboxes where setup, add system inbox */ if (CHECK_MAIL && root == NULL) { set_defaults(root, username); } else if (!CHECK_MAIL) { free_mailboxes(*root); } } /* Re-execute */ void re_exec(int argc, char *argv[], int opt_cnt, short as_mesg) { /* preserve location of binary */ char *original = argv[0]; /* create new argv */ char *newargv[argc]; int i = (as_mesg ? 0 : 1); for (; i < argc-(opt_cnt+as_mesg); i++) newargv[i] = argv[i+(opt_cnt+as_mesg)]; /* keep original exec name */ if (!as_mesg) { newargv[0] = argv[0]; } /* pad with space to make use of one word arguments to -m */ newargv[argc-(opt_cnt+as_mesg)] = " "; i = opt_cnt;// - (as_mesg ? 1 : 0); for(; i > 0; i--) newargv[argc-i] = NULL; /* exec THIS! */ execvp(original, newargv); } /* check ENV for options */ void check_env(void) { if (getenv(AWAY_RCFILE)) { rcfile = getenv(AWAY_RCFILE); RCFILE_OP = 1; unsetenv(AWAY_RCFILE); } if (getenv(AWAY_NOTIME)) { TIME_OP = 1; unsetenv(AWAY_NOTIME); } else if (getenv(AWAY_TIME)) { if (atoi(getenv(AWAY_TIME)) >= MIN_TIME) { TIME = atoi(getenv(AWAY_TIME)); TIME_OP = 1; } unsetenv(AWAY_TIME); } if (getenv(AWAY_PERSIST)) { PERSIST = atoi(getenv(AWAY_PERSIST)); PERSIST_OP = 1; unsetenv(AWAY_PERSIST); } if (getenv(AWAY_MAIL)) { CHECK_MAIL = atoi(getenv(AWAY_MAIL)); MAIL_OP = 1; unsetenv(AWAY_MAIL); } } /* free mailboxes linked list */ void free_mailboxes(Mailbox *root) { while (root != NULL) { Mailbox *next = root->next; if (root->path != NULL) free(root->path); free(root); root = next; }; } away-0.9.5/away.h0100644000102000001450000001047707525601077013004 0ustar pepperrogue/* Away - terminal locking program * Copyright (C) 1999-2002 Cameron Moore and others * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Or try here: http://www.fsf.org/copyleft/gpl.html * * $Id: away.h,v 1.4 2002/08/12 00:33:03 hrothgar Exp $ */ #ifndef _AWAY_H #define _AWAY_H /* version and contacts */ #define VERSION "0.9.5" #define MLIST "away@unbeatenpath.net" /* Separator for conf file */ #define WHITESPACE " \t\n" /* macro */ #define APPEND_MAILBOX(root,path,desc) root=snocString((root),(path),(desc)) /* Max filename length */ #define FILE_NAME_LEN 1024 /* ENV variable names */ #define AWAY_RCFILE "AWAY_RCFILE" #define AWAY_NORCFILE "AWAY_NORCFILE" #define AWAY_TIME "AWAY_TIME" #define AWAY_NOTIME "AWAY_NOTIME" #define AWAY_MAIL "AWAY_MAIL" #define AWAY_PERSIST "AWAY_PERSIST" #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Default conf file name */ char *rcfile = ".awayrc"; /* min mail check interval */ const int MIN_TIME = 10; /* Default settings */ int TIME = 300; short PERSIST = 1; short CHECK_MAIL = 1; /* flags to allow command line options to override conf file options */ short TIME_OP = 0; short PERSIST_OP = 0; short RCFILE_OP = 0; short MAIL_OP = 0; short NORCFILE_OP = 0; /* turned on while trying to authenticate the user */ short pam_active = 0; /* mail was found */ short mail_found = 0; /* the user has already been notified */ short notified = 0; /* name of mailbox new mail was found in */ char *found_in = NULL; /* PAM conversation struct */ static struct pam_conv conv = { misc_conv, NULL }; /* rc file commands */ typedef enum { oMail, oMaildir, oMailbox, oPersist, oTime, oBadCmd } CmdCodes; static struct { const char *name; CmdCodes opcode; } commands[] = { { "mail", oMail }, { "maildir", oMaildir }, { "mailbox", oMailbox }, { "persist", oPersist }, { "time", oTime }, { NULL, 0 } }; /* mailbox linked list */ typedef struct mailbox { char *path; /* path to mailbox */ char *desc; /* description of mailbox */ time_t mtime; /* last modified time (new mail) */ time_t atime; /* last accessed time (read mail) */ struct mailbox *next; } Mailbox; /* command line options for getopt */ static struct option long_options[] = { {"help", 0, 0, 'h'}, {"mail", 0, 0, 'c'}, {"message", 0, 0, 'm'}, {"nomail", 0, 0, 'C'}, {"nopersist", 0, 0, 'P'}, {"norcfile", 0, 0, 'F'}, {"notime", 0, 0, 'T'}, {"persist", 0, 0, 'p'}, {"rcfile", 1, 0, 'f'}, {"time", 1, 0, 't'}, {"version", 0, 0, 'v'}, {0, 0, 0, 0} }; /* prototypes */ void master(void); short authenticate(char *username); char *make_path(char *dirs, char *filename); void print_version(void); void short_help(char *argv0); void ext_help(char *argv0); void stall(void); char *make_time(void); void salutations(void); short new_mail(Mailbox *mb); void mail_thread_f(Mailbox **root); static CmdCodes get_opcode(const char *cp, const char *filename, int linenum); static void *my_malloc(int n); static Mailbox *make_cell(void); static Mailbox *snocString(Mailbox *root, char *path, char *desc); static void add_mailbox(Mailbox **list, char *path, char *desc); void set_defaults(Mailbox **root, char *name); void read_config(Mailbox **root, char *homedir, char *username); void re_exec(int argc, char *argv[], int opt_cnt, short as_mesg); void check_env(void); void free_mailboxes(Mailbox *root); #endif /* _AWAY_H */ away-0.9.5/data/0040755000102000001450000000000007533553104012571 5ustar pepperrogueaway-0.9.5/data/CVS/0040755000102000001450000000000007533553104013224 5ustar pepperrogueaway-0.9.5/data/CVS/Root0100644000102000001450000000003107533553104014061 0ustar pepperrogue/home/hrothgar/devel/cvs away-0.9.5/data/CVS/Repository0100644000102000001450000000002007533553104015313 0ustar pepperrogueaway-0.9.4/data away-0.9.5/data/CVS/Entries0100644000102000001450000000012207533553104014550 0ustar pepperrogue/away.pam/1.2/Sun Aug 11 05:24:50 2002// /awayrc/1.2/Sun Aug 11 05:57:45 2002// D away-0.9.5/data/away.pam0100644000102000001450000000004407525372442014231 0ustar pepperrogue#%PAM-1.0 auth required pam_unix.so away-0.9.5/data/awayrc0100644000102000001450000000104407525376331014004 0ustar pepperrogue## Sample Configuration File for Away ## (http://www.unbeatenpath.net/software/away/) ## ## See awayrc man page for more information. (`man 5 awayrc`) ## ## $Id: awayrc,v 1.2 2002/08/11 05:57:45 pepper Exp $ ## # check mailboxes mail yes # check mail every 60 seconds time 60 # do not do persistent checking persist no # inbox maildir /var/spool/mail mailbox johndoe {your Inbox} # procmail folders maildir /home/johndoe/mail mailbox linux-security {Linux Security} mailbox mutt-announce {Mutt Announce} away-0.9.5/doc/0040755000102000001450000000000007533553104012425 5ustar pepperrogueaway-0.9.5/doc/CVS/0040755000102000001450000000000007533553104013060 5ustar pepperrogueaway-0.9.5/doc/CVS/Root0100644000102000001450000000003107533553104013715 0ustar pepperrogue/home/hrothgar/devel/cvs away-0.9.5/doc/CVS/Repository0100644000102000001450000000001707533553104015155 0ustar pepperrogueaway-0.9.4/doc away-0.9.5/doc/CVS/Entries0100644000102000001450000000012207533553104014404 0ustar pepperrogue/away.1/1.3/Fri Aug 23 03:43:46 2002// /awayrc.5/1.3/Fri Aug 23 03:43:47 2002// D away-0.9.5/doc/away.10100644000102000001450000000475607531327562013466 0ustar pepperrogue.\" Copyright (C) 1999-2002 Cameron Moore and others .\" .\" This program is free software; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License .\" as published by the Free Software Foundation; either version 2 .\" of the License, or (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" Or try here: http://www.fsf.org/copyleft/gpl.html .\" .\" $Id: away.1,v 1.3 2002/08/23 03:43:46 hrothgar Exp $ .\" .TH away 1 "November 2000" Linux "User Manuals" .SH NAME away \- terminal locking program .SH SYNOPSIS .B away [OPTIONS] .I message .B [...] .SH DESCRIPTION .B away is a simple program that locks your terminal, checks for new mail in any given number of mailboxes, and lets other users know why you are inactive. .SH OPTIONS .IP "-c, --mail" Enable checking of mail. .IP "-C, --nomail" Disable checking of mail. .IP "-f, --rcfile=FILE" Specify an alternative configuration file instead of the default ~/.awayrc file. .IP "-F, --norcfile" Ignore user configuration file. .IP "-h, --help" Display help. .IP "-m, --message" Execute as the remainder of the command line, effectively stripping off the executable name and additional switches. .IP "-p, --persist" Continue checking for new mail as long as there is at least one mailbox that has not received new mail. .IP "-P, --nopersist" Stop checking mail if any mailbox is found to have new mail. .IP "-t, --time=SECONDS" Set the number of second that away sleeps before performing its background tasks. Presently, the only background task that away will perform is the checking of mailboxes. .IP "-T, --notime" Ignore any options to set the time interval and use the default number of seconds. .IP "-v, --version" Display version information. .SH FILES .I ~/.awayrc .RS Per user configuration file. See .BR awayrc (5) for further details. .RE .I /etc/pam.d/away .RS The .B Linux-PAM configuration file. .RE .SH BUGS Bug reports should be sent to the away mailing list . .SH SEE ALSO .BR awayrc (5) .SH AUTHORS Cameron Moore , and others. away-0.9.5/doc/awayrc.50100644000102000001450000000650307531327563014010 0ustar pepperrogue.\" Copyright (C) 1999-2002 Cameron Moore and others .\" .\" This program is free software; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License .\" as published by the Free Software Foundation; either version 2 .\" of the License, or (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" Or try here: http://www.fsf.org/copyleft/gpl.html .\" .\" $Id: awayrc.5,v 1.3 2002/08/23 03:43:47 hrothgar Exp $ .\" .TH awayrc 5 "November 2000" Linux "User Manuals" .SH NAME awayrc \- configuration file for Away .SH DESCRIPTION An away configuration file consists of a series of commands. Each line of the file may contain only one command. Command names are case-insensitive. Commands and arguments are separated by spaces. The hash mark, or pound sign ("#"), is used as a comment character. You can use it to annotate your configuration file. All text after the comment character to the end of the line is ignored. Take note that if any mailboxes are configured in the rc file, they will be the only mailboxes checked, which means that you must add your inbox--the .B $MAIL environment variable will be ignored. .SH COMMANDS .IP "mail VALUE" This command allows the user to disable or enable the checking of the user's mailboxes. If mail checking is disabled, all .I mailbox and .I maildir commands are ignored. VALUE can be 0, 1, no, or yes. The default value is 'yes'. .IP "mailbox FILENAME" A file that should be checked for "new mail." The filename will be appended to the previous .B maildir declaration. An optional description of the mailbox may be supplied. If the description contains a space, the entire description must be enclosed in braces, "{" and "}". .IP "maildir DIRECTORY" A path where subsequent .B mailbox declarations will be located. The only argument is the path itself. .IP "persist VALUE" This command will set whether to do persistent mail checking. VALUE can be 0, 1, no, or yes. The default value is 'yes'. .IP "time SECONDS" This command will set the number of seconds that away sleeps before performing its background tasks. Presently, the only background task that away will perform is the checking of mailboxes. The SECONDS value must be more than the minimum, which set at compile time. The only argument is the number of seconds. The default value is 300. .SH EXAMPLE .nf # check mailboxes mail yes # check mail every 60 seconds time 60 # do not do persistent checking persist no # inbox maildir /var/spool/mail mailbox johndoe {your Inbox} # procmail folders maildir /home/johndoe/mail mailbox linux-security {Linux Security} mailbox mutt-announce {Mutt Announce} .SH FILES .I ~/.awayrc .RS Per user configuration file. .RE .SH BUGS Bug reports should be sent to the away mailing list . .SH SEE ALSO .BR away (1) .SH AUTHORS Cameron Moore , and others.