marsmail-0.2

This commit is contained in:
Mario Fetka 2011-11-13 00:46:51 +01:00
parent d665510635
commit b9586462cb
7 changed files with 92 additions and 225 deletions

7
README
View File

@ -5,9 +5,4 @@ Authors: Gert Cronje: gac@eng.rau.ac.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).
Please contact Eddie for bug reports etc.etc.

View File

@ -1,45 +1,31 @@
Marsmail ver 0.2c GNU-GPL by EL GUIDO <guido@lux.labinf.uaa.mx> - 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
327 Feb 4 11:53 marsmail.doc This 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
5480 Feb 4 12:51 marsmail.pas dos sources for marsmail
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
793 Feb 4 11:34 ohexiry 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)
1046 Feb 4 09:33 ohpostme handles posting from pegasus to unix
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
@ -49,20 +35,6 @@ file list:
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
@ -74,125 +46,67 @@ 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\<userid> must exist.
There is no mercury, but the Charon Mail Queue Emulation works fine! :-)
-----------
----------- (The pop solution)
the pegasus mail program from one of it's mirror sites. Unpack and follow it's
install method. 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.
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/<VOL> (G: , H: , I: , etc)
HOME -> ~ (G: , H: , I: , etc)
-----------
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.
Start by examining each script carefully - there is a lot of undocumented
features in them...
features in them... Then start by editing the pmdflts.ini to suite your needs.
Use the one included as a template. Read the pmail docs carefully.
----------- (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 /<route>/SYS/unixmail
(but the 0.99pl1 do it in a different way)
-----------
volume space i.e. ln -s /var/spool/mail /home/SYS/unixmail
Run pconfig to create a user defined gateway. Mine looked like this:
----------- (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)
Pegasus Mail/DOS Configuration v3.11
____+---------------------- User Gateway Definition ----------------------+_____
___ ¦ ¦_____
___ ¦ Gateway name : [OH ] ¦+____
___ ¦ *New mail path : i:\pmail\in ¦¦____
___ ¦ Is  a program to run? : N ¦¦____
___ ¦ *New mail search mask : *.cnm ¦¦____
___ ¦ *Outgoing mail path : i:\pmail\OUT ¦¦____
___ ¦ *Run for outgoing mail : ¦¦____
___ ¦ *Filename format : ~d~d.CNM ¦¦____
___ ¦ Run to validate address : ¦¦____
___ ¦ *Reply address format : ~n@eng.rau.ac.za ¦¦____
___ ¦ Accepts SMTP addresses? : Y ¦¦____
___ ¦ Simple message headers? : Simple headers ¦¦____
___ ¦ UUEncode attachments? : N ¦¦____
___ ¦ Burst messages? : N ¦¦____
___ ¦ Strip gateway name? : Y ¦¦____
___ ¦ Force all mail through? : Y ¦¦____
___ ¦ ¦¦____
___ ¦ The name users will use to access this gateway. Addresses will ¦¦____
___ ¦ be entered in the form GWNAME/address. ¦¦____
___ ¦ ¦+____
___ +---------------------------------------------------------------------+_____
___ ______
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.
Edit the pmail.bat to suite your needs. Make sure the drive mappings is correct.
i.e. I: maps to userdir. Compile the marsmail.pas to suite your needs if needed.
Test to see if you can read mail from pegasus and that the gateway places
outgoing messages in i:\pmail\out.
----------- (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
-----------
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.
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:
@ -215,21 +129,12 @@ 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
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.
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.
@ -264,30 +169,11 @@ 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.
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!
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)
----------

Binary file not shown.

View File

@ -3,7 +3,6 @@ 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}
@ -25,33 +24,12 @@ 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;
UserId:=GetEnv('ID');
UserLn:=GetEnv('LN');
nfile:='F:\mail\'+UserId+'\numfile';
mfile:='F:\unixmail\'+UserLn;
odir:='F:\mail\'+UserId;
nfile:='i:\pmail\in\numfile';
mfile:='i:\pmail\in\mailfile.dos';
odir:='i:\pmail\in';
for i:=1 to paramcount do
begin
sl:=paramstr(i);
@ -63,7 +41,6 @@ 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]');
@ -144,8 +121,7 @@ end;
while not eof(mailfile) do
begin
{readln(mailfile,miline); this was the problem, the next is the solution}
miline:=readline(mailfile);
readln(mailfile,miline);
if v then write(mi,':');
prevline:=shortline;
shortline:=false;
@ -195,3 +171,4 @@ end;
writeln(' ');
if v then writeln('Program finished.');
end. {of program}

4
monlan
View File

@ -7,8 +7,6 @@
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
@ -24,7 +22,7 @@ while /bin/true; do
echo "Last error: " > $LLOG
# check for nslookup failures
/usr/bin/nslookup $MACHINE | grep '$PARTOFIP' 2>&1 > /dev/null
/usr/bin/nslookup machineinyourdomain | grep 'partofip.i.e.235' 2>&1 > /dev/null
if [ $? -eq 1 ]; then
ER="Name lookups on our domain failed on $NOW. "
echo "$ER" >> $MLOG

View File

@ -1,5 +1,5 @@
#!/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.

View File

@ -1,38 +1,49 @@
@echo off
rem This batch file gets called when a dos user wants to run pmail from
rem a menu or command line.
rem a menu or command line. It relies on I: mapped to his user dir
rem and a valid pmail.ini that points to the correct gateways for
rem posting to be picked up with ohpostme.
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 pmail messages. Note: The look for new mail option under pmail
rem wont work, exit pmail and restart it to have marsmail run again...
rem Use a unix2dos before using this file...
rem by linking the unix /var/spool/mail to SYS:/unixmail the user
rem can only access his own mailbox. Looks fairly secure...
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 might check the CaSEseNsitivity of ohpostme. pmail gets created from
rem skel...
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
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%
rem login name.
set pmuser=%name%
if not exist f:\mail\%id% mkdir f:\mail\%id% > nul
Echo Please wait -- converting mail from unix to dos format...
unix2dos f:\unixmail\%name% > i:\pmail\in\mailfile.dos
rem read the mail directly from the f:\unixmail\%ln% and let it on the
rem f:\mail\%id%\<files>.cnm for pegasus mail
rem zero.txt is a file zero bytes long but MUST exists!
rem J: points to mapping where applications reside..
rem f:\unixmail is a ln -s /var/spool/mail subdirofmarssysvolume
marsmail.exe
rem if need routes, add it to the line before (g:\pmail\marsmail.exe)
copy j:\dos\net\pmail\zero.txt f:\unixmail\%name% > nul
rem The line above resets the mail file to zero after converting it to
rem pmail format.
j:\dos\net\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 !
i:
cd \pmail\in
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)
rem please correct the path below to point to your pmail executable.
j:\dos\net\pmail\pmail.exe -a