Citadel Internet Email Networking Versin 7H21 Introduction: The utilties described in this archive are designed to simplify the processing of email network packets. The pair of tools described here are designed to work with MSGADD, MSGOUT, and the freeware Amiga mailer YAM. YAM is a TCP/IP POP3/SMTP tool that is freeware. It maintainsn input, and output directories that these tools are compatible with. CIMR is not dependant on the mail tool. Sending Mail Method: Since many people have access to an Internet Service Provider (ISP) and can freely send email, it is logical that we extend that to Citadel Networking. If your familar with Fast Transfers, this method has alot of similarities. First, arrange what rooms are being shared by this method, add the system to your node list and make it an OTHERNET system (Sysop Menu item). Second, agree on a compression method (lha, zip, none, ect.) and make sure that your uuencode/uudecode tools are compatible. I would suggest sending a few test files back and forth. Make sure your have setup the same filenames. YAM will automatically uuencode or Mime encode your mail file for you. Third and last, setup some scripts. Included in the archive is a script that will shutdown Citadel, startup YAM and MIAMI(a TCP/IP stack), and do the mail processing using MSGOUT and MSGADD. It will finish up by restarting Citadel. The example is setup for two systems KRONOS and UNCENSORED, both currently use email networking with The Amiga Zone. It is important that you identify the email, The subject is a good place to use since many mailers will filter out mail with a particular subject. YAM will easily filter based on subject. CIMR will scan the mail directory for the subject( one of its arguments). Sending: To send network packets, you must shutdown Citadel, then run MSGOUT to extract the messages for the system in question. The extracted file is then sent to YAM. An example Rexx script would be: /** Citadel Shutdown **/ say "Shutting down Citadel if needed" OPTIONS RESULTS IF show('P','Citadel_68K') then DO say "...Attempting Citadel shutdown" ADDRESS "Citadel_68K" "exit 1" END say "Done with Citadel shutdown" call delay(100) /** YAM Startup **/ say "YAM Startup if needed" if ~show('P','YAM') then do say "...Attempting to startup YAM" address command 'run yam:yam nocheck' call delay(100) address command 'waitforport YAM' if ~show('P','YAM') then do say "......YAM startup failed!" exit end end /** Create a network packet **/ /** Now, we send a network packets, one to KRONOS, one to UNCENSORED KRONOS needs a UUENCODED ZIP'ed message packet The filename is 'amiga' YAM folder 1 is the outgoing mail. Note: The Write* YAM ARexx commands require the quotes as they are, Otherwise ARexx will not send the command parameters correctly. This is a part of how ARexx works, not a bug in YAM or this script. **/ address command 'failat 100' 'delete amiga.zip amiga' 'msgout "Kronos" amiga' 'zip -q amiga.zip amiga' email = 'cit-amiga@kronos.incentre.net' filename = 'cit:amiga.zip' address 'YAM' setfolder 1 MailWrite WriteMailTo email 'WriteSubject "The Amiga Zone US (609) 953-8159"' WriteAttach filename '"Email_Network_Packet" "UU" "application/octet-stream"' WriteQueue address command 'delete cit:amiga.zip' /** Create a network packet for UNCENSORED This system wanted an uncompressed file, uuencoded. **/ say "Creating the packet for UNCENSORED" address command 'failat 100' 'delete uncensored.zip uncensored' 'msgout "uncensored" uncensored' email = 'cit86net@uncnsrd.mt-kisco.ny.us' filename = 'cit:uncensored' say "Queueing the packet for UNCENSORED" address 'YAM' setfolder 1 MailWrite WriteMailTo email 'WriteSubject "US6099538159"' WriteAttach filename '"Email_Network_Packet" "UU" "application/octet-stream"' WriteQueue address command These commands do not require that Miami (or whatever TCP/IP stack you use ) is online. YAM will queue the mail for later processing when online. If you wished to send the mail now, you could add the following: /** Startup Miami if needed. **/ say "Miami startup if needed" if ~show('P','MIAMI.1') then do say "...Starting up Miami" address command 'run miami:miami' call delay(100) address command 'waitforport MIAMI.1' if ~show('P','MIAMI.1') then do say "......Couldn't run MIAMI, Aborting!" exit end end /** Go online, your Miami defaults will do their work. **/ say "Make sure we are online" address 'MIAMI.1' /* Miami is up and running now...*/ 'HIDE' 'ISONLINE' if rc = 0 then do say "... Not online, attempting to connect" do i=0 to 5 'ONLINE' /* Go online */ 'ISONLINE' /* Did it succeed ? */ if rc = 1 then leave /* exit loop if online */ end 'ISONLINE' if rc = 0 then do say "......Unable to get online, Mail will be processed next time!" end end /** Get Mail, Filter it, Process mail (the filter selects our network packets), Send Mail. **/ Address YAM MailCheck /* Get new mail */ if rc = -1 then say "YAM: connection to mail server has failed, could not get new mail" MailFilter /* Filter, it */ MailSendAll /* Send all queued mail */ if rc = -1 then say "YAM: connection to mail server has failed, could not send new mail" Recieving Mail Method: The processing to recieve mail is more complex than sending. When sending you are doing one system, one time. With recieving, you may get multiple packets from the same system. The following script takes this into account by looping until there are no more mail messages. Also important is to set the "fail" point to beyond 20. The script sets it mine to 30. YAM (as most mailers) keeps your mail in a folder which is a directory. You must identify the proper directory for your archived network packets. If you look at the file YAM:.config, you should be able to figure out what this directory is. CIMR runs with 4 parameter, the mail directory, the subject to scan for, and the filename to deposit the uuencoded file from the mail message and an indicator which is either "remove" or "save". "remove" will delete the mail out of the queue, this is the normal operation. I included a "save" option for two reason. One, is testing, if your testing, use save and the mail packet will reused over and over again. This is good for debugging your scripts since MSGADD will detect the second time as vortex messages and not add them to the Citadel Message Base. The other reason is if your Mail tool keeps track of all mail and only wants you to delete mail from the tool, you will have to manually delete the mail. With YAM, you can use remove so long as you update the folders afterwards(See the example script). CIMR will return an error if any of the parameters are invalid(like the directory name, or if it cannot create the file specified. Note: Parameter 4, the filename can be anyname. Just make sure that you check for the right filename in your scripts. failat 30 delete t:temp ; ; loop until there are no more message packets to process ; LAB LOOP1 cimr yam:archive1/#? "AmigaZone" t:temp remove if ERROR echo "Error processing mail for KRONOS, exiting" else if exists t:temp uudecode t:temp unzip -o -q kronos.zip msgadd "Kronos" Kronos delete t:temp delete Kronos.zip skip LOOP1 back else echo "Finished mail processing from Kronos" endif endif A couple of key points... You might want to save the message packet (see the tool save_file, see below ) for later. The reason is that if there are any problems, you may want to resend, or at least debug the problem and having the old packets helps. I save all packets, both the sent and recieved for several days. CIMR only works with uuencoded files at this point. The last point is that yam:archive1/#? is where I filter my network packets for Kronos. I setup one archive directory for each system I net with. If you have any questions, feel free to contact me via Citadel or email. save_file This is a handly little tool that will move a logfile(or network packet) to a save directory. It takes two arguements, a filename and a directory. It requires that the filename and directory be on the same device. It will move the filename into the directory and append a number to it(.00000, .00001, ect). It will use the next available number.