diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..916d1f0 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + 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 + + Appendix: 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. diff --git a/README b/README new file mode 100644 index 0000000..02889a0 --- /dev/null +++ b/README @@ -0,0 +1,13 @@ +Please see marsmail.doc for installation information. + +Authors: Gert Cronje: gac@eng.rau.ac.za + Anton de Wet: adw@obsidian.co.za + Eddie Dunckley: eddie@eng.rau.ac.za + Francois Wolmarans: fwo@eng.rau.ac.za + +Modification for Natural Netware Mail by: + Guillermo Dominguez A: guido@lux.labinf.uaa.mx + +Please contact Eddie for bug reports in the scripts, etc.etc. + +Please contact Guido for bug report on marsmail.pas (Natural Netware Mail). diff --git a/marsmail.doc b/marsmail.doc new file mode 100644 index 0000000..e43e8bb --- /dev/null +++ b/marsmail.doc @@ -0,0 +1,293 @@ +Marsmail ver 0.2c GNU-GPL by EL GUIDO - UAA + & Eddie Dunckley & Gert Cronje of RAU Engineering. + the c is for the charon mail queue emulation +---------------- bug reports:guido@lux.labinf.uaa.mx + +Marsmail ver 0.2 GNU-GPL by Eddie Dunckley & Gert Cronje of RAU Engineering. +---------------- bug reports:eddie@eng.rau.ac.za gac@chopin.rau.ac.za + +--------- (License) +This whole package is licensed under the GNU Public License. +See the file COPYING for details. +--------- + +Marsmail is a pascal frontend for mail that translates the +unix mailfile into smaller files that pegasus mail understands. + +--------- (Added) +This version doesn't need the unix2dos application for marsmail (works alone) +--------- + +Please examine all the files carefully as this is not a commercial +program suite, it's freeware. Written by staff/students for students.. +--------- (And now, teachers for teachers too. ) + +file list: +---------- + 327 Feb 4 11:53 marsmail.doc The marsmail-02c doc file + 8608 Feb 4 11:48 marsmail.exe dos executable to convert mail + 5480 Feb 4 12:51 marsmail.pas dos sources for marsmail c release + 1430 Feb 4 13:32 monlan Basic monitor for LAN/WAN +12051 Feb 4 13:12 newuser.pl Process the user application + 3757 Feb 4 12:50 nomasteruser deletes users with cleanup + 4080 Feb 4 11:32 ohbirthcheck birthday reminder script + 793 Feb 4 11:34 ohexpiry expire accounts on mars/samba +13141 Feb 4 13:18 ohform.htm User application form for Mars server + 1296 Feb 4 11:35 ohlogscr.bat modified supervisor login script + 690 Feb 4 09:32 ohmail automatic mail notifier start script + 6648 Feb 4 10:50 ohmasteruser creates new users with extra features + 1381 Feb 4 09:27 ohmessage automatic mail notifier main script +---------------- (This is no longer needed) +#1046 Feb 4 09:33 ohpostme handles posting from pegasus to unix +---------------- (End) + 3585 Feb 4 10:35 ohquota Disk quota accounting automated + 856 Feb 4 09:34 ohsendnt Console broadcast script + 1954 Feb 4 11:45 pmail.bat front-end dos batch file for pmail + 8161 Feb 4 11:48 pmdflts.ini pmail defaults for all users + 1024 Feb 4 11:48 pmgate.sys USER defined gateway via pconfig + 859 Feb 4 11:00 wwwhomepage Creates homepages for new users. + +what's new +---------- + +pmail.bat script dosn't need unix2dos anymore, the marsmail have an better +readline logic that understand the unix lines. (EL GUIDO) +---------- + +marsmail read directly from the user's spool mail, don't need make copies. +---------- + +marsmail let the unix mail directly into the user's mail directories on novell +---------- + +marsmail uses a Charon alike Print Queue for mail output +---------- + +Lot's of automation.... +Lot's of new ideas ie birthday reminders, expiry scripts etc etc +Better docs + +Procedure: +---------- +Take a deep breath and realize that there is no install script. +Make sure your mars is running successfully and dos users can log into +the server with normal novell client software. Make sure your directory +layout for Mars looks simmular to the one listed in this document. Get a good +editor for linux to edit the scripts to suite your company's needs. Get +the pegasus mail program from one of it's mirror sites. +Unpack and follow it's install method. + +----------- (This is obsolete) +#DON't use pegasus's bindery features to fetch mail in the +#SYS:\mail locations. This requires a mercury.nlm that cannot run on linux. +----------- (New Feature) +The marsmail-02c needs the bindery features to work, this is the natural mail +on Netware. The SYS:\mail\ must exist. +There is no mercury, but the Charon Mail Queue Emulation works fine! :-) +----------- + +----------- (The pop solution) +You can attempt using the pmpop utilities for dos to fetch mail via pop from +the server, (which might have been the best possible solution if it worked), +but there is a seperate project to edit the ini file on the fly for multiple +users.... +----------- (My comments) +I didn't investigated about this, but someone reading this could :-)) +----------- + +----------- (This is obsolete too!) +#Make sure you map drive I: to the user's home directory (or change the +#scripts). I've used a map root i:=sys:\home\%name% to do this in the +#master mars login script that can be created with syscon. +----------- (New Feature) +The volumes required for this new c release are: + Volume Route Drive + -------- ----------- ------- + SYS -> route/SYS F: + ...others... route/ (G: , H: , I: , etc) + HOME -> ~ (G: , H: , I: , etc) +----------- + +Start by examining each script carefully - there is a lot of undocumented +features in them... + +----------- (This os more obsolete!!!) +#Then start by editing the pmdflts.ini to suite your needs. +#Use the one included as a template. Read the pmail docs carefully. +----------- (New Feature) +Just install the pmail suite and reconfigure the gateway (see this part next). +----------- + +----------- (This is important!!!) +Link your unix mailboxes into your mars SYS +volume space i.e. ln -s /var/spool/mail //SYS/unixmail +(but the 0.99pl1 do it in a different way) +----------- + +----------- (This Changed) +Run pconfig to create a SMTP gateway. Use the name of a Print Queue defined on the +/etc/nwserv like a charon mail queue. +----------- + +----------- (This is for the SMTP gateway) + +Select: Pegasus Mail/DOS Configuration v3.11 + SMTP Gateway + +____+--------------- Mercury / Charon SMTP Interface ---------------+_____ +___ ¦ ¦_____ +___ ¦ Spool Interface? : [N ] ¦+____ +___ ¦ Queue Name? : CHARON ¦¦____ +___ ¦ Enabled? : Y ¦¦____ +___ ¦ Prefered? : N ¦¦____ +___ ¦ Use always? : N ¦¦____ +___ ¦ This server's name : your.name.org.contry ¦¦____ +___ ¦ Our time zone : GMT +/- #num ¦¦____ +___ ¦ Organization : organization's name ¦¦____ +___ ¦ ¦¦____ +___ ¦ The name you want placed in the Organization header of ¦¦____ +___ ¦ outgoing message. Use this to identify your site more ¦¦____ +___ ¦ clearly in your email. ¦+____ +___ +---------------------------------------------------------------+_____ +___ ______ + +---------- (This is for the Charon alike emulation) +Declare a Print Queue on the /etc/nwserv.conf like this: + + 21 CHARON SYS:/PRINT/O /usr/sbin/mailout + +The mailout is a executable (755 mode) file with this line: + +# File that emulate the Charon Mail Gateway +(sed "1,3d" | /usr/sbin/sendmail -t) +#End of file +----------- + +----------- (This is very important!!) +Check if your unixmail is secure i.e. mars users cannot read each others mail. +This can be done by loggin in from a dos box with different user names and +trying to view the sys:\unixmail\%name% files +----------- + +Edit the pmail.bat to suite your needs. + +----------- (This is more more obsoleted !!!) +#Make sure the drive mappings is correct. +#i.e. I: maps to userdir. +----------- (New Feature) +Just need the SYS:/mail drive mapping correct +----------- + +Compile the marsmail.pas to suite your needs if needed. + +----------- (Ahooommmm, more obsolted !!!) +#Test to see if you can read mail from pegasus and that the gateway places +#outgoing messages in i:\pmail\out. +----------- + +----------- (This is no more used !!!) +#Edit the ohpostme scripts until it posts mail out for your users. +#This can be tested by posting a message with pmail, seeing if a file is created +#in i:\pmail\out, and waiting for ohpostme to visit the directory, removing and +#posting the file. +----------- + +----------- (This was no tested !!!) +Deploy (!) the ohmail and ohmessage scripts to run out of rc.local or however +you prefer. See if it notifies the user when new mail arrives.... You can +tail -f the log files to see what is happening. A note on samba notification: +the message gets sent to a machine instead of a user. + +Decide if you want to use the new adduser script called ohmasteruser and +nomasteruser for creating users and destroying users on a mars aware unix +server. MAKE BACKUPS of your original passwd files etc before continueing. +Note this new adduser creates /etc/expiry /etc/birthdays /etc/ohmyusers +/etc/ohmaillist + +Remove users from ohmaillist to prevent them from mailing +Remove users from expiry to prevent account expiry +Remove users from birthdays to prevent birthday notification + +Please note the change to passwd file: + +auser:x:505:512:A dummy user:/hamster/home/./auser:/etc/ftponly + +The extra dot after home forces ftp to see this as the root, thus +allowing the ftp to enter ../httpd/html/auser via the link. Note that +/app or unixmail cannot be reached via ftp. +----------- (No tested) + +----------- (This is no more needed (hope) !!!) +#Edit your mars's net$log.dat in SYS:\public to exit to the extended login +#script ohlogscr.bat that actually creates the users with a default password +#on the mars server. Modify the wwwhomepage script to create homepages for +#your new users. +----------- (the work is just ....) +Edit your mars's net$log.dat adding this two lines to the end + +DOS SET ID=%USER_ID% +DOS SET LN=%LOGIN_NAME% +----------- + +----------- (this was untouched) +You might need to either install quotas or remove mentioning of quotas from +the scripts. + +Customize the ohform.htm to your needs and decide if you would like to use it +as a user application form from the web. The apache server can run on the +same server as mars.... ohform.htm calls newuser.pl that creates a script file +to ease the user creation. newuser.pl sends mail to admin user to inform him +of the new application. + + +These scripts can handle shadow passwords. Create a blank file /etc/ftponly +and use this dummy shell for users to prevent them from telnetting to the +server. Mail fetching via pop and ftp will continue to work. + +Suggested directory structure for good operation... + +/apps +/base +/base/SYS (mars server SYS volume) +/base/SYS/unixmail ln -s /var/spool/mail /base/SYS/unixmail +/base/SYS/apps ln -s /apps /base/SYS/apps +/base/SYS/home ln -s ../home home +/base/home base home directories +/base/home/auser (Yip, the user's home dir) +/base/home/auser/www ln -s ../httpd/html/dummyuser www +/base/home/auser/pmail gets created from /etc/skel used for pmail +/base/home/httpd/html Web server root space +/base/home/httpd/html/main non-user related space. +/base/home/httpd/html/auser (user's www space) + +You can now even share the apps, home dirs and unixmail with samba and you've +got a complete novell and nt server all in one, sharing the same space! + +If you find ANY errors with this doc or missing files please let me know... +---------- (Untouched) + +---------- (This is just for fun) +#The marsmail is just a dirty hack to satisfy the dos users. Stick with +#pop3 or imap to fetch mail via tcpip from win95, os2, wfw, linux and other. +#The other stuff included with marsmail is just to automate as much as possible +#for our poor overworked netadmins! +---------- (My opinion) +The marsmail-02c is a ver hard work to improve the resources and the time on +the sessions with dos users, based on the marsmail-02 (thanxs a lot boys), but +with a lot of new features, hawever have the principal trouble on marsmail: +the user can use only one mail reader (pmail or pine), never both in a time. + +New features: + a) easy of install (a very few steps) + b) reads mail in the netware natural mode + c) output mail in the natural CHARON mode + +Changes: + a) The ohpostme go to the trash + b) the oh* scripts still in test (don't know if works) + +Future: (the one or the scond, but not the two) + a) ask to PMAIL worktime to make a PMAIL that work with spool files + b) improve the mail read for read only the new mail for pmail + and return the undeleted mail to the spool (both readers) +---------- diff --git a/marsmail.exe b/marsmail.exe index 69efa49..579bbbc 100755 Binary files a/marsmail.exe and b/marsmail.exe differ diff --git a/marsmail.pas b/marsmail.pas index bf41866..0d5d415 100755 --- a/marsmail.pas +++ b/marsmail.pas @@ -3,6 +3,7 @@ uses dos; var mailfile, numfile, outfile: text; number, miline, moline, sl, slc: string; {mail-in, mail-out} + UserId,UserLn: string; {mail dir on netware} nfile, odir, mfile: string; {numberfile, output dir, mailfile} numbint: longint; o, code, mi, i,j: integer; {mailindex} @@ -24,12 +25,33 @@ begin FileExists := (IOResult = 0) and (FileName <> ''); end; { FileExists } +Function ReadLine(var ReadFile: Text): String; +var + C: Char; + S: String; + O: boolean; +Begin + O:=False; + S:=''; + If Not EOF(ReadFile) Then Repeat + {$I-} + Read(readfile,c); + {$I+} + If EOF(ReadFile) Or (Ioresult <> 0) Or (C = #10) then + O:=True + Else + S:=S+C; + Until O; + ReadLine:=S; +End; Begin v:=false; -nfile:='i:\pmail\in\numfile'; -mfile:='i:\pmail\in\mailfile.dos'; -odir:='i:\pmail\in'; +UserId:=GetEnv('ID'); +UserLn:=GetEnv('LN'); +nfile:='F:\mail\'+UserId+'\numfile'; +mfile:='F:\unixmail\'+UserLn; +odir:='F:\mail\'+UserId; for i:=1 to paramcount do begin sl:=paramstr(i); @@ -41,6 +63,7 @@ begin if (pos('/?',sl)=1) or (pos('/H',sl)=1) or (pos('/HELP',sl)=1) then begin Writeln('Copyright 1996/9 Dud software'); + Writeln(' Modifications by EL GUIDO'); Writeln; Writeln('Purpose: Creates *.cnm files from a unix mail file for Pegasus'); Writeln('Usage: marsmail.exe [/n=x:\numb\file] [/m=y:\mail\file]'); @@ -121,7 +144,8 @@ end; while not eof(mailfile) do begin - readln(mailfile,miline); + {readln(mailfile,miline); this was the problem, the next is the solution} + miline:=readline(mailfile); if v then write(mi,':'); prevline:=shortline; shortline:=false; @@ -171,4 +195,3 @@ end; writeln(' '); if v then writeln('Program finished.'); end. {of program} - diff --git a/monlan b/monlan new file mode 100755 index 0000000..75bd374 --- /dev/null +++ b/monlan @@ -0,0 +1,64 @@ +#!/bin/bash +# +# Monlan can monitor some of your network resources and inform you +# about failures... +# + +FLT=0 +MLOG='/var/log/unitrace.log' +LLOG='/var/log/unilast.log' +MACHINE=lc.labinf.uaa.mx +PARTOFIP=148.211 + +if [ ! -f $MLOG ]; then + touch $MLOG +fi + +while /bin/true; do + touch $LLOG + NOW=`date` + FLT=0 + DNSFLT=0 + +# Reset last log entry + echo "Last error: " > $LLOG + +# check for nslookup failures + /usr/bin/nslookup $MACHINE | grep '$PARTOFIP' 2>&1 > /dev/null + if [ $? -eq 1 ]; then + ER="Name lookups on our domain failed on $NOW. " + echo "$ER" >> $MLOG + echo "$ER" >> $LLOG + FLT=1 + DNSFLT=1 + fi +#echo "Fault status $FLT" + if [ "$FLT" = "0" ] ; then +# echo "Nslookup is well" ; + for l in machine_list ; +# i.e. rauteg misty raulink rau3 ing1 rkw info raulink caesar.wits.ac.za shannon.ee.wits.ac.za hippo.ru.ac.za ; + do +# echo "Pinging $l" + /bin/ping $l -c 5 -n | grep '100%' 2>&1 > /dev/null + if [ $? -eq 0 ]; then + ER="Cannot ping $l on $NOW. Possible cable fault or machine failure?" + echo "$ER" >> $MLOG + echo "$ER" >> $LLOG + FLT=1 + fi + done + fi +# Alerter code.... + + if [ "$FLT" = "1" ]; then + if [ "$DNSFLT" = "0" ] ; then + echo "." >> $LLOG + cat $LLOG | /bin/mail -s "Network failure" netadmin@your.site.name + sleep 240 + fi + FLT=0 + DNSFLT=0 + fi +sleep 900 ; +done + diff --git a/newuser.pl b/newuser.pl new file mode 100755 index 0000000..c31bf76 --- /dev/null +++ b/newuser.pl @@ -0,0 +1,360 @@ +#!/usr/bin/perl +# +# New user script +# +# This script gets called from a web form where users apply for usership +# on your server. It creates a executable file that you as admin can +# just run and the user gets created without headaches. + +$| = 1; + +if ($ENV{'REQUEST_METHOD'} eq 'POST') +{ + +$base="/hamster/home"; + + +chop($date = `date`); +chop($ddd = `date +\%j\%H\%M`); +print "Content-type: text/html\n\n"; +print <<"HTML"; + +New user details completed + +MY OWN LOGO
+

New User Application

+HTML + + read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); + @pairs=split(/&/, $buffer); + foreach $pair(@pairs) + { + ($name, $value) = split(/=/, $pair); + $value =~ tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + $contents{$name} = $value; + $contents{'remoteip'} = $ENV{'REMOTE_ADDR'}; +# print "$contents{$name} = $value
\n"; + } +# Check if some-one gave in a bullshit form. +if (($contents{'fname'} eq '') or ($contents{'sname1'} eq '')) +{ +print <<"HTML"; +
+Dear person working from machine or proxy $ENV{'REMOTE_ADDR'}, do WE have some +news for you:

+ +Oh boy! You cannot even complete a form! How do you think it makes you look? +At least fill in a Full name and one username, else this form is useless!

+ +Please take some time and consider if you are really capable of using a +computer and if you should apply for usership. +If your previous attempt to fill in a form turned out like this +then we do not consider you a good canidate. +Take a deep breath. + +Use your browsers BACK button and +try again! +


+ + +HTML +exit; +} +else { ; } +print <<"HTML"; +Thank you for taking the time to complete the form. Please read the following +information carefully. Use your browsers save function to save this page to +a file. It will act as a receipt of your new (possible) user account.

+ +If we think that the IP $contents{'remoteip'} that you appear to work from is +not in our domain, extra effort will be made to ensure that +you are in fact a valid applicant.

+ +

This is how your details will appear to others: +

+ + + + + + +
Name +$contents{'fname'} +HTML + +if ($contents{'addtitle'} eq 'addmytitle') +{ +print <<"HTML"; + ,$contents{'title'} +HTML +} +else +{ ; } + +print <<"HTML"; + $contents{'fname'} +
+Office$contents{'office'}
Username choices:$contents{'sname1'}, +$contents{'sname2'} or $contents{'sname3'}
Work Tel: $contents{'wtel'}Home Tel: $contents{'htel'}
Stud/ID number: $contents{'idnum'}
Birthdate: $contents{'bidate'}

+ +You will most probably granted the first choice of username, unless it clashes +with an existing name, is too short or too close to a swearing word. +

PLEASE PHONE netadmin at 555-5555 to arrange a password for your account + +$contents{'reff'} is your reference person or study leader that will be +contacted at email address $contents{'refmail'}. +Your account might be stopped if the reference person does not know you or give us a good reason to do so.

+ +Reason why you would like to be a network user: +$contents{'whyi'}

+You rate yourself a $contents{'skill'} computer user that will be using +$contents{'os'} as your primary operating system. You also have some knowlage on +$contents{'oos1'} $contents{'oos2'} $contents{'oos3'} $contents{'oos4'} +$contents{'oos5'} $contents{'oos6'} $contents{'oos7'} $contents{'oos8'} +$contents{'oos9'}

+Please read the section on operating systems carefully to give you a broader understanding on how to connect to the network. +HTML + +if ($contents{'helpme'} eq 'yes') +{ +print <<"HTML"; + You are also interrested in giving a helping hand with network related problems. Good! As soon as there is a problem near you, you will be seen as the +solution. We'll keep in touch. +HTML + +} +else +{ ; } + +print <<"HTML"; +

Your feedback on the questionaire will be stored in a database for future +refference. These details will give us direction on how to expand the network +services. +

You rate the following services: +

+ + + + + + + + +
E-Mail and other communication tools: $contents{'s1'}
WWW for info search and research:$contents{'s2'}
Wordprocessing and office based work:$contents{'s3'}
Cruising internet for fun and pleasure$contents{'s4'}
Engineering apps CADCAM, PCB etc.$contents{'s5'}
Shareware source$contents{'s6'}
Programming apps, VisC, Pascal, VB etc$contents{'s7'}
Storage of files and userdata$contents{'s8'}
Exam results electronic lecture notes.$contents{'s9'}
+ +

You would like to see the following services at Our Site (Let's pray together that it will happen soon...):
+$contents{'future'}

+ +You think that $contents{'numstaff'} staff member(s) is/are needed to maintain our network.

+According to you an amount of $contents{'hypopay'} is fair for a network account per year, as long as you can get the no $contents{'hserv'} service you asked for. +

+


+Thank you for submitting this request for a new user account. +Your account will be processed by +adminuser\@your.domain.name or +bigboss\@your.domain.name. Please give us a few days to decide whether you would make a suitable user. It normally takes only a few minutes to create the account if one of us is close-by. +
+

Futher information

+You automagically get the following as a bonus: +
    +
  • Electronic mail (Your email account will most probably be $contents{sname1}\@your.domain.name) +
  • Your own WWW page which you can customize from anywhere. +
  • Your own public ftp site +
  • Secure storage space for your data on the file server +
  • Access to our software and shareware +
  • Remote access to your data, where-ever you are roaming about. +
  • A public accessible read-write file area to exchange data with others. +
  • Automated secure backups of your data +
+

+Follow this link to get more detailed information on the services and how to make use of it. + +


+This automated service creates a file that could create your new account with +a single keypress, if the network administrator feels like it. ALL you need to +do on your own is to visit the network center to select a password for yourself.Even with the account created it will not be active before you either phone or visit your network admin to set up your password. +
+Last updated 960916 + + + +HTML + +# Now create email message and mail it. +$subject = "New User application - $date"; +$sendto = "adminuser\@your.domain.name, bigboss\@your.domain.name"; + +# open named pip to send mail +open (MAIL, "| /usr/sbin/sendmail $sendto") || die "Cannot send mail: $!\n"; +# this selects the open handle to send email: +select(MAIL); +print <<"EMAIL"; +Date: $date +From: root\@your.domain.name +Return-Path: <$contents{'refmail'}> +To: $sendto +Subject: $subject + +This is an automated reply to the http://yourweb.site.name/ohform.html script. + +New user application details - $date +Please note: A file was created under $contents{'base'}/httpd/newuser/$contents{'sname1'}.$ddd +that can be directly executed by root in order to create the account. +EMAIL + +if ($contents{'addtitle'} eq 'addmytitle') +{ +print <<"EMAIL"; +Full name: $contents{'title'} $contents{'fname'} +EMAIL + +} + +else +{ print <<"EMAIL"; +Full name: $contents{'fname'} +EMAIL +} + +print <<"EMAIL"; +Working from machine or proxy: $contents{'remoteip'} +Title: $contents{'title'} + +Username1: $contents{'sname1'} +Username2: $contents{'sname2'} +Username3: $contents{'sname3'} + +Office: $contents{'office'} +WorkPhone: $contents{'wtel'} +HomePhone: $contents{'htel'} +Birthdate: $contents{'bidate'} +Stud/ID number: $contents{'idnum'} +Refference Person: $contents{'reff'} +Refference Email : $contents{'refmail'} +Would like to help with network problems?: $contents{'helpme'} + +Skill: $contents{'skill'} +Primary operating System: $contents{'os'} +Knowlage on: $contents{'oos1'} $contents{'oos2'} $contents{'oos3'} $contents{'oos4'} $contents{'oos5'} $contents{'oos6'} $contents{'oos7'} $contents{'oos8'} $contents{'oos9'} + +Usership plea: $contents{'whyi'} + +Questionaire +============ +Email: $contents{'s1'} +WWW: $contents{'s2'} +Office: $contents{'s3'} +FunGames: $contents{'s4'} +Apps: $contents{'s5'} +Shareware: $contents{'s6'} +Programming: $contents{'s7'} +Storage: $contents{'s8'} +Exam and notes: $contents{'s9'} +Staffnum: $contents{'numstaff'} +YearFee: $contents{'hypopay'} +ServiceLevel: $contents{'hserv'} +ConnectionValue1: $contents{'userv'} +ConnectionValue2: $contents{'nserv'} +MonthAccount: $contents{'aserv'} +AccountMethod: $contents{'aget'} +AccountExtra: $contents{'aret'} + +Services interrested in +======================= +BirthdayNotify: $contents{'c0'} +VoiceMail: $contents{'c1'} +PinupNotice: $contents{'c2'} +AppointRemind: $contents{'c3'} +GlobalPhoneBook: $contents{'c4'} +LocalIRCserver: $contents{'c5'} +AutomatedSoftwareInstalls: $contents{'c6'} +VoiceDictation: $contents{'c7'} +ExamsonComputers: $contents{'c8'} +VideoLectures: $contents{'c9'} +VideoConference: $contents{'c10'} +SharedAppointment: $contents{'c11'} +AnimatedMultimedia: $contents{'c12'} +StudentResults: $contents{'c13'} +HWSFTWMonitor: $contents{'c14'} + + +Please phone the user and ask him/her to come and select a password for themselves. + +From your friendly automated Webserver running Mars. +EMAIL +close(MAIL); + +# Append questionaire to the log. +open(CATFILE, ">> /var/log/newusr.questionaire") || die "Cant update newuser questionaire list"; +select(CATFILE); +print "$contents{'fname'}:"; +print "$contents{'skill'}:"; +print "$contents{'helpme'}:"; +print "$contents{'os'}:"; +print "$contents{'oos1'}:"; +print "$contents{'oos2'}:"; +print "$contents{'oos3'}:"; +print "$contents{'oos4'}:"; +print "$contents{'oos5'}:"; +print "$contents{'oos6'}:"; +print "$contents{'oos7'}:"; +print "$contents{'oos8'}:"; +print "$contents{'oos9'}:"; +print "$contents{'s1'}:"; +print "$contents{'s2'}:"; +print "$contents{'s3'}:"; +print "$contents{'s4'}:"; +print "$contents{'s5'}:"; +print "$contents{'s6'}:"; +print "$contents{'s7'}:"; +print "$contents{'s8'}:"; +print "$contents{'s9'}:"; +print "$contents{'hserv'}:"; +print "$contents{'userv'}:"; +print "$contents{'nserv'}:"; +print "$contents{'aserv'}:"; +print "$contents{'aget'}:"; +print "$contents{'aret'}:"; +print "$contents{'c0'}:"; +print "$contents{'c1'}:"; +print "$contents{'c2'}:"; +print "$contents{'c3'}:"; +print "$contents{'c4'}:"; +print "$contents{'c5'}:"; +print "$contents{'c6'}:"; +print "$contents{'c7'}:"; +print "$contents{'c8'}:"; +print "$contents{'c9'}:"; +print "$contents{'c10'}:"; +print "$contents{'c11'}:"; +print "$contents{'c12'}:"; +print "$contents{'c13'}:"; +print "$contents{'c14'}\n"; +close(CATFILE); + +# Create an autouser script +open(NFILE, "> $contents{'base'}/httpd/newuser/$contents{'sname1'}.$ddd") || die "Cannot create autouser file"; +select(NFILE); +print "#/bin/bash\n\n"; +print "/usr/sbin/ohmasteruser \"$contents{'sname1'}\" "; +if ($contents{'addtitle'} eq 'addmytitle') +{ +print "\"$contents{'title'} "; +} +else +{ print "\""; } +print "$contents{'fname'}\" "; +print "\"$contents{'office'}\" "; +print "\"$contents{'wtel'}\" "; +print "\"$contents{'htel'}\" "; +print "\"$contents{'bidate'}\"\n"; +print "\n\n# Other names if it is a clash: $contents{'sname2'}"; +print "\n# Other name: $contents{'sname3'}\n"; +close(NFILE); +$a=`chmod +x "$contents{'base'}/httpd/newuser/$contents{'sname1'}.$ddd"`; +$a=`chmod o-rwx "$contents{'base'}/httpd/newuser/$contents{'sname1'}.$ddd"`; +$a=`chmod g-rwx "$contents{'base'}/httpd/newuser/$contents{'sname1'}.$ddd"`; +} +exit; diff --git a/nomasteruser b/nomasteruser new file mode 100755 index 0000000..cf42e2e --- /dev/null +++ b/nomasteruser @@ -0,0 +1,134 @@ +#!/bin/bash +# +# This scripts complements ohmasteruser by destroying accounts and doing +# some cleanup... + + +user=$1 # username passed to this script +DHOME="/hamster/home" # place for home dirs +BASE="/hamster" # place before SYS volume +SNAME="nw-admin" # supervisor name +SHOME="supervis" # Supervisor home dir + +#Get user name +if [ "$user" = "" ] +then + echo -n "What user should be cast into the pit: " + read user +fi + +# Check existing +if ! grep "^$user:" /etc/passwd > /dev/null +then + echo "Removing Nonexisting users lead to time paradoxes, I quit!" + exit +else + echo -n "Are you sure? (Type yes) " + read yn + if [ "$yn" != "yes" ] + then + echo "Chicken!" + exit + fi +fi + +#11th commandment: thou should make backups +cp /etc/passwd /etc/passwd.notmp +cp /etc/group /etc/group.notmp + +# Remove user from passwd file +echo -n "Removing user from password file..." +cat /etc/passwd | sed "/^$user:/d" > /etc/passwd.lock +mv -f /etc/passwd /etc/passwd- +mv -f /etc/passwd.lock /etc/passwd +echo "done..." + +# Remove user from shadow passwd file +echo -n "Removing user from shadow password file...." +mv /etc/shadow /etc/shadow- +cat /etc/shadow- | sed "/^$user:/d" > /etc/shadow +echo "done..." + +# Remove user from group file +echo -n "Removing user from group file.... " +cat /etc/group | sed "/^$user:/d" > /etc/group.lock +mv -f /etc/group /etc/group- +mv -f /etc/group.lock /etc/group +cat /etc/group | sed "s/:$user,/:/" > /etc/group.l1 +cat /etc/group.l1 | sed "s/,$user,/,/" > /etc/group.l2 +cat /etc/group.l2 | sed "s/,$user$//" > /etc/group.l3 +mv -f /etc/group /etc/group- +mv -f /etc/group.l3 /etc/group +rm /etc/group.l1 /etc/group.l2 +echo "done..." + +# Remove user from expiry file +echo -n "Removing user from account expiry file... " +cp /etc/expiry /etc/expiry- +cat /etc/expiry- | sed "/^$user:/d" > /etc/expiry +echo "Done..." + +# Remove user from birthdays file +echo -n "Remove user from birthdays file.... " +cp /etc/birthdays /etc/birthdays- +cat /etc/birthdays | sed "/^$user:/d" > /etc/birthdays +echo "Done...." + +echo -n "Removing user from mail delivery notification file.... " +cp /etc/ohmaillist /etc/ohmaillist- +cat /etc/ohmaillist- | sed "/^$user$/d" > /etc/ohmaillist +echo "Done..." + +# Remove user's mail box +echo -n "Removing user's mailbox..." +rm /var/spool/mail/$user +rm /tmp/mail/$user +echo "done..." + +# Remove user's files +echo -n "Should I remove all $user's data as well? (Type yes) " +read yn +if [ "$yn" = "yes" ] +then + echo "Removing ..." + rm -r $DHOME/$user + rm -r $DHOME/httpd/html/$user + +# here needs to be some code to delete the novell mailbox as well + + NOVMAIL="`ls -l $BASE/SYS/mail | grep " $user " | colrm 1 55`" + if [ "$NOVMAIL" != "" ] ; then + echo -n "Removing Novell mailbox $NOVMAIL ... " + rm -r $BASE/SYS/mail/$NOVMAIL + echo "done..." + fi +fi + +echo -n "Updating myusers.html... " +$DHOME/httpd/cgi-bin/nph-users > /$DHOME/httpd/html/myusers.html +chmod 755 $DHOME/httpd/html/myusers.html +echo "done..." + +echo -n "Removing user from Novell binderies... " +echo -e "#DELETE $user^\r\n" >> $DHOME/$SHOME/users.usr +chown $SNAME.$SNAME $DHOME/$SHOME/users.usr +echo -n "done..." + +# The following removes stuff from the dummy group and passwd file for ftp +echo -n "Updating passwd clone in ..base../home/etc... " +cat /etc/passwd | cut -f 1,3,4,5,6,7,8,9,10 -d : - | sed s/:/:*:/ > $DHOME/etc/passwd +cp /etc/group $DHOME/etc/group +echo "done..." + + +echo "Supervisor, please just logon to marsserver to remove this user automagically." +echo "" +echo "Password linecount: bottom number should be one less" +wc /etc/passwd.notmp +wc /etc/passwd +echo "Groupfile linecount: bottom number should be one less" +wc /etc/group.notmp +wc /etc/group +echo "All done, please inform user $user of his non-existance" + +#DONE... diff --git a/nph-users b/nph-users new file mode 100755 index 0000000..5aa7a60 --- /dev/null +++ b/nph-users @@ -0,0 +1,64 @@ +#!/bin/sh +# This script creates the html document that displays your current +# users on the mars/samba server in a nice html format + +base="/hamster/home/" # Base dir of home dirs + + +echo "" +echo "Mars Server - Current users" +echo "" +echo "

MarsServer User List and Email addresses

" +echo 'Nice graphic that you cannot see' +echo "" +echo "

(See how much diskspace is in use by the users)

" +touch /tmp/ulist.tmp +rm /tmp/ulist.tmp +mv /etc/ohulist /etc/ohulist- +touch /tmp/ulist.tmp + +for l in `ls $base/httpd/html`; +do + LNAME=`grep "^$l:" /etc/passwd | cut -f 5 -d : - | cut -f 1 -d , -` + if [ $l = "ftp" ]; then LNAME=""; fi + if [ $l = "gopher" ]; then LNAME=""; fia + +### NNNB Please add simular lines not to display other kinds of autousers. + + if [ "$LNAME" != "" ]; then + echo "$LNAME : $l" >> /tmp/ulist.tmp + fi +done + +cat /tmp/ulist.tmp | sort > /tmp/ulist2.tmp +rm /tmp/ulist.tmp +cat /tmp/ulist2.tmp | cut -f 2 -d : - > /tmp/ulist3.tmp +rm /tmp/ulist2.tmp + +echo "

" + + +for l in `cat /tmp/ulist3.tmp`; +do + LNAME=`grep "^$l:" /etc/passwd | cut -f 5 -d : - | cut -f 1 -d , -` +# OFONE=`grep $l /etc/passwd | cut -f 5 -d : - +# echo "$LNAME with $l" + echo -n '" + echo -e "$LNAME \t\t\t email: $l@email.domain.name" >> /etc/ohulist + done +echo "
' + echo -n "$LNAME' + echo "$l@eng.rau.ac.za
" +echo "This service brought to you by Marsmail scripting." +echo "
" +echo "(Use your browsers BACK button to go back to the main page.)" +echo -n "" +echo -n "" + + +rm /tmp/ulist3.tmp diff --git a/ohbirthcheck b/ohbirthcheck new file mode 100755 index 0000000..d422b77 --- /dev/null +++ b/ohbirthcheck @@ -0,0 +1,98 @@ +#!/bin/bash + +# Birthday reminder script for Mars and/or Samba +# This scripts sends out automated email for logged in users and the +# birthday boy on the correct date and should be started out of cron +# once a day before teatime :) +# Script creates a birthday.html file that can be included in another +# page. Script logs into mars server with mailusr and does nwuserlist. +# script can be linked to a notice board.... (i've edited it out though!) + +# bpath=basepath +# lpath=logpath +# nowdate = current date e.g. Oct 24 + +srvname="ohmaster" #Samba or mars server +marssrv="ohamster" #Mars server name +mailusr="agenericmailusertodonwuserlists" #Mail user +mailpwd="passwdforgenericmailuser" #Mail user passwd +admname="eddie" #your administrator email name +admfullname="Eddie Dunckley" #Full name +site="RAU Engineering" #Your site name +fqdn="ohmaster.rau.ac.za" +bpath="/hamster/home/httpd/html/main" # where to place birthday.html +lpath="/var/log" # Path to keep log files +nowdate=`/bin/date | /usr/bin/awk ' { print $2 " " $3 } ' ` + + + +# Script starts here +: > $bpath/birthday.txt # clears the birthday file + +/usr/bin/grep -i ":$nowdate:" /etc/birthdays > $bpath/birthday.txt + +if [ `ls -l $bpath/birthday.txt | /usr/bin/awk ' { print $5 } '` != 0 ] ; +then + echo -en "$nowdate: Birthday's happening today:\r\n" > $bpath/bday.txt + echo -en "-----------------------------------------------\r\n" >> $bpath/bday.txt + echo -en "\r\n" >> $bpath/bday.txt + echo "
Current Birthdays for $nowdate:
" > $bpath/bday.inc + +else + : > $bpath/bday.inc + touch $bpath/bday.txt + rm $bpath/bday.txt +fi + +for birthuid in `cat $bpath/birthday.txt | cut -f 1 -d ":"` ; +do +birthguys=`/usr/bin/grep "^$birthuid:" $bpath/birthday.txt | cut -f 2 -d ":"` +birthstring=`/usr/bin/grep "^$birthuid:" $bpath/birthday.txt | awk -F ":" ' { print $4 } ' ` +echo "" >> $bpath/bday.inc +echo -en "$birthguys's birthday! Send mail to $birthuid@$fqdn...\r\n" >> $bpath/bday.txt +echo -en "$birthguys: $birthstring \r\n" >> $bpath/bday.txt + +cat << EOMES | /usr/sbin/sendmail -f "$admname@$fqdn" -t +To: $birthuid@$fqdn ($birthguys) +From: $admname@$fqdn ($admfullname) +Reply-To: $admname@$fqdn ($admfullname) +Return-path: <$admname@$fqdn> +X-Mailer: Automated Birthday notification scripts +Subject: Happy Birthday: $birthguys! + +Dear $birthguys, + + May you have the best day of your life today. + +Congratulations on your birthday! The whole $site staff and students +are thinking about you today. In far countries strange people are singing +songs in honour of your birth today. + +If you brought cake and drinks along, please invite the $site staff to +join in the festive activities. May $nowdate be one of the best days you've +ever encountered! + +From your friendly Automated $srvname Virtual Server and programmers. +EOMES + +sleep 4 + for lnames in `/usr/sbin/smbstatus | /usr/bin/awk ' { print $5 }' | sort | uniq | /bin/sed "/machine/d" | /bin/sed "1 d" ` ; + do +# echo "Processing $lnames smbside for $birthguys" + echo "NB: It's user $birthuid ($birthguys)'s birthday today!" | /usr/sbin/smbclient -M $lnames 2>&1 > /dev/null + echo "`/bin/date` -- Sent Birthday notice to $lnames" >> $lpath/ohmessage.log + done + for nnames in `/usr/local/bin/nwuserlist -S $marssrv -U $mailusr -P $mailpwd | /usr/bin/awk ' { print $2 } ' | sort | uniq` ; + do +# echo "Processing nsend to $nnames for $birthguys birthday.." + /usr/local/bin/nsend -S ohamster -U ohmessage -P sendthemall $nnames "NB: It's user $birthuid ($birthguys)'s birthday!" + echo "`/bin/date` -- Sent Birthday notice to NetWare user $nnames" >> $lpath/ohmessage.log + done +done + +if [ `ls -l $bpath/birthday.txt | /usr/bin/awk ' { print $5 } '` != 0 ] ; +then + echo "
$birthguys$birthuid@$fqdn$birthstring
" >> $bpath/bday.inc + echo -en "\r\n" >> $bpath/bday.txt + echo -en "May he/her/they become as old as the mountains! --$marssrv\r\n" >> $bpath/bday.txt +fi diff --git a/ohexiry b/ohexiry new file mode 100755 index 0000000..d5183c2 --- /dev/null +++ b/ohexiry @@ -0,0 +1,32 @@ +#!/bin/bash +# +# This will soon be a script to expire users no longer active +# +### WARNING: THIS SCRIPT IS NOT FINISHED!!!! Change to your needs! +# it uses /etc/expiry created by ohmasteruser to determine +# if accounts must be expired or not.... started through cron.... + + +hbase="/hamster/home/httpd/html/main/" +dday=`/bin/date -d "1 month" +%m-%y ` +nday=`/bin/date +%d` + + +for l in `cat /etc/expiry ` ; +do + erflg="0"; + uname=`echo "$l" | cut -f 1 -d ":"` ; + uday=`echo "$l" | cut -f 2 -d ":"` ; + echo "$uday $dday" + if [ "$uday" = "$dday" ] ; then +#issue warning here. + echo "Will expire at 0h00 on the 28th of this month" + if ["$nday" = "28"] ; then + echo "This account has finally expired" + erflg="1" + fi + fi + +#now create a new expiry file +done + diff --git a/ohform.htm b/ohform.htm new file mode 100755 index 0000000..4ddd8b5 --- /dev/null +++ b/ohform.htm @@ -0,0 +1,269 @@ + + +Mars server user application form + + +LOGO
+

+PLEASE NOTE: This service is for OUR SITE's staff and students only!


+Oh Yee, I would like to be enslaved by the Mars Virtual Server. +I hereby apply for usership in the XXX domain and will obey the +Mars's ever-changing rules.

+I take note of the following: +

    +
  • I will keep my home tidy and free of viri, executables, games and dirty stuff. +
  • I will keep my home smaller than 20Mb, since being a slave means sharing living quarters. +
  • I will discard all old email, we don't want the Mars angry, do we? +
  • I will refrain from placing commercial applications in my WWW space +
  • I will refrain from letting other users use my account +
  • I will stop all subscriptions to listservers BEFORE I leave the XXXX domain. +
  • I will clean my home before I depart permanently from the XXXX domain. +
  • I will make use of the online help BEFORE phoning the network staff. +
+
+

User Application form

+ +
+

Applicant's details

+XXXXX needs your pedigree. +If you are found to make a suitable slave (user) you will be notified telephonically. + +

+ Full Name and Surname
+ Title + Add my title to the fullname of the account
+ My office number e.g. Cybernetics B1L1
+Choose a username and two alternatives or or
+Please note: If your name is Peter de Villiers a username of Cyclops + will most definately NOT be accepted. Use pieterdv or pdv or pdevil for the above example.
+

+ Work phone + Home phone
+ Birthday e.g. Oct 24
+ Student, Personnel or ID number
+ + Reference person or Study leader
+ Reference's email addr

+ +

Why do I want to be a user?

+Many persons want to be network users because they +see it as a status symbol or they just want to fool around or saw +one of their friends in front of a PC and thought it looked quite cool. +They don't have the foggiest idea what they will to do IF they become slaves +or what a network is all about. Please explain in a few lines why you would like to become a slave of the XXXX Virtual server. +

+

+


+

Questionaire

+Please complete the following questionnaire. It will help us to plan for the +future. This is your chance to make a difference... +

Computer-skills

+My level of computer-skills:

+

    +
  • Newbee barely knows where to switch on the kompewter. + Tries to feed mouse.
    +
  • Beginner knows how to use mouse and click on icons to open programs
    +
  • Average user customizes his desktop scheme and types install to install programs.
    +
  • Advanced user compiles his own programs and installs operating systems.
    +
  • Master hacks unix boxes and knows NOS and writes device drivers in ASM.
    +
  • Guru lives in a cave with his Mother-in-Law +
+ + NewBee + Beginner + Average + Advanced + Master + Guru

+ +Are you interested in helping out with network related work? + YES + NO

+ +

My first choice operating system

+
    +
  • DOS users like the wording Non-reentrant interrupt handler +
  • Win3xx and fw users like to press the GPF button +
  • Win95 users like non-protected net,cd,diskcache and hairthin crashprotection +
  • OS/2 users enjoy the power of raw multithreading, but cannot spell multiuser +
  • Linux users will willingly spend 5 days doing stuff others do in 15 seconds +
  • NT users enjoy seeing P-PRO-200's run like a 386es, and call themselves gurus +
  • A Solaris user probably has a mother-in-Law. +
  • Mac users smile when waking up. +
  • Other users cannot spell industry standard. +
+ + DOS + Win3.xxfw + Windows 95 + OS/2 + Linux + NT + Solaris + Mac + Other

+ +I can also use some of the following operating systems.
+ DOS + Win3.xx(fw) + Windows 95 + OS/2 + Linux + NT + Solaris + Mac + Other

+ + +

What do I see as the most important function of the network?

+Please give a priority next to the following network services. 1 means you +think it's for the birds and 5 means that if this service should dissappear, +you would die. Please show some sort of personality, all 5's will not impress OhMaster. +

+1 +2 +3 +4 +5 +.. E-Mail and other communication tools
+ +1 +2 +3 +4 +5 +.. World Wide Web for info search and research
+ +1 +2 +3 +4 +5 +.. Word-processing and office based work
+ +1 +2 +3 +4 +5 +.. Cruising internet for fun and pleasure
+ +1 +2 +3 +4 +5 +.. Engineering apps CAD/CAM, PCB design, math etc.
+ +1 +2 +3 +4 +5 +.. Shareware source
+ +1 +2 +3 +4 +5 +.. Programming apps, VisC, Pascal, VB etc.etc.
+ +1 +2 +3 +4 +5 +.. Storage of files and userdata
+ +1 +2 +3 +4 +5 +.. Examination results, electronic lecture notes.
+ +

What I would like to see in future

+What services would you like to see running at XXXXXXXXX in future?

+
+ +

Hypothetical

+How many staff members do you think should design, implement and maintain and +give support to 200 workstations at XXXXXXXXXXX? + +

+If I had to pay for a network account, how much is fair? + per year.

+What level of service would you expect for it? +

    +
  • Will take care of myself. +
  • Show me the ropes how to use services and that's it. +
  • A 3 day course on how to use the LAN software. +
  • Courses plus telephonic software support. +
  • 1 hour response time to software related queries. +
  • Full assistance: Software, hardware, help at my desk. +
+

+I see a network connection as
+

    +
  • A utility like water and electricity I expect XXXXXXXXXX to provide it as a standard. +
  • A extra feature utility like a telephone at a minimal yearly/monthly fee. +
  • A Nice to have utility like airconditioning for my car. I do expect to pay alot to have a network connection in my office. +
  • A luxury item like an expensive watch that I would never be able to afford +
+Having a network connection is
+
    +
  • a total waste of time, highly overrated +
  • a good thing, a bit overrated but it can serve me as a tool +
  • like a speedo in a car, it REALLY makes life easier. +
  • very important if I want to complete projects in time +
  • a way of life. I could not live without it. +
+What would I like to see on a monthly network account? +
    +
  • NO! No monthly account! +
  • The amount of diskspace I use +
  • Diskspace and time I've spent at a live connection. +
  • Diskspace, time and local vs international traffic I've generated. +
  • Diskspace, time, traffic and a list of files I've accessed. +
+

+If you were forced to a monthly account, how would you like to receive it?
+ via Email + on the Web + both + Old-fashioned snailmail paper account.

+Would you like to see the results of ALL the users or just your own.
+ Just my own + All the users + Detailed myself, summary all.

+ +Which of the following services would I like?
+

    +
  • Birthday notification of other users +
  • Voice email if I have a soundblaster +
  • Open graphical noticeboard +
  • Appointment reminder +
  • Global telephone book +
  • An Internet Relay Chat server +
  • Automated software installation and updates +
  • Voice navigation and dictation software +
  • Examinations via computer terminals +
  • Video lectures and Web notes +
  • Video conferencing +
  • Shared appointment books +
  • Animated multimedia announcements +
  • Student results on the web +
  • Hardware and software monitoring on my station +
+
+
+ + +
+There is no guarrantee that xxxxxxxx will accept you as a user. This service was brought to you by the creaters of the xxxxxx virtual server. + + + diff --git a/ohlogscr.bat b/ohlogscr.bat new file mode 100644 index 0000000..d48c3fe --- /dev/null +++ b/ohlogscr.bat @@ -0,0 +1,42 @@ +@ECHO OFF + +rem DOS BATCH FILE +rem File is called ohlogscr.bat and gets called with an exit "ohlogscr.bat" +rem from the master mars login script.... +rem unix2dos this file before using it. + +echo . +rem +rem I: is a map to the user directory. +rem +if not "%name%"=="SUPERVIS" goto aaa +if not exist i:\users.usr goto aaa +i: +cd \ +cls +echo Creating new users and destroying old ones. +rem Use makeuser script from novell to create/destroy the new/old users +makeuser users.usr +type users.rpt | more +copy users.old + users.usr users.lst > nul +copy usrpt.old + users.rpt usrpt.lst > nul +copy users.lst users.old > nul +copy usrpt.lst usrpt.old > nul +del users.rpt > nul +del users.usr > nul +f: +pause + +:aaa + +rem +rem Place your normal household stuff in here...... +rem all the variable names below gets created in the master login script + +Echo ________________________________________________________________________ +echo Welcome %LONGNAME% driving on your %MACHINE% from IPX node %NETADDR%:%NODE% +echo Your %OSTYPE% %OSVER% is far too outdated for THIS powerfull server! +echo Your mailbox is %MBOX% and your temp directory is set to %TEMP% +echo It looks like we're ready to rock and roll!! +Echo ________________________________________________________________________ + diff --git a/ohmail b/ohmail index aa55fda..3333b42 100755 --- a/ohmail +++ b/ohmail @@ -1,11 +1,26 @@ #!/bin/bash +# +# Purpose: This shell script will list all users logged in via samba or +# mars and see if it needs to inform them about new mail waiting.. +# Please create a generic mail handling user on mars and customize this +# script for your needs... +# + +marsserver="YourMarsServerName" +mailusr="auseronmarsthathandlesmailnotification" +mailusrpwd="passwordforyourgenericmailuser" + while [ true ] ; do + nwuserlist -S $marsserver -U $mailusr -P $mailusrpwd > /tmp/nwusers.list + smbstatus > /tmp/smbusers.list for x in `cat /etc/ohmaillist` do /usr/sbin/ohmessage $x sleep 1 done - sleep 5 + sleep 120 done + +# ohmail needs to be installed in /usr/sbin together with ohmessage. diff --git a/ohmasteruser b/ohmasteruser new file mode 100755 index 0000000..414a508 --- /dev/null +++ b/ohmasteruser @@ -0,0 +1,230 @@ +#! /bin/sh +# +# adduser 1.0: a utility to add users to the system +# Copyright (C) 1994 Ian A. Murdock +# Sorry Ian, dud was ere. +# Modified by Marc Ewing for RHS Linux +# Modified by gac@eng.rau.ac.za, adw@chopin.rau.ac.za, fwo@eng.rau.ac.za, +# eddie@rau.ac.za to work great with mars and samba + +# Enhancements: Automagically creates user on mars server side.... +# Please edit the login script of supervisor user to link into this +# script... +# Updates a birthday reminder database +# updates an expiry database +# ensures an ftp-only shell + +# Everything happens too fast, so don't let the user interrupt. +trap "" 1 2 3 15 + +# Set a few important variables before getting started. +NUMARG=$# +LOGIN="$1" +FNAME="$2" +OFFICE="$3" +WTEL="$4" +HTEL="$5" +BDATE="$6" +EXIST=0 +NOHOME="$7" + +PASSWD="/etc/passwd" +PBAK="/etc/passwd-" # Some programs use /etc/passwd-, others use + # /etc/passwd.OLD. Take your pick. + +GROUP="/etc/group" +GBAK="/etc/group-" + +PLOCK="/etc/ptmp" # Standard method of locking the password file. + +DSHELL="/etc/ftponly" +DHOME="/hamster/home" # modify this to point to base home dirs. +SKEL="/etc/skel" +SPOOL="/var/spool/mail" +FIRST_UID=500 +FIRST_GID=500 + +# A few sanity checks... +if [ `id -u` != 0 ]; then + echo "Only root may add users to the system." ; exit 1 +fi + +if [ $NUMARG = 0 ]; then + echo "You need to specify the login to add; for example, \`adduser" \ + "imurdock'." ; + echo "e.g. ohmasteruser username fullname office worktel hometel birthdate"; + exit 1 +fi + +id $LOGIN >/dev/null 2>/dev/null && EXIST=1 + +if [ $EXIST = 1 ]; then + echo "The login $LOGIN already exists." + exit 1 +fi + +if [ -f $PLOCK ]; then + echo "$PASSWD is locked. Try again later." ; exit 1 +fi + +# And now the program begins: +cp $PASSWD /etc/passwd.tmp +cp $GROUP /etc/group.tmp +echo "" ; echo -n "Looking for first available UID..." +NUID=`cut -f 3 -d ":" $PASSWD | sort -n | awk -v uid=$FIRST_UID ' + { if ($1 == uid) uid = uid + 1; } +END { print uid; } +'` + +if [ $NUID -ge 65536 ]; then + echo "Sorry, ran out of uids." + exit 1 +fi +echo " $NUID" + + +echo -n "Looking for first available GID..." +NGID=`cut -f 3 -d ":" $GROUP | sort -n | awk -v gid=$FIRST_GID ' + { if ($1 == gid) gid = gid + 1; } +END { print gid; } +'` + +if [ $NGID -lt $FIRST_GID ]; then + NGID=$FIRST_GID +fi +echo " $NGID" + +echo "" ; echo -n "Adding login: $LOGIN..." +touch $PLOCK ; + +cp $PASSWD $PBAK +echo "$LOGIN:*:$NUID:$NGID:New User:$DHOME/./$LOGIN:$DSHELL" >> $PASSWD + +# Add user to users group +cp $GROUP $GBAK +sed "s/^\(users.*[^:]\)\$/\1,$LOGIN/" < $GBAK | +sed "s/^\(users.*:\)\$/\1$LOGIN/" > $GROUP + +#sed "s/^\(users.*[^:]\)$/\1,$LOGIN/" < $GBAK | +#sed "s/^\(users.*:\)$/\1,$LOGIN/" > $GROUP + +# Add user to httpd group +cp $GROUP $GBAK +sed "s/^\(httpd.*[^:]\)\$/\1,$LOGIN/" < $GBAK | +sed "s/^\(httpd.*:\)\$/\1$LOGIN/" > $GROUP + +echo "$LOGIN::$NGID:$LOGIN" >> $GROUP + +rm -f $PLOCK +echo "done." + +if [ "x$NOHOME" = "x" ]; then + echo -n "Creating home directory: $DHOME/$LOGIN..." + mkdir $DHOME/$LOGIN + chmod 2770 $DHOME/$LOGIN + cp -a $SKEL/.??* $SKEL/* $DHOME/$LOGIN >/dev/null 2>/dev/null + chown -R $NUID.$NGID $DHOME/$LOGIN + echo "done." +fi + +echo -n "Creating mailbox: $SPOOL/$LOGIN..." +touch $SPOOL/$LOGIN ; chmod 660 $SPOOL/$LOGIN ; chown $NUID.mail $SPOOL/$LOGIN +echo $LOGIN >> /etc/ohmaillist +echo "0" > /tmp/mail/$LOGIN +echo "Done.." + +echo "" +echo "Don't forget to set the password." +if [ "x$NOHOME" != "x" ]; then + echo "" + echo "The home directory for $LOGIN was set to $DHOME/$LOGIN but the directory" + echo "was not created. Be sure that you set it up properly." +fi + +if [ "x$FNAME" = "x" ] ; then # Added to show account expiry times.. + passwd $LOGIN # creates /etc/expiry + chfn $LOGIN + echo -n "Expiry date: (mm-yy) " + read expiry + echo "$LOGIN:$expiry" >> /etc/expiry + echo -n "Birthdate: (e.g. Oct 24) " + read BDATE + echo "$LOGIN:$FNAME:$BDATE:Happy Birthday!" >> /etc/birthdays +else +# echo "default" | passwd -P $LOGIN + FNAME=`echo "$FNAME" | sed 's/[,:]/ /g'` + OFFICE=`echo "$OFFICE" | sed 's/[:,]/ /g'` + WTEL=`echo "$WTEL" | sed 's/[:,]/ /g'` + HTEL=`echo "$HTEL" | sed 's/[:,]/ /g'` + chfn -f "$FNAME" -r "$OFFICE" -w "$WTEL" -h "$HTEL" $LOGIN + expiry="12-97" + echo "$LOGIN:$expiry" >> /etc/expiry + echo "$LOGIN:$FNAME:$BDATE:Happy Birthday!" >> /etc/birthdays +fi + +echo -n "Creating an example www home page..." +mkdir $DHOME/httpd/html/$LOGIN # point to your webroot +chown $NUID.$NGID $DHOME/httpd/html/$LOGIN +chmod 755 $DHOME/httpd/html/$LOGIN +LONGNAME="`grep "^$LOGIN:" $PASSWD | cut -f 5 -d : - | cut -f 1 -d , -`" +/usr/sbin/wwwhomepage "$LONGNAME" $LOGIN > $DHOME/httpd/html/$LOGIN/index.htm +chown $NUID.httpd $DHOME/httpd/html/$LOGIN/index.htm +chmod 755 $DHOME/httpd/html/$LOGIN/index.htm +cp /etc/.htaccess $DHOME/httpd/html/$LOGIN/.htaccess +chmod 644 $DHOME/httpd/html/$LOGIN/.htaccess +chown root.httpd $DHOME/httpd/html/$LOGIN/.htaccess +pushd . > /dev/null +cd $DHOME/$LOGIN +ln -s ../httpd/html/$LOGIN www +popd > /dev/null +echo "Done..." + +echo "Updating myusers.html" +$DHOME/httpd/cgi-bin/nph-users > /$DHOME/httpd/html/myusers.html +chmod 755 $DHOME/httpd/html/myusers.html + +# Now for the COOOL part: creates users in mars space so that when supervisor +# logs on, new users are created automagically on the novell side so that +# user is immediately available on mars. +# Please have a look at the modified batch file that supervisor login script +# points to..... + +echo "Updating Novell user ID" +echo -e "#NO_HOME_DIRECTORY\r\n" >> /hamster/home/supervis/users.usr + +echo -e "#CREATE $LOGIN;$LONGNAME;default^\r\n" >> /hamster/home/supervis/users.usr + +# Change nw-admin to your admin account on the mars side. + +chown nw-admin.nw-admin /hamster/home/supervis/users.usr + +# The following updates a dummy ftp passwd file that shows correct user and +# group stuff when a user ftp's to the server + +echo "Updating ftp passwd file" +cat /etc/passwd | cut -f 1,3,4,5,6,7,8,9,10 -d : - | sed s/:/:*:/ > $DHOME/etc/passwd +cp /etc/group $DHOME/etc/group + +# The next section creates default disk storage space for users, using +# user wvdw as template. Please man quota to see how disk quotas works.. + +echo "Applying system default disk storage quotas..." +/usr/sbin/edquota -p wvdw $LOGIN + +echo "" +echo "Supervisor, please log on to the Mars server to update the user's Novell login." +echo "" + +# Some sanity checks, if the diff between count is more than one then this +# script messed up. + +echo "Word and linecount of passwd file:" +wc /etc/passwd.tmp +wc $PASSWD +echo "Wordcount of group files:" +wc /etc/group.tmp +wc $GROUP + +# Yip, we're fin.. +echo "OK, Patricia lets go!" +# EOF diff --git a/ohmessage b/ohmessage index e4fbe2e..37060b4 100755 --- a/ohmessage +++ b/ohmessage @@ -1,19 +1,32 @@ #!/bin/bash +# +# Ohmessage: called by ohmail and creates a database of new mail flags +# for users. Sends a message to mars or samba users informing them of +# new mail +# Please create a directory under /tmp called mail where the mail flags +# will be stored.. +# log files will be stored in /var/log. + +marsserver="yourmarsservername" +mailusr="genericmailuseronmars" +mailpwd="genericmailusrpasswd" + + s1="`cat /var/spool/mail/$1 | grep Subject | wc -l`" let s2=`cat /tmp/mail/$1` if let "$s1 > $s2" then - if smbstatus | grep " $1 " > /dev/null + if cat /tmp/smbusers.list | grep " $1 " > /dev/null then - for machine in `smbstatus | grep " $1 " | awk ' {print $5}' | sort | uniq` + for machine in `cat /tmp/smbusers.list | grep " $1 " | awk ' {print $5}' | sort | uniq` do echo "$1 has new mail `grep From: /var/spool/mail/$1 | tail --lines=1`" | smbclient -M $machine 2>&1 > /dev/null echo $s1 > /tmp/mail/$1 echo "`date` -- Sent notification to SMB user $1 at $machine" >> /var/log/ohmessage.log done - elif /usr/local/bin/nwuserlist -S ohamster -U ohmessage -P sendthemall | grep -i " $1 " > /dev/null + elif cat /tmp/nwusers.list | grep -i " $1 " > /dev/null then - /usr/local/bin/nsend -S ohamster -U ohmessage -P sendthemall $1 "New mail `grep From: /var/spool/mail/$1 | tail --lines=1`" + /usr/local/bin/nsend -S $marsserver -U $mailusr -P $mailpwd $1 "New mail `grep From: /var/spool/mail/$1 | tail --lines=1`" echo $s1 > /tmp/mail/$1 echo "`date` -- Sent notification to NetWare user $1" >> /var/log/ohmessage.log fi @@ -21,4 +34,4 @@ echo $s1 > /tmp/mail/$1 fi - +# ohmessage by gac@eng.rau.ac.za, eddie@eng.rau.ac.za diff --git a/ohpostme b/ohpostme index a9c8e6b..2f0e48f 100755 --- a/ohpostme +++ b/ohpostme @@ -1,6 +1,22 @@ #!/bin/bash +# (This is no more needed on the marsmail-02c) +# +# This script runs through all the user dirs to collect mail that needs to +# be sent. +# Pegasus mail for dos will use a gateway that places outgoing mail in +# /home/username/pmail/out. All these messages will be picked up by this +# script and mailed out. +# Please create a file /etc/ohmaillist that contains valid users that +# may send mail from dos pmail logged into mars. +# (I added it to the adduser script so all users can have new mail) +# Format of the ohmaillist file is just a single username per line + +# Replace with the base dir of your home directories i.e. /home +homedirs="/hamster/home" + +# Replace with your domain name +dm="eng.rau.ac.za" -#This script runs through all the user dirs to collect mail that needs to be sent. while [ true ] ; do cd /hamster/home @@ -8,11 +24,13 @@ do do for x in `ls $l/pmail/out` do - cat "$l/pmail/out/$x" | sed "1,4d" | /usr/sbin/sendmail -f "<$l@eng.rau.ac.za>" -t + cat "$l/pmail/out/$x" | sed "1,4d" | /usr/sbin/sendmail -f "<$l@$dm>" -t rm "$l/pmail/out/$x" echo "`date` -- Mail message $x send from $l mailbox" >> /var/log/ohpostme.log done sleep 1 done - sleep 5 + sleep 7 done + +# ohmail - ends here diff --git a/ohquota b/ohquota new file mode 100755 index 0000000..b2ffb79 --- /dev/null +++ b/ohquota @@ -0,0 +1,113 @@ +#!/bin/bash +# +# ohQuota will send disk quota reports to mars and samba and other users +# monthly at a certain time and update a html file that lists global disk +# usage for users. +# run this once a month through cron (see man cron) + +# hbase is the base dir where you would like place the quotas.html file. +hbase="/hamster/home/httpd/html/main/" + +title="RAU Engineering" # Your organization's title +srvname="OhMaster" # Your server's name +fqdn="ohmaster.rau.ac.za" # full fqdn to your mail host +adminemail="root@ohmaster.rau.ac.za" # email of the admin account +wwwsite="www-ing.rau.ac.za/main" # urlpath to hbase + + +# Month is the current month :) +mnth=`date` +dummy="youhavenoteditedthisscript" + +if [ $dummy = youhavenoteditedthisscript ] ; then + echo "Please edit this script to generate your OWN html file!" + exit +fi + +cat < $hbase/quotas.html + + + +$title - Disk quotas for the slaves as on $mnth + +> +$title
+Cnr Ditton and Kingsway Ave, P.O. Box 524, Auckland Park, 2006, Tel +: +27(11)-489-2016, Fax: +27(11)-489-2097 +

+

Disk space usages for the slaves as on $mnth

+These are the messy living quaters of the slaves and the amount of data lying +around in their homeboxes +

+A slave is granted 134,217,728 binary digits of space on the oh-so-precious fast wide scsi's of $srvname for their normal household information +like spreadsheets, important email, scanned images etcetera etcetera. + +Some slaves tend to leave data on the $srvname server without ever removing it. +$srvname gets upset with old data and is busy trying to reduce all files older +than one year on the server to 42 bytes, a magical number picked up from somewhere. + + +

+ +OOOK +for l in `cat /etc/ohmaillist | sort` +#for l in eddie +do +dq=`/usr/sbin/quota $l` +ddq=`/usr/sbin/quota $l | sed ' 1,2 d '` +cat <> $hbase/quotas.html + +APESHIT + +cat < +Reply-to: $adminemail +To: $l@$fqdn <$l@$fqdn> +Subject: $l's diskusage on $srvname +X-Mailer: Automated disk Usage reporter script + +Oh Yee my little slave + +Greetings! + +This is your friendly $srvname virtual server reporting: + +Monthly account: Diskusage as on $mnth: + +$dq + +This is just a friendly reminder of your current disk usage. Don't panic. +You only need to pay respects, no money, this is only for your records. + +This disk usage account will be automatically sent out every month. +Please remove your old data frequently from the server if it is not in +constant use. + +Point your URL to http://$wwwsite/quota.html to see the +diskspace usage of all the users on $srvname. + +Redirect any replies concerning diskspace usage to your smiling net-admin staff. +This is a green service: this message will self destruct in 40 seconds. +(Just kidding!) + +EEEEK + + +done +cat <> $hbase/quotas.html +
User
Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
$l
$ddq
+
+
+disclaimer: $title believes +in freedom of thought and speech. User +webcontent is the responsibility of the user.

+ +Last modified: + + +

+ + +POPO + + diff --git a/ohsendnt b/ohsendnt index 07ce1af..2defe33 100755 --- a/ohsendnt +++ b/ohsendnt @@ -1,4 +1,9 @@ #!/bin/bash +# +# OhSendNt is a console broadcast tool to send messages from the unix console +# to the network users. Usefull for sending broadcasts that server is going +# down in 10 minutes or whatever :) +# messge=$1 machs=$2 diff --git a/pmail.bat b/pmail.bat index 9af239c..a95239d 100755 --- a/pmail.bat +++ b/pmail.bat @@ -1,16 +1,38 @@ @echo off -if not exist i:\pmail\nul mkdir i:\pmail > nul -if not exist i:\pmail\out\nul mkdir i:\pmail\out > nul -if not exist i:\pmail\in\nul mkdir i:\pmail\in > nul -set pmuser=%name% -:SzLoop -Echo Please wait -- converting mail from unix to dos format... -rem chksz f:\unixmail\%name% %temp%\%name% -unix2dos f:\unixmail\%name% > i:\pmail\in\mailfile.dos -rem chksz f:\unixmail\%name% %temp%\%name% -c -rem IF Errorlevel 1 goto SzLoop -copy j:\dos\net\pmail\zero.txt f:\unixmail\%name% > nul -j:\dos\net\pmail\marsmail.exe -i: -cd \pmail\in -j:\dos\net\pmail\pmail.exe -a + +rem This batch file gets called when a dos user wants to run pmail from +rem a menu or command line. +rem It calls marsmail.exe to convert the unix mail file into readable +rem pmail messages. +rem Need linked the unix /var/spool/mail to SYS:/unixmail +rem 1/1000000 chance that user runs marsmail during a mail delivery +rem that might damage the last message coming in... Anybody have any +rem ideas? + +rem variable name get's set in the master login script to the user's +rem login name and the userid. +set pmuser=%ln% +set iduser=%id% + +if not exist f:\mail\%id% mkdir f:\mail\%id% > nul + +rem read the mail directly from the f:\unixmail\%ln% and let it on the +rem f:\mail\%id%\.cnm for pegasus mail + +marsmail.exe +rem if need routes, add it to the line before (g:\pmail\marsmail.exe) + +rem Marsmail is the program that strips the unix mailfile appart and generates +rem a index file and loose message files... Source is included... Please +rem recompile to your needs... + +rem zero.txt is a file zero bytes long but MUST exists in f:\mail ! + +copy f:\mail\zero.txt f:\unixmail\%name% > nul + +rem call the pegasus mail reader in the natural mode +echo Please move all the mail into folders!!! +pause +pmail.exe +rem if need routes, add it to the line before (g:\pmail\pmail.exe) + diff --git a/pmail.cfg b/pmail.cfg deleted file mode 100755 index 921da34..0000000 Binary files a/pmail.cfg and /dev/null differ diff --git a/unix2dos.exe b/unix2dos.exe deleted file mode 100755 index 100dd31..0000000 Binary files a/unix2dos.exe and /dev/null differ diff --git a/wwwhomepage b/wwwhomepage new file mode 100755 index 0000000..18252ae --- /dev/null +++ b/wwwhomepage @@ -0,0 +1,28 @@ +cat << EOF + +$1's own WebPage!! + +

$1's own WebPage

+
-- Hallo World! --
+ +
+I am a new user at The most PowerFull Mars File Server + +
+Please mail me at $2@your.domain.name +to say that you have actually visited my page.

+ +I promise to update this page as soon as I know I have one!

+ +Being a new user on this system I will refrain from discussing any of the following topics on this page:
+

Sex, Religion, Politics, Sport or Business.

+ +

+ +


+
+
+If you have a problem with this page DON'T mail the webmaster! + + +EOF diff --git a/zero.txt b/zero.txt deleted file mode 100755 index e69de29..0000000