Errors-To: owner-ecto@athos.rutgers.edu Reply-To: ecto@athos.rutgers.edu Sender: ecto@athos.rutgers.edu From: ecto@athos.rutgers.edu To: ecto-request@athos.rutgers.edu Bcc: ecto-digest-outbound@athos.rutgers.edu Subject: ecto #138 ecto, Number 138 Wednesday, 29 January 1992 Today's Topics: *-----------------* Newsgroup? indy cassettes To be or not to be... mbox_extract ======================================================================== Date: Wed, 29 Jan 92 11:59:55 EST From: clsi!hank@uunet.uu.net (Henry Kilmer) Subject: Newsgroup? Hi all! This is my first posting although I have been following the group for a little bit. I had a thought about the mailing list/newsgroup discussion that has been going on...what if the newsgroup was moderated to keep out the flames etc that has altered gaffa? Just a thought :) I can't wait for the concert in Philly!!! Hank When it dawns on you - what it takes from you - livin on the clouds of pain. There's a storm in you - you don't know what to do - just when you think you're going insane - you're like naked in the rain. -CN ======================================================================== From: drk@leland.stanford.edu Subject: indy cassettes Date: Wed, 29 Jan 92 10:12:05 PST Hi everybody. Clayton Glad (glad@Csli.Stanford.edu) is assembling a "monthly post of music on independantly-produced cassettes" for rec.music.misc. The first one just appeared -- *sans* Happy. Ordering information is accompanied by a short description/review of the music. Could someone (Jessica? Vickie?) send this guy the appropriate information regarding Happy. I'm not qualified -- still waiting for the 1st4 on CD. 8^) David. ======================================================================== From: kyrlidis@athena.mit.edu Subject: To be or not to be... Date: Wed, 29 Jan 92 13:31:15 EST Fuzzy Blue... Hi, This issue came up in several posts recently. I like ecto the way it is now. I wouldn't want it to change. Ecto can be many things: a) A great source for Happy news and information and discussion (which is why it was created in the first place). b) A great source for new music information. I have made several purchases based on ecto-recommendations and haven't regretted a single one. c) A fuzzy blue wonderland. Where we can compile birthday lists, run silly polls, ask silly questions we wouldn't ask anywhere else in fear of getting flambe'-ed, and feel comfortable. I don't think I'll run another snow-poll since some people find it annoying, but if ecto changes and degenerates to a gaffa, I will feel very sorry. Angelos +=====================================+ |'My ears have parasites'-hApPy RhOdEs| +=====================================+ ======================================================================== Date: Wed, 29 Jan 92 13:40:26 -0500 From: sae@cmpsci.suffolk.edu (Sam Alan Ezust) Subject: mbox_extract Hi folks. Some of you may already have this program, but I thought I'd post it anyway, for the benefit of those who missed it back in 1990. This program will work on unix type mbox files, and it extracts messages from it and places them into unix mbox files of whatever name you wish, depending on what strings are found in the message header. It's useful if you want all your ecto messages to be in one file, to go through at your leasure while you are reading the messages which are specifically to you immediately. The below document contains the sourcecode which I am using now. It has worked fine without modifications since January 1990. I am sitll using it today, but please be aware that the reference to "I've been using it for 11 months" should really be "I've ben using it for 3 years". mbox_extract version 3.0 16 January 1990 By S. Alan Ezust sae@cmpsci.suffolk.edu This program is public domain, and may be distributed freely. No guarantees come with this program, and if any data is lost as a result of its use, I can not be held responsible. However, I have been using it for about 11 months and have never lost any data as a result of its use, and to my knowledge, there are NO bugs in this program. If you make changes to this program, please write in the sourcecode comments explaining what they are, and if you distribute a modified version, I'd appreciate you sending it along to me as well. ---------------------------------------------------------------------------- How the program works: mbox_extract {infile outfile1} This program takes as input two filenames. The first is read in as a unix-format mbox file, and the other file is opened for output. If this file already exists, it will be opened for APPENDING. When the program is finished, infile will remain UNCHANGED. mbox_extract also uses an auxillary file called me3.dat, which must be in the current working directory. This file must be a standard text file where each line contains a 'search string', followed by a colon (:), immediately followed by a unix filename which corresponds to that string. the program works as follows: It searches the headers of each piece of mail for occurrences of one of the search strings. If the header of a piece of mail contains one of these search strings, that entire piece of mail is appended to the file with that corresponding filename. If no line in the header contains one of these strings, the piece of mail is appended to . How to use it: I have the following lines in my .login file: --------------- | rm .temp | mv /usr/spool/mail/depeche .temp | mbox_extract .temp /usr/spool/mail/depeche --------------- My system mailbox is /usr/spool/mail/depeche, and I wish to take all bulk-mailed pieces of mail and place them into mbox_l. My me2.dat file looks like this: --------------- 4AD-L@:4ad_l cure@euclid.enet.dec.com:mbox_l nm-list-sender:mbox_l other-voices@:mbox_l --------------- This way, any nm-list or other-voices messages get appended to my mbox_l file, and any message from the 4ad-list gets appended to a different file called 4ad_l. Any other piece of mail gets written to /usr/spool/mail/depeche, which is my system mailbox. .temp will have the old contents of my spool file, which I can look at in case I am wondering how the original file looked before the extraction was done. If a particular message header contains more than one string from me3.dat, the message gets appended to only one of the output files - usually the one corresponding to the first search string found. It will not be sent to TWO different files, ever. ------------------------------------------------------------------------ Caution: In general, the "system mailbox" can be changed by the system at any instant in time. Pieces of mail get placed into them at unpredictable times. I was told by some unix-gurus that to move and create new system mailbox files CAN be dangerous if, by a coincidence, a new piece of mail arrives while this program is running. If this happens, two processes are appending to it at the same time, and data can be corrupted. The running time of this program on a spool file is never much more than a fraction of a second on this sun/4. I am willing to take the risk of such an event happening on MY spool file, but it has NEVER happened in the 11 months I have used it. I just wanted you to realize that there is that miniscule chance each time you run it in the way I have suggested, so that if something weird happens to your spool file, this is probably the reason. I could put an flock() on the output files, but this is not a standard unix call, and is only supported by recent versions of BSD. This I believe should solve this problem, but I haven't had time to test the program with this added feature. questions? bug reports? suggestions? send mail to me! ----------------------------cut here----------------------------- #define VERSION 3.01 #define DATE "91/1/18" /* me3.c - mbox_extract by S. Alan Ezust */ #include #include #include #include #include #define MAXDAT 10 #define MAXHEAD 40 #define LINELEN 200 char match[MAXDAT][LINELEN]; int last, total, extracted[MAXDAT], newcount, numfiles; /* This program requires a me3.dat file of the following format: string:filename where the strings should be unique but the filenames need not be. The first argument to this program is the input file, which is a mbox-format file. The program scans through the header of each message in the input file for occurrances of any of the strings in me3.dat. If a string is found in a message, that message is appended to the file with the corresponding filename specified in me3.dat. Recommended usage - if you want all your bulk-mailed mail to be put into smbox, and everything else left in your spool file, you would put this in your .login file: mv /usr/spool/mail/depeche temp mbox_extract temp /usr/spool/mail/depeche and place distinctive strings indicating a message is bulk-mailed into ~/me3.dat. here is an example of my me3.dat file: 4AD-L@:4ad_l cure@euclid.enet.dec.com:ov_l nm-list-sender:nm_l other-voices@:ov_l cloud-zero@:lpd_l */ FILE *datfile, *ifile, *ofile[MAXDAT]; char ofname[MAXDAT][50]; int findex[MAXDAT]; void strtoupper(S) char *S; { while (*S) { if (islower (*S)) *S -= 32; S++; } int strpos(s,c) char *s; int c; { int i=0; while (*s) { if (*s==c) return(i); i++; s++; } return(-1); } void openfiles(argc,argv) char **argv; int argc; { int i,j,l; char inpline[LINELEN]; char tfname[MAXDAT][LINELEN]; if (argc != 3) { printf ("Error : Incorrect number of arguments.\n"); exit(0); } if ((ifile=fopen(argv[1],"r")) == NULL) { printf ("Error : Can't open inputfile: %s\n",argv[1]); exit(0); } if ((datfile=fopen("me3.dat", "r")) == NULL) { printf ("Error : can't open file me3.dat\n"); exit(0); } i=0; while ((fgets(inpline,LINELEN,datfile))!=NULL) { l = strpos (inpline, ':'); if (l == -1) { printf ("Error: No ':' in datafile line :"); puts(inpline); exit(0); } strcpy(tfname[i],(unsigned)(inpline+l+1)); strncpy (match[i],inpline, l); strtoupper(match[i]); i++; if (i > MAXDAT) { printf ("Error: too many lines in me3.dat. Max=%d\n",MAXDAT); exit(0); } } last=i; for (i=0 ; i< last ; i++) { l = strlen(tfname[i]); tfname[i][l-1]='\0'; /* printf ("match: %s\n",match[i]); printf ("fname: %s\n",tfname[i]); */ } fclose(datfile); numfiles=findex[0]=1; strcpy(ofname[0],argv[2]); strcpy(ofname[1],tfname[0]); for (i=1; i< last; i++) { findex[i]=-1; for (j=0; j=MAXHEAD) done=2; } /* end of else */ /* are we out of memory? */ } /* end of while */ /* Done indications 1 means that the entire message has been read (this shouldn't happen here) 2 means that we have finished reading header lines 3 means we have reached the end of file (this also shouldn't happen) */ extracted[filenum]++; for (j=0; j