From majordomo-workers-owner Mon Apr 3 02:50:26 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id CAA20093 for majordomo-workers-outgoing; Mon, 3 Apr 1995 02:36:32 -0700 Received: from graphy.physics.orst.edu (graphy.PHYSICS.ORST.EDU [128.193.96.80]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id CAA20088 for ; Mon, 3 Apr 1995 02:36:28 -0700 Received: by graphy.physics.orst.edu (AIX 3.2/UCB 5.64/4.03) id AA24178; Mon, 3 Apr 1995 02:32:11 -0700 From: dchin@graphy.physics.orst.edu (David Chin) Message-Id: <9504030932.AA24178@graphy.physics.orst.edu> To: majordomo-workers@greatcircle.com Subject: Possible bug in 1.93 Date: Mon, 03 Apr 95 02:32:11 -0800 Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk I have encountered what seem to be a couple of small errors in version 1.93. The bugs were in request-answer and sample.cf. I am running on AIX 3.2.2, with Perl 5.001. The mailer I am using is Sendmail AIX 3.2/UCB 5.64/4.03 I made some changes to get it to work, and the diffs are below: -------- Begin file request-answer.diffs 31a32 > require "shlock.pl"; 40c41 < sub do_exec_sendmail { --- > sub local'do_exec_sendmail { 45c46 < open(MAIL, "|-") || &do_exec_sendmail(); --- > open(MAIL, "|-") || &local'do_exec_sendmail(); 66c67,68 < the subject line) of an email message to "$whoami": --- > the subject line) of an email message to > "$whoami": 82c84,85 < the subject line) of an email message to "$whoami": --- > the subject line) of an email message to > "$whoami": -------- End file request-answer.diffs -------- Begin file sample.cf.diffs 5c5 < $whoami = "Majordomo@$whereami"; --- > $whoami = "Majordomo\@$whereami"; 8c8 < $whoami_owner = "Majordomo-Owner@$whereami"; --- > $whoami_owner = "Majordomo-Owner\@$whereami"; -------- End file sample.cf.diffs If these are not your errors, but rather errors in my setup, please ignore this message, and inform me if you will. Majordomo is a great piece of software. I'm looking forward to the 2.0 version. Thanks! -- David Chin Cornell University '92 Oregon State University '?? _________________________________________________________________________ Internet: | dchin@graphy.physics.orst.edu | Phone: (503) 752-3632 _________________________________| Add: 101 NW 23rd St., | Corvallis, "In short, in matters vegetable, | OR 97330 animal, and mineral ..." | _________________________________|_______________________________________ From majordomo-workers-owner Mon Apr 3 10:51:05 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id KAA26238 for majordomo-workers-outgoing; Mon, 3 Apr 1995 10:22:44 -0700 Received: from malt.wharton.upenn.edu (MALT.WHARTON.UPENN.EDU [130.91.160.180]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with ESMTP id KAA26233 for ; Mon, 3 Apr 1995 10:22:41 -0700 Received: (from loren@localhost) by malt.wharton.upenn.edu (8.6.10/8.6.9) id NAA14052 for majordomo-workers@greatcircle.com; Mon, 3 Apr 1995 13:18:33 -0400 From: Loren Miller Message-Id: <199504031718.NAA14052@malt.wharton.upenn.edu> Subject: approve and From lines To: majordomo-workers@greatcircle.com (majordomo workers) Date: Mon, 3 Apr 1995 13:18:33 -0400 (EDT) Reply-To: loren@hops.wharton.upenn.edu X-Eyes: corrected X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 803 Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk Currently when I use the approve script to approve bounced messages the From: and Sender: lines of the message get changed to the owner of the list instead of the sender of the message. Sometimes this happens only in the digested version of the list, sometimes it happens in both the digest and the direct version. I use majordomo 1.92 with the approve and digest scripts. I looked in approve and noticed a $from_skipped definition that looks as if I could fix this behavior by changing the value from 1 to 0. Is this right or should I be hacking digest instead to fix this behavior? -- +++++++++++++++++++++++23 Loren Miller "I don't have to practice what I preach 'cause I'm not the kind of person I'm preaching to!" The Book of The Subgenius From majordomo-workers-owner Wed Apr 5 10:21:25 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id JAA02791 for majordomo-workers-outgoing; Wed, 5 Apr 1995 09:53:53 -0700 Received: from pharmacy.isu.edu (pharmacy.isu.edu [134.50.8.6]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id JAA02786 for ; Wed, 5 Apr 1995 09:53:49 -0700 Received: by pharmacy.isu.edu (AIX 3.2/UCB 5.64/4.03) id AA19730; Wed, 5 Apr 1995 10:54:04 -0600 From: joerg@pharmacy.isu.edu (Joerg Senekowitsch) Message-Id: <9504051654.AA19730@pharmacy.isu.edu> Subject: Bug in resend? To: majordomo-workers@greatcircle.com Date: Wed, 5 Apr 1995 10:54:04 +22294909 (MDT) X-Mailer: ELM [version 2.4 PL21] Content-Type: text Content-Length: 1972 Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk Hi there, let me start by saying that I very much would like to get Majordomo up and running on our system (we have used Smartlist before). During the setup I have run into numerous problems, which can be attributed to: 1) me being brain-dead 2) docs somewhat muddled 3) idiosyncracies of our AIX box Anyway, I finally decided to look into the code to get a better understanding of what is going on and one of the first things I ran across was the following logical construct in "resend": Resend looks for a config file (-C other.cf) switch on the command line. If present, it eval's this file. The default for the file is the majordomo.cf, so presumably, the commands in the other.cf file are the same (maybe with different values) as the ones in majordomo.cf. Unfortunately, a couple of lines further down resend "requires" "config_parse.pl", which in turn requires majordomo.cf. That overwrites any changes from other.cf :-( One of the problems I am struggling with is how to "approve" submissions from a PC/Mac running Eudora or Pegasus mail. The BOUNCE message (why the heck is it BOUNCE and not APPROVE?) requesting approval needs heavy massaging before I can send it back to majordomo, and so far I always lose the "Subject:". It would be nice if the approved message could be sent back simply via "REPLY" with the "Approved: " line up front (not in the header) and that resend (or whatever munges this message) could restore the original message without the quoting characters added by the PC/Mac mailer (some use ">", some other constructs). Should be straightforward too since all of the original message should have the same quoting EXCEPT the first line with the "Approved:" stamp. Anyway, if this capability exists, would someone please point me into the right direction. If someone's working on these issues, great, if not, I'd be willing to take that on. Joerg Senekowitsch System Administration ISU College of Pharmacy From majordomo-workers-owner Wed Apr 5 12:21:19 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id MAA07361 for majordomo-workers-outgoing; Wed, 5 Apr 1995 12:04:17 -0700 Received: from mycroft.GreatCircle.COM (mycroft.greatcircle.com [198.102.244.35]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with ESMTP id MAA07356 for ; Wed, 5 Apr 1995 12:04:15 -0700 Received: from sgi.sgi.com by mycroft.GreatCircle.COM (8.6.10/SMI-4.1/Brent-950108) id MAA23236; Wed, 5 Apr 1995 12:04:07 -0700 Received: from lunch.engr.sgi.com by sgi.sgi.com via ESMTP (950221.405.SGI.8.6.10/910110.SGI) id MAA04121; Wed, 5 Apr 1995 12:02:36 -0700 Received: by lunch.engr.sgi.com (940816.SGI.8.6.9/911001.SGI) id MAA11931; Wed, 5 Apr 1995 12:02:27 -0700 From: pdc@lunch.engr.sgi.com (Paul Close) Message-Id: <199504051902.MAA11931@lunch.engr.sgi.com> Subject: Re: Bug in resend? To: joerg@pharmacy.isu.edu (Joerg Senekowitsch) Date: Wed, 5 Apr 1995 12:02:24 -0700 (PDT) Cc: majordomo-workers@greatcircle.com In-Reply-To: <9504051654.AA19730@pharmacy.isu.edu> from "Joerg Senekowitsch" at Apr 5, 95 10:54:04 am X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Content-Length: 4553 Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk > During the setup I have run into numerous problems, which can be > attributed to: > > 1) me being brain-dead > 2) docs somewhat muddled > 3) idiosyncracies of our AIX box [...] > Resend looks for a config file (-C other.cf) switch on the command line. > If present, it eval's this file. The default for the file is the > majordomo.cf, so presumably, the commands in the other.cf file are > the same (maybe with different values) as the ones in majordomo.cf. > Unfortunately, a couple of lines further down resend "requires" > "config_parse.pl", which in turn requires majordomo.cf. > That overwrites any changes from other.cf :-( Bzzt. Error is type 1: user being brain-dead :-) (or error 2: doc failure!) The config file in -C is a list specific config file, which is TOTALLY different from majordomo.cf (which is global to majordomo). To automatically generate a list config file, do: cd $listdir (i.e. whatever you defined listdir as in majordomo.cf) touch list (i.e. whatever you want the list name to be) Mail majordomo lists ^D Majordomo commands (like lists) automatically generate config files for any list (defined as a file in $listdir with no '.' in its name). Check out the config file, it's got lots of comments.... > One of the problems I am struggling with is how to "approve" submissions > from a PC/Mac running Eudora or Pegasus mail. The BOUNCE message requesting > approval needs heavy massaging before I can send it back to majordomo, and > so far I always lose the "Subject:". It would be nice if the approved > message could be sent back simply via "REPLY" with the "Approved: " > line up front (not in the header) and that resend (or whatever munges this > message) could restore the original message without the quoting characters > added by the PC/Mac mailer (some use ">", some other constructs). Should > be straightforward too since all of the original message should have the same > quoting EXCEPT the first line with the "Approved:" stamp. I'm not sure what you mean. If you really mean you have a submission that resend sent to you for approval, and you want to send it on to the list, all you need to do is send it to the list with "Approved: passwd" in the headers (or as the first line in the message preceding the original headers. The "approve" program does all this for you, though, which is what I always use. I do have the liberty of piping messages to approve, which you may not in mac/pc land. Still, just save the message, and feed it to "approve". The problem with reply is it doesn't include the original headers, which you want to preserve in an approve situation. You can modify approve to remove any quoting characters, although your mail program really shouldn't be munging your mail! Since approve is just a helper program, and not part of majordomo per se, there's no problem hacking it to death. Go for it! > (why the heck is it BOUNCE and not APPROVE?) Good question. Especially when mailer-daemons return undeliverable mail, that is usually called a bounce too. It gets darn confusing! Basically, though, anything that comes back from resend is a BOUNCE, and anything issued from majordomo is an APPROVE. I don't pretend to like it, but I understand it at least. Note I had to patch approve in the following way to get it to work: *** junk Wed Apr 5 11:57:27 1995 --- /usr/people/pdc/bin/approve Mon Oct 31 13:12:00 1994 *************** *** 135,141 **** if ((/^\tsubscribe\s/) || (/^\tunsubscribe\s/)) { if (!defined($reply_to)) { warn("No \"Reply-To:\"; exiting"); ! exit(1);; } s/^\t//; split; --- 135,141 ---- if ((/^\tsubscribe\s/) || (/^\tunsubscribe\s/)) { if (!defined($reply_to)) { warn("No \"Reply-To:\"; exiting"); ! exit(1); } s/^\t//; split; *************** *** 184,192 **** } } ! warn "Can't find password for list $list, Stopped" , return ! if !defined($passwd{$list}); if (defined($opt_d)) { open(MAIL, ">&STDOUT"); --- 184,195 ---- } } + $list =~ s/@.*//; ! if (!defined($passwd{$list})) { ! warn "Can't find password for list $list, Stopped"; ! return; ! } if (defined($opt_d)) { open(MAIL, ">&STDOUT"); *************** *** 207,212 **** --- 210,216 ---- print MAIL $_; } close(MAIL); + print STDERR "Mailed approved message to $list list.\n"; } sub read_config { -- Paul Close pdc@sgi.com http://reality.sgi.com/employees/pdc/ No fate but what we make From majordomo-workers-owner Wed Apr 5 13:22:12 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id NAA09052 for majordomo-workers-outgoing; Wed, 5 Apr 1995 13:15:49 -0700 Received: from hp.com (hp.com [15.255.152.4]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with ESMTP id NAA09047 for ; Wed, 5 Apr 1995 13:15:47 -0700 Received: from hpcc123.corp.hp.com (okamoto.corp.hp.com) by hp.com with ESMTP (1.37.109.15/15.5+ECS 3.3) id AA258912961; Wed, 5 Apr 1995 13:16:02 -0700 Received: by hpcc123.corp.hp.com (1.37.109.11/15.5+ECS 3.3) id AA075722961; Wed, 5 Apr 1995 13:16:01 -0700 Date: Wed, 5 Apr 1995 13:16:01 -0700 From: Jeff Okamoto Message-Id: <199504052016.AA075722961@hpcc123.corp.hp.com> To: majordomo-workers@GreatCircle.COM Subject: More on the problem with the lock file Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk Oh, and I also have to kill off the boatloads of sendmail processes that are all waiting on the lock, and are thus not immediately killable. Jeff From majordomo-workers-owner Wed Apr 5 13:24:58 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id NAA09020 for majordomo-workers-outgoing; Wed, 5 Apr 1995 13:14:27 -0700 Received: from relay.hp.com (relay.hp.com [15.255.152.2]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with ESMTP id NAA09015 for ; Wed, 5 Apr 1995 13:14:23 -0700 Received: from hpcc123.corp.hp.com (okamoto.corp.hp.com) by relay.hp.com with ESMTP (1.37.109.15/15.5+ECS 3.3) id AA008432876; Wed, 5 Apr 1995 13:14:37 -0700 Received: by hpcc123.corp.hp.com (1.37.109.11/15.5+ECS 3.3) id AA075642876; Wed, 5 Apr 1995 13:14:36 -0700 Date: Wed, 5 Apr 1995 13:14:36 -0700 From: Jeff Okamoto Message-Id: <199504052014.AA075642876@hpcc123.corp.hp.com> To: majordomo-workers@GreatCircle.COM Subject: Problems with lock file Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk This problem is really starting to piss me off. I'm getting a number of requests from AOL, and their mailer queues stuff up and sends them to me in a big batch. The number of ABORT's I get seems to be exponential of the number of requests that come in simultaneously (two is bad, three is awful, four totally overwhelms me). The kicker is that the entry is added to the list file. However, I still keep getting abort messages, even after they've been added. My only recourse is to stop sendmail and delete all the various instances in the queue. This is undesirable. Jeff From majordomo-workers-owner Wed Apr 5 15:51:07 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id PAA14504 for majordomo-workers-outgoing; Wed, 5 Apr 1995 15:47:08 -0700 Received: from cs.umb.edu (cs.umb.edu [158.121.104.2]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id PAA14498 for ; Wed, 5 Apr 1995 15:46:55 -0700 Received: from se.cs.umb.edu by cs.umb.edu with SMTP id AA02262 (5.65c/IDA-1.4.4 for ); Wed, 5 Apr 1995 18:47:01 -0400 Message-Id: <199504052247.AA02262@cs.umb.edu> To: joerg@pharmacy.isu.edu (Joerg Senekowitsch) Cc: majordomo-workers@greatcircle.com Subject: Re: Bug in resend? In-Reply-To: Your message of "Wed, 05 Apr 1995 10:54:04." <9504051654.AA19730@pharmacy.isu.edu> Date: Wed, 05 Apr 1995 18:47:01 -0400 From: "John P. Rouillard" Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk In message <9504051654.AA19730@pharmacy.isu.edu>, Joerg Senekowitsch writes: >Resend looks for a config file (-C other.cf) switch on the command line. >If present, it eval's this file. The default for the file is the >majordomo.cf, so presumably, the commands in the other.cf file are >the same (maybe with different values) as the ones in majordomo.cf. >Unfortunately, a couple of lines further down resend "requires" >"config_parse.pl", which in turn requires majordomo.cf. >That overwrites any changes from other.cf :-( Yup. That's a known bug. It should be in the FAQ. It will be fixed in the next release (no don't ask when). >One of the problems I am struggling with is how to "approve" submissions >from a PC/Mac running Eudora or Pegasus mail. The BOUNCE message (why >the heck is it BOUNCE and not APPROVE?) requesting >approval needs heavy massaging before I can send it back to majordomo, and >so far I always lose the "Subject:". It would be nice if the approved >message could be sent back simply via "REPLY" with the "Approved: " >line up front (not in the header) and that resend (or whatever munges this >message) could restore the original message without the quoting characters >added by the PC/Mac mailer (some use ">", some other constructs). Should >be straightforward too since all of the original message should have the same >quoting EXCEPT the first line with the "Approved:" stamp. Actually, its not all that easy in the general case. I had a version that tried to do this autorecogition, but it blew up over 25% of the time in trials primarily due to differences in line wrapping/breaking by the pc mailers, and their gateways. It was also adding a lot of hair to the code to try to do this. Arguably it could be added as an option "try_unmangling_approved_message_but_probably_trash_it" if set to true would turn the option on, but I wouldn't try it. Does forwarding a message do the same formatting junk to the message? That might be a workaround. -- John John Rouillard Senior Systems Administrator IDD Information Services rouilj@dstar.iddis.com Waltham, MA (617) 890-7227 x337 (617) 487-3937 (Direct) Senior Systems Consultant (SERL Project) University of Massachusetts at Boston rouilj@cs.umb.edu (preferred) Boston, MA, (617) 287-6480 =============================================================================== My employers don't acknowledge my existence much less my opinions. From majordomo-workers-owner Fri Apr 7 10:07:39 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id JAA13264 for majordomo-workers-outgoing; Fri, 7 Apr 1995 09:30:13 -0700 Received: from cs.umb.edu (cs.umb.edu [158.121.104.2]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id JAA13259 for ; Fri, 7 Apr 1995 09:30:04 -0700 Received: from se.cs.umb.edu by cs.umb.edu with SMTP id AA04797 (5.65c/IDA-1.4.4 for ); Fri, 7 Apr 1995 12:29:54 -0400 Message-Id: <199504071629.AA04797@cs.umb.edu> To: loren@hops.wharton.upenn.edu Cc: majordomo-workers@greatcircle.com Subject: Re: approve and From lines In-Reply-To: Your message of "Mon, 03 Apr 1995 13:18:33 EDT." <199504031718.NAA14052@malt.wharton.upenn.edu> Date: Fri, 07 Apr 1995 12:29:53 -0400 From: "John P. Rouillard" Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk In message <199504031718.NAA14052@malt.wharton.upenn.edu>, Loren Miller writes: >Currently when I use the approve script to approve bounced messages >the From: and Sender: lines of the message get changed to the owner of >the list instead of the sender of the message. Sometimes this happens >only in the digested version of the list, sometimes it happens in both >the digest and the direct version. I use majordomo 1.92 with the >approve and digest scripts. I looked in approve and noticed a >$from_skipped definition that looks as if I could fix this behavior by >changing the value from 1 to 0. Is this right or should I be hacking >digest instead to fix this behavior? I'm having a trough time picturing your bug. Do you have an example to share? Offhand it sounds like the majordomo user is not trusted by sendmail, but I am not really sure what the problem is. -- John John Rouillard Senior Systems Administrator IDD Information Services rouilj@dstar.iddis.com Waltham, MA (617) 890-7227 x337 (617) 487-3937 (Direct) Senior Systems Consultant (SERL Project) University of Massachusetts at Boston rouilj@cs.umb.edu (preferred) Boston, MA, (617) 287-6480 =============================================================================== My employers don't acknowledge my existence much less my opinions. From majordomo-workers-owner Fri Apr 7 10:10:18 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id JAA13632 for majordomo-workers-outgoing; Fri, 7 Apr 1995 09:55:51 -0700 Received: from cs.umb.edu (cs.umb.edu [158.121.104.2]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id JAA13623 for ; Fri, 7 Apr 1995 09:55:40 -0700 Received: from se.cs.umb.edu by cs.umb.edu with SMTP id AA06113 (5.65c/IDA-1.4.4 for ); Fri, 7 Apr 1995 12:54:16 -0400 Message-Id: <199504071654.AA06113@cs.umb.edu> To: Jeff Okamoto Cc: majordomo-workers@greatcircle.com Subject: Re: Problems with lock file In-Reply-To: Your message of "Wed, 05 Apr 1995 13:14:36 PDT." <199504052014.AA075642876@hpcc123.corp.hp.com> Date: Fri, 07 Apr 1995 12:54:16 -0400 From: "John P. Rouillard" Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk In message <199504052014.AA075642876@hpcc123.corp.hp.com>, Jeff Okamoto writes: >This problem is really starting to piss me off. > >I'm getting a number of requests from AOL, and their mailer queues stuff up >and sends them to me in a big batch. The number of ABORT's I get seems >to be exponential of the number of requests that come in simultaneously >(two is bad, three is awful, four totally overwhelms me). > >The kicker is that the entry is added to the list file. However, I still >keep getting abort messages, even after they've been added. > >My only recourse is to stop sendmail and delete all the various instances >in the queue. This is undesirable. Until a shlock.pl replacement is ready, I am afraid you may have to grin and bear it. One thing that may help is to try the following hack: At the beginning of majordomo, have it try to lock one of n files. If it doesn't get a lock immediatly on one of the files, it exists with error 75 (EX_TEMPFAIL) This should force sendmail to keep the job in the queue and retry later. This is the mechanism I am using to limit the number of simultaneous majordomo's and resends that can run at a time. Something like the code below after including shlock.pl in majordomo.pl should do the trick. foreach $i (1..10) { last if shlock("/tmp/locks/$i"); } $LOCKFILE="/tmp/locks/$i"; exit (75) if ! stat $LOCKFILE; It would be nice if majordomo cleaned up the lockfile just before it exited, but its not required since shlock.pl will acquire the lock if the process no longer exists. -- John John Rouillard Senior Systems Administrator IDD Information Services rouilj@dstar.iddis.com Waltham, MA (617) 890-7227 x337 (617) 487-3937 (Direct) Senior Systems Consultant (SERL Project) University of Massachusetts at Boston rouilj@cs.umb.edu (preferred) Boston, MA, (617) 287-6480 =============================================================================== My employers don't acknowledge my existence much less my opinions. From majordomo-workers-owner Fri Apr 7 10:27:44 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id KAA14058 for majordomo-workers-outgoing; Fri, 7 Apr 1995 10:21:57 -0700 Received: from cs.umb.edu (cs.umb.edu [158.121.104.2]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id KAA14053 for ; Fri, 7 Apr 1995 10:21:52 -0700 Received: from se.cs.umb.edu by cs.umb.edu with SMTP id AA07716 (5.65c/IDA-1.4.4 for ); Fri, 7 Apr 1995 13:22:04 -0400 Message-Id: <199504071722.AA07716@cs.umb.edu> To: "Elena Fraboschi" Cc: majordomo-workers@greatcircle.com Subject: Re: 3 problems: (1) majordomo erasing lists, (2) echo help, (3) medit In-Reply-To: Your message of "Fri, 07 Apr 1995 10:48:20 EDT." <199504071441.HAA10825@miles.greatcircle.com> Date: Fri, 07 Apr 1995 13:22:05 -0400 From: "John P. Rouillard" Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk In message <199504071441.HAA10825@miles.greatcircle.com>, "Elena Fraboschi" writes: >(1) I installed the mailing lists in /u5/mail/lists. The lists > are owned by majordom.majordom, 664 as recommended. Then > people began to subscribe and unsubscribe, and already > three times I have been confronted with the nightmarish > situation in which a list that had 859 subscribers, say, > gets overwritten with another list, same name of course, > totalling 0 bytes. In other words, the list gets erased. > (The three times have been three different lists.) > I have back-up copies, but surely that's not the answer. > Does anyone have a guess as to what is going on here? > > I know that when subscribers subscribe or unsubscribe, > a L. is created, as well as a .new. > The problem then would take place when the lock file > is removed and .new becomes . Help! 1) Make sure you have lots of space on the disk where majordomo will be doing its list manipulation. It isn't extremely robust in checking for errors in writing to disk. 2) Try this hack. Find the following code fragment from do_unsubscribe in the majordomo file. # we deleted exactly 1 name, so now we shuffle the files link("$listdir/$clean_list", "$listdir/$clean_list.old") || &abort("link(\"$listdir/$clean_list\", \"$listdir/$clean_list.old\"): $!"); unlink("$listdir/$clean_list"); link("$listdir/$clean_list.new", "$listdir/$clean_list") || &abort("link(\"$listdir/$clean_list.new\", \"$listdir/$clean_list\"): $!"); unlink("$listdir/$clean_list.old"); print REPLY "Succeeded.\n"; and prepend something like: # check to see if the size changed too much. $size_change = (-s "$listdir/$clean_list") - (-s "$listdir/$clean_list.new"); if ($size_change > 256 ) { #unlink("$listdir/$clean_list.new"); &abort("size change $listdir_$clean_list"); } This will leave the new version of the clean list around so you can look at it to try to debug problems. It should recover more gracefully, but this will stop the loassage problem in any case. Also it should keep enough info around to diagnose a possible cause I hope. You can uncomment the unlink if you want majordomo to try to recover somewhat from the problem. -- John John Rouillard Senior Systems Administrator IDD Information Services rouilj@dstar.iddis.com Waltham, MA (617) 890-7227 x337 (617) 487-3937 (Direct) Senior Systems Consultant (SERL Project) University of Massachusetts at Boston rouilj@cs.umb.edu (preferred) Boston, MA, (617) 287-6480 =============================================================================== My employers don't acknowledge my existence much less my opinions. From majordomo-workers-owner Fri Apr 7 11:44:20 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id KAA14792 for majordomo-workers-outgoing; Fri, 7 Apr 1995 10:54:29 -0700 Received: from cash.wharton.upenn.edu (CASH.WHARTON.UPENN.EDU [130.91.160.43]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with ESMTP id KAA14787 for ; Fri, 7 Apr 1995 10:54:25 -0700 Received: from marketing.wharton.upenn.edu (MARKETING.WHARTON.UPENN.EDU [130.91.160.146]) by cash.wharton.upenn.edu (8.6.9/8.6.9) with SMTP id NAA24342; Fri, 7 Apr 1995 13:54:34 -0400 Received: from WH-MKTG/MAILQUEUE by marketing.wharton.upenn.edu (Mercury 1.13); Fri, 7 Apr 95 13:54:38 EST Received: from MAILQUEUE by WH-MKTG (Mercury 1.13); Fri, 7 Apr 95 13:54:24 EST From: "Loren Miller" Organization: Wharton Marketing Department To: "John P. Rouillard" Date: Fri, 7 Apr 1995 13:54:20 EST Subject: Re: approve and From lines Reply-to: loren@marketing.wharton.upenn.edu CC: majordomo-workers@GreatCircle.COM Priority: normal X-mailer: Pegasus Mail/Windows (v1.22) Message-ID: <35C86E068A7@marketing.wharton.upenn.edu> Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk John Rouillard writes: >I'm having a rough time picturing your bug. Do you have an example >to share? Offhand it sounds like the majordomo user is not trusted >by sendmail, but I am not really sure what the problem is. I'm running a list, call it listname, in both a direct version and a digested version, called respectively listname and listname-digest. The majordomo user is major:major, which is in the trusted list for sendmail. The owner of the list is loren:users, which is not in the trusted list for sendmail. Email sent to the list that bounces for some reason is sent to loren to be approved. Assuming the message should go to the list, as loren I pipe the message to approve. Current behavior seems to be thus: the message goes to the direct version of the mailing list with the original, correct From line. So far so good. But the mailing list also has a digested version, and when the file gets written into the Digests/listname-digest directory the original From line is prepended with a ">" character and another >From line with value owner-listname is inserted above it in the headers. When this file is processed by digest it discards the original From line and keeps the new, wrong one, thereby losing the original sender information in the digest version of the mailing list. Here is the corresponding section of /etc/aliases. * * * listname: "|/usr/local/majordomo/bin/wrapper resend -l listname -h host.wharton.upenn.edu listname-outgoing" listname-digest: listname listname-owner: majordomo-owner owner-listname: listname-owner listname-approval: loren listname-digest-owner: listname-owner owner-listname-digest: listname-digest-owner listname-outgoing: :include:/usr/local/mail/Lists/listname, listname-digestify listname-digestify: "|/usr/local/majordomo/bin/wrapper digest -r -C -l listname-digest listname-digest-outgoing" listname-digest-outgoing: :include:/usr/local/mail/Lists/listname-digest listname-request: "|/usr/local/majordomo/bin/wrapper request-answer listname" listname-digest-request: "|/usr/local/majordomo/bin/wrapper request-answer listname-digest" listname-digest-approval: loren * * * I inherited this from a previous version of majordomo so there may be some incorrect flags in the digestify line. If something of that sort leaps to attention don't hesitate to notify me. Otherwise, I think there's a problem in digest or resend or ... I don't know where else it might be. Which file do you think I should be hacking to fix this behavior? -- +++++++++++++++++++++++23 Loren Miller LOREN@marketing.wharton.upenn.edu Life at the water's edge is the real life for men and women From majordomo-workers-owner Fri Apr 7 11:58:16 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id LAA16420 for majordomo-workers-outgoing; Fri, 7 Apr 1995 11:28:23 -0700 Received: from cs.umb.edu (cs.umb.edu [158.121.104.2]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id LAA16415 for ; Fri, 7 Apr 1995 11:28:15 -0700 Received: from se.cs.umb.edu by cs.umb.edu with SMTP id AA11249 (5.65c/IDA-1.4.4 for ); Fri, 7 Apr 1995 14:28:22 -0400 Message-Id: <199504071828.AA11249@cs.umb.edu> To: loren@marketing.wharton.upenn.edu Cc: majordomo-workers@greatcircle.com Subject: Re: approve and From lines In-Reply-To: Your message of "Fri, 07 Apr 1995 13:54:20 EST." <35C86E068A7@marketing.wharton.upenn.edu> Date: Fri, 07 Apr 1995 14:28:22 -0400 From: "John P. Rouillard" Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk In message <35C86E068A7@marketing.wharton.upenn.edu>, "Loren Miller" writes: >The majordomo user is major:major, which is in the trusted list for >sendmail. The owner of the list is loren:users, which is not in the >trusted list for sendmail. Email sent to the list that bounces for >some reason is sent to loren to be approved. Assuming the message >should go to the list, as loren I pipe the message to approve. >Current behavior seems to be thus: the message goes to the direct >version of the mailing list with the original, correct From line. So >far so good. But the mailing list also has a digested version, and >when the file gets written into the Digests/listname-digest directory >the original From line is prepended with a ">" character and another >>From line with value owner-listname is inserted above it in the >headers. When this file is processed by digest it discards the >original From line and keeps the new, wrong one, thereby losing the >original sender information in the digest version of the mailing >list. Sounds like digest needs to be hacked to delete any "From " line in the headers. Majordomo-workers people, does this sound right? -- John John Rouillard Senior Systems Administrator IDD Information Services rouilj@dstar.iddis.com Waltham, MA (617) 890-7227 x337 (617) 487-3937 (Direct) Senior Systems Consultant (SERL Project) University of Massachusetts at Boston rouilj@cs.umb.edu (preferred) Boston, MA, (617) 287-6480 =============================================================================== My employers don't acknowledge my existence much less my opinions. From majordomo-workers-owner Fri Apr 14 16:27:18 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id QAA28943 for majordomo-workers-outgoing; Fri, 14 Apr 1995 16:18:22 -0700 Received: from vhipub.vhi.com (VHIPUB.VHI.COM [167.18.73.5]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id LAA03467 for ; Thu, 13 Apr 1995 11:39:08 -0700 Received: from [167.18.110.3] by vhipub.vhi.com with SMTP (5.65/1.2-eef) id AA15003; Thu, 13 Apr 95 14:38:45 -0400 Received: from paul.mis.vrx.vhi.com by av2.vrx.vhi.com (5.4R2.10/1.3) id AA08906; Thu, 13 Apr 1995 11:39:16 -0700 X-Organization: RxNet, Inc. Fresno, CA 800/447-9638 To: majordomo-workers@greatcircle.com From: Paul-Joseph de Werk Subject: unsubscribe * X-Originating-Host: paul.mis.vrx.vhi.com In-Reply-To: <9504131817.AA08833@av2.vrx.vhi.com> Message-Id: <1995Apr13.113920-0700@paul.mis.vrx.vhi.com> Date: 13 Apr 1995 11:39:08 -0700 Mime-Version: 1.0 X-Mailer: BWMail for Windows Version 3.2 Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk I've added an 'unsubscribe *' to my copy of majordomo-1.93. It's not fully tested, but it seems to work. If anyone is willing to test it, the patch code is below. Please let me know if there are problems and what they are. ===== CUT HERE ===== begin: majordomo.patch ===== *** majordomo.orig Thu Apr 13 10:50:40 1995 --- majordomo Thu Apr 13 11:13:30 1995 *************** *** 249,254 **** --- 249,273 ---- } } + sub do_unsubscribe_all { + local(@parts) = @_; + + opendir(RD_DIR, $listdir) || &abort("opendir failed $!"); + @lists = readdir(RD_DIR); + closedir(RD_DIR); + + foreach (sort @lists) { + $list = $_; + $list =~ s,^.*/,,; # strip off leading path + $list =~ /[^-_0-9a-zA-Z]/ && next; # skip non-list files (*.info, etc.) + + print REPLY "Doing 'unsubscribe $list ", join(' ', @parts), "'.\n"; + unshift(@parts, $list); + &do_unsubscribe(@parts); + shift(@parts); + } + } + sub do_unsubscribe { local($match_count) = 0; # figure out what list we are trying to unsubscribe from *************** *** 256,261 **** --- 275,284 ---- local($sm) = "unsubscribe"; local($list) = shift; local($clean_list); + if ($list =~ /^\*$/) { + &do_unsubscribe_all(@_); + return 0; + } if ( ((!$list) || ! ($clean_list = &valid_list($listdir, $list))) && defined($deflist)) { unshift(@_,$list) ; # Not a list name, put it back. ===== CUT HERE ===== end : majordomo.patch ===== -Paul #include __________________________________________________________________________ [ Paul-Joseph de Werk, B.S. \ RX Net, Inc. ] [ Systems Analyst II \ MIS Dept. ] [ \ vrx: paul@av2.vrx.vhi.com ] [ \ inet: paul%av2.vrx.vhi.com@vhipub.vhi.com ] [_______________________________\__________________________________________] From majordomo-workers-owner Thu Apr 20 14:14:24 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id NAA18922 for majordomo-workers-outgoing; Thu, 20 Apr 1995 13:57:00 -0700 Received: from spsgate.sps.mot.com (spsgate.sps.mot.com [192.70.231.1]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id NAA18910; Thu, 20 Apr 1995 13:56:43 -0700 Received: from mogate (mogate.sps.mot.com) by spsgate.sps.mot.com (4.1/SMI-4.1/Email 2.1 10/25/93) id AA16667 for majordomo-workers@GreatCircle.com; Thu, 20 Apr 95 13:56:46 MST Received: from motsps by mogate (4.1/SMI-4.1/Email-2.0) id AA14723; Thu, 20 Apr 95 13:56:43 MST Received: from risc.sps.mot.com by motsps (4.1/SMI-4.1/Email-2.1) id AA05899 for majordomo-workers@GreatCircle.com; Thu, 20 Apr 95 13:56:42 MST Received: from miaow.sps.mot.com by risc.sps.mot.com (4.1/SMI-3.0DEV3) id AA19199; Thu, 20 Apr 95 15:56:40 CDT Received: by miaow.sps.mot.com (AIX 3.2/UCB 5.64/4.03) id AA13708; Thu, 20 Apr 1995 15:57:18 -0500 From: dwolfe@risc.sps.mot.com (Dave Wolfe) Message-Id: <9504202057.AA13708@miaow.sps.mot.com> Subject: Re: large volumes? To: majordomo-users@GreatCircle.COM Date: Thu, 20 Apr 1995 15:57:18 -0500 (CDT) Cc: majordomo-workers@GreatCircle.COM In-Reply-To: <199504190920.MAA14401@cc.joensuu.fi> from "Marko Toivanen" at Apr 19, 95 12:19:59 pm Reply-To: David Wolfe X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 3932 Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk [ Marko Toivanen writes: ] > > Responding to a previous article by Deborah A Hamilton: > * Also - sorting the large mailing lists by host.domain.name made > * our mailer more efficient. > > So, anybody got a sort program that would sort beginning from the end of > each line where the most significat domain lies, and would also lock the > list file to prevent majordomo using while sorting? How 'bout the following. Since there's been some discussion about unsubscribing taking too long (it has to rewrite the entire list for each unsubscribe request), I realize that this change could also be too time and memory consuming to sort the list for every subscription, so decide for yourself. It works for me but hasn't had a lot of testing time. Diff is against 1.93. Note that it also includes a fix of mine for mj's annoying habit of being rather arbitrary about permissions and ownership. Index: majordomo =================================================================== RCS file: /cvs/tools/PD/majordomo/majordomo,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 majordomo *** 1.1.1.1 1995/03/01 14:43:23 --- majordomo 1995/04/20 20:36:52 *************** *** 223,229 **** # already on the list, and if not, add them to the list. # Lock and open the list first, even though &is_list_member() # will reopen it read-only, to prevent a race condition ! &lopen(LIST, ">>", "$listdir/$clean_list") || &abort("Can't append to $listdir/$clean_list: $!"); if (&is_list_member($subscriber, $listdir, $clean_list)) { print REPLY "**** Address already subscribed to $clean_list\n"; --- 219,225 ---- # already on the list, and if not, add them to the list. # Lock and open the list first, even though &is_list_member() # will reopen it read-only, to prevent a race condition ! &lopen(LIST, "+>>", "$listdir/$clean_list") || &abort("Can't append to $listdir/$clean_list: $!"); if (&is_list_member($subscriber, $listdir, $clean_list)) { print REPLY "**** Address already subscribed to $clean_list\n"; *************** *** 234,239 **** --- 230,267 ---- } else { print LIST $subscriber, "\n"; } + + # sort list by domain (last field is most significant) + local($entry, $user, @nodes, %canonical, $mode, $uid, $gid); + seek(LIST, 0, 0) + || &abort("Can't rewind $listdir/$clean_list: $!"); + while () { + $entry = $_; + tr/A-Z/a-z/; + ($_) = &ParseAddrs($_); + ($user, @nodes) = split(/[.\@]/); + @nodes = $#nodes ? ((reverse @nodes), ('') x (3 - $#nodes)) + : (('') x 3, @nodes); # just host + $canonical{join("\0", @nodes, $user)} = $entry; + } + (($mode, $uid, $gid) = (stat(LIST))[2,4,5]) || + &abort("Can't stat listdir/$clean_list: $!"); + open(NEW, ">$listdir/$clean_list.new") || + &abort("Can't open $listdir/$clean_list.new: $!"); + chmod($mode, "$listdir/$clean_list.new") || + &abort("chmod($mode, \"$listdir/$clean_list.new\"): $!"); + chown($uid, $gid, "$listdir/$clean_list.new") || + &abort("chown($uid, $gid, \"$listdir/$clean_list.new\"): $!"); + for (sort keys %canonical) { + print NEW $canonical{$_}; + } + close(NEW) + || &abort("Error closing listdir/$clean_list.new: $!"); + rename("$listdir/$clean_list", "$listdir/$clean_list.old") || + &abort("rename(\"$listdir/$clean_list\", \"$listdir/$clean_list.old\"): $!"); + rename("$listdir/$clean_list.new", "$listdir/$clean_list") || + &abort("rename(\"$listdir/$clean_list.new\", \"$listdir/$clean_list\"): $!"); + unlink("$listdir/$clean_list.old"); print REPLY "Succeeded.\n"; &log("subscribe $clean_list $subscriber"); # Send the new subscriber a welcoming message, and -- Dave Wolfe *Not a spokesman for Motorola* (512) 891-3246 Motorola MMTG 6501 Wm. Cannon Dr. W. OE112 Austin TX 78735-8598 From majordomo-workers-owner Fri Apr 21 15:15:37 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id PAA29115 for majordomo-workers-outgoing; Fri, 21 Apr 1995 15:00:40 -0700 Received: from relay.hp.com (relay.hp.com [15.255.152.2]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with ESMTP id PAA29110; Fri, 21 Apr 1995 15:00:37 -0700 Received: from socks.hp.com (cranston.fc.hp.com) by relay.hp.com with ESMTP (1.37.109.15/15.5+ECS 3.3) id AA214601639; Fri, 21 Apr 1995 15:00:40 -0700 Received: from localhost by socks.hp.com with SMTP (1.37.109.16/15.5+IOS 3.20+lj+OMrelay) id AA066521638; Fri, 21 Apr 1995 15:00:39 -0700 Message-Id: <199504212200.AA066521638@socks.hp.com> To: majordomo-workers@greatcircle.com Cc: brent@greatcircle.com, LaMont Jones From: LaMont Jones Subject: majordomo 1.93 patch for hp-ux Date: Fri, 21 Apr 1995 15:00:38 -0700 Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk Here's a patch that will let wrapper run suid/sgid majordom/daemon instead of suid root on HP-UX machines. (With this change, you can use the BSD options in the makefile instead of the SYSV stuff...) The change applies at least as far back as 8.0, and probably 7.0. lamont ================================================================= *** wrapper.c.orig Sat Jan 7 10:28:00 1995 --- wrapper.c Fri Apr 21 15:50:29 1995 *************** *** 109,125 **** --- 109,135 ---- #endif + #ifdef __hpux + i=getegid(); + setresgid(i,i,i); + #else /* __hpux */ #ifdef POSIX_GID setgid(POSIX_GID); #else setgid(getegid()); #endif + #endif /* __hpux */ + #ifdef __hpux + i=geteuid(); + setresuid(i,i,i); + #else /* __hpux */ #ifdef POSIX_UID setuid(POSIX_UID); #else setuid(geteuid()); #endif + #endif /* __hpux */ if ((getuid() != geteuid()) || (getgid() != getegid())) { fprintf(stderr, "%s: error: recompile with POSIX flags.\n", argv[0]); From majordomo-workers-owner Fri Apr 21 15:19:48 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id OAA28203 for majordomo-workers-outgoing; Fri, 21 Apr 1995 14:44:59 -0700 Received: from spsgate.sps.mot.com (spsgate.sps.mot.com [192.70.231.1]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id OAA28177; Fri, 21 Apr 1995 14:44:34 -0700 Received: from mogate (mogate.sps.mot.com) by spsgate.sps.mot.com (4.1/SMI-4.1/Email 2.1 10/25/93) id AA26071 for majordomo-workers@greatcircle.com; Fri, 21 Apr 95 14:44:34 MST Received: from motsps by mogate (4.1/SMI-4.1/Email-2.0) id AA03139; Fri, 21 Apr 95 14:44:32 MST Received: from risc.sps.mot.com by motsps (4.1/SMI-4.1/Email-2.1) id AA24904 for majordomo-workers@greatcircle.com; Fri, 21 Apr 95 14:44:30 MST Received: from miaow.sps.mot.com by risc.sps.mot.com (4.1/SMI-3.0DEV3) id AA26140; Fri, 21 Apr 95 16:44:27 CDT Received: by miaow.sps.mot.com (AIX 3.2/UCB 5.64/4.03) id AA14262; Fri, 21 Apr 1995 16:45:06 -0500 From: dwolfe@risc.sps.mot.com (Dave Wolfe) Message-Id: <9504212145.AA14262@miaow.sps.mot.com> Subject: Re: large volumes? To: majordomo-users@greatcircle.com (Majordomo user's mailing list) Date: Fri, 21 Apr 1995 16:45:06 -0500 (CDT) Cc: majordomo-workers@greatcircle.com (Majordomo developer's mailing list) Reply-To: David Wolfe X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 8171 Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk [ I previously wrote: ] > [ Marko Toivanen writes: ] > > > > Responding to a previous article by Deborah A Hamilton: > > * Also - sorting the large mailing lists by host.domain.name made > > * our mailer more efficient. > > > > So, anybody got a sort program that would sort beginning from the end of > > each line where the most significat domain lies, and would also lock the > > list file to prevent majordomo using while sorting? > > [ re change to majordomo to sort list every subscription ] Since > there's been some discussion about unsubscribing taking too long > (it has to rewrite the entire list for each unsubscribe request), I > realize that this change could also be too time and memory consuming > to sort the list for every subscription, so decide for yourself. Here's a stand-alone utility to lock and sort mailing lists. Obviously not a lot of field time on this one either, so caveat user. Let me know if you find any problems or have any suggestions. You can run this daily from cron, for example. I recommend running it under wrapper so it plays nicely with others, e.g.: 33 3 * * * /usr/local/majordomo/wrapper sortlist lista listb listc ---- Cut Here and feed the following to sh ---- #!/bin/sh # This is a shell archive (produced by shar 3.49) # To extract the files from this archive, save it to a file, remove # everything above the "!/bin/sh" line above, and type "sh file_name". # # made 04/21/1995 21:18 UTC by dwolfe@miaow # Source directory /tmp_mnt/home/dwolfe/local/src # # existing files will NOT be overwritten unless -c is specified # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 5303 -rwxr-xr-x majordomo/contrib/sortlist # # ============= majordomo/contrib/sortlist ============== if test ! -d 'majordomo'; then echo 'x - creating directory majordomo' mkdir 'majordomo' fi if test ! -d 'majordomo/contrib'; then echo 'x - creating directory majordomo/contrib' mkdir 'majordomo/contrib' fi if test -f 'majordomo/contrib/sortlist' -a X"$1" != X"-c"; then echo 'x - skipping majordomo/contrib/sortlist (File already exists)' else echo 'x - extracting majordomo/contrib/sortlist (Text)' sed 's/^X//' << 'SHAR_EOF' > 'majordomo/contrib/sortlist' && X#!/usr/local/bin/perl X X# Copyright 1995, David A. Wolfe, Sr. See the Majordomo license agreement X# for usage rights. X# X# Sort changed mailing lists by domain. This utility is best run by the X# wrapper so that environment, ownership, and permissions are consistent X# with majordomo. X X# Isolate our name X$0 =~ s|.*/(.*)|$1|; X X# Read and execute the .cf file X$cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf"; Xif ($ARGV[0] eq "-C") { X shift(@ARGV); X $cf = shift(@ARGV); X} Xif (! -r $cf) { X die("$0: $cf not readable\n"); X} Xeval(`cat $cf`) || die "$0: eval of $cf failed\n"; X Xchdir($homedir) || die("$0: can't chdir($homedir): $!\n"); Xunshift(@INC, $homedir); Xrequire "getopts.pl"; Xrequire "timelocal.pl"; Xrequire "ctime.pl"; Xrequire "shlock.pl"; Xrequire "majordomo.pl"; X X&Getopts("f") || die("$0: Getopts() failed: $!\n"); X Xdie <) X { X ($mname, $mday, $hms, $cmd, $list) = (split)[0, 1, 2, 6, 7]; X next unless ($cmd eq 'subscribe' || $cmd eq 'sort') && X grep($_ eq $list, @lists); X X ($hour, $min, $sec) = split(/:/, $hms); X $timestamp = &timelocal($sec, $min, $hour, $mday, $mnum{$mname}, X $this_year); X $timestamp = &timelocal($sec, $min, $hour, $mday, $mnum{$mname}, X $this_year - 1) if $timestamp > $^T; # Adjust for last year X X $subscribed{$list} = $timestamp X if $cmd eq 'subscribe' && $subscribed{$list} < $timestamp; X $sorted{$list} = $timestamp X if $cmd eq 'sort' && $sorted{$list} < $timestamp; X } X &lclose(LOG); X X # Has anything changed in the specified lists X @ARGV = @lists; X @lists = (); X foreach $list (@ARGV) X { X if ($sorted{$list} > $subscribed{$list}) X { X warn "$0: no new subscriptions in $list since last sort\n"; X warn "\t(use -f to force resort)\n"; X next; X } X if ($subscribed{$list} == (stat("$listdir/$list"))[9]) X { X warn "$0: $list hasn't changed since last subscription\n"; X warn "\t(use -f to force resort)\n"; X next; X } X push(@lists, $list); X } X exit 1 unless @lists; X} X X# Sort the remaining lists XLIST_SORT:foreach $list (@lists) X{ X &lopen(LIST, "", "$listdir/$list") || X &abort_sort("can't open $listdir/$list"); X $state = 1; X X # Read and canonicalize the list for sorting. Each entry is stripped X # to the bare address (user@host[[[.net3].net2].net1]), which X # is standarized to net1\0net2\0net3\0host\0user for sorting. X # Missing nodes in the address are set to null to keep all levels X # consistent. X X while () X { X $entry = $_; X tr/A-Z/a-z/; X ($_) = &ParseAddrs($_); X ($user, @nodes) = split(/[.\@]/); X @nodes = $#nodes ? ((reverse @nodes), ('') x (3 - $#nodes)) X : (('') x 3, @nodes); # just host X $canonical{join("\0", @nodes, $user)} = $entry; X } X X # Create the sorted list, keeping the file mode and group of the X # original X (($mode, $uid, $gid) = (stat(LIST))[2,4,5]) || X &abort_sort("can't stat listdir/$list"); X open(NEW, ">$listdir/$list.new") || X &abort_sort("can't open $listdir/$list.new"); X $state = 2; X chmod($mode, "$listdir/$list.new") || X &abort_sort("chmod($mode, $listdir/$list.new) failed"); X chown($uid, $gid, "$listdir/$list.new") || X &abort_sort("chown($uid, $gid, $listdir/$list.new) failed"); X for (sort keys %canonical) { X print NEW $canonical{$_}; X } X close(NEW) || &abort_sort("error closing listdir/$list.new"); X $state = 3; X X # Swap the sorted file for the original and remove the original X rename("$listdir/$list", "$listdir/$list.old") || X &abort_sort("rename($listdir/$list, $listdir/$list.old)"); X $state = 4; X rename("$listdir/$list.new", "$listdir/$list") || X &abort_sort("rename($listdir/$list.new, $listdir/$list)"); X unlink("$listdir/$list.old"); X X # Release the lock and log the sort X &lclose(LIST); X $state = 0; X &log("sort $list"); X} Xexit 0; X Xsub abort_sort X{ X warn "$0: ", @_, ": $!\n"; X (rename("$listdir/$list.old", "$listdir/$list") || X warn "$0: rename($listdir/$list.old, $listdir/$list) failed: $!\n") X if $state > 3; X unlink("$listdir/$list.new") if $state >= 2; X close(NEW) if $state > 1; X &lclose(LIST) if $state > 0; X $state = 0; X next LIST_SORT; X} SHAR_EOF chmod 0755 majordomo/contrib/sortlist || echo 'restore of majordomo/contrib/sortlist failed' Wc_c="`wc -c < 'majordomo/contrib/sortlist'`" test 5303 -eq "$Wc_c" || echo 'majordomo/contrib/sortlist: original size 5303, current size' "$Wc_c" fi exit 0 -- Dave Wolfe *Not a spokesman for Motorola* (512) 891-3246 Motorola MMTG 6501 Wm. Cannon Dr. W. OE112 Austin TX 78735-8598 From majordomo-workers-owner Fri Apr 21 17:16:22 1995 Received: (daemon@localhost) by miles.greatcircle.com (8.6.9/Miles-941015-1) id QAA03746 for majordomo-workers-outgoing; Fri, 21 Apr 1995 16:55:57 -0700 Received: from spsgate.sps.mot.com (spsgate.sps.mot.com [192.70.231.1]) by miles.greatcircle.com (8.6.9/Miles-941015-1) with SMTP id QAA03705; Fri, 21 Apr 1995 16:55:28 -0700 Received: from mogate (mogate.sps.mot.com) by spsgate.sps.mot.com (4.1/SMI-4.1/Email 2.1 10/25/93) id AA18581 for majordomo-workers@greatcircle.com; Fri, 21 Apr 95 16:55:29 MST Received: from motsps by mogate (4.1/SMI-4.1/Email-2.0) id AA04614; Fri, 21 Apr 95 16:55:28 MST Received: from risc.sps.mot.com by motsps (4.1/SMI-4.1/Email-2.1) id AA02883 for majordomo-workers@greatcircle.com; Fri, 21 Apr 95 16:55:26 MST Received: from miaow.sps.mot.com by risc.sps.mot.com (4.1/SMI-3.0DEV3) id AA26861; Fri, 21 Apr 95 18:55:23 CDT Received: by miaow.sps.mot.com (AIX 3.2/UCB 5.64/4.03) id AA15643; Fri, 21 Apr 1995 18:56:02 -0500 From: dwolfe@risc.sps.mot.com (Dave Wolfe) Message-Id: <9504212356.AA15643@miaow.sps.mot.com> Subject: Re: large volumes? (again) To: majordomo-users@greatcircle.com (Majordomo user's mailing list) Date: Fri, 21 Apr 1995 18:56:02 -0500 (CDT) Cc: majordomo-workers@greatcircle.com (Majordomo developer's mailing list) Reply-To: David Wolfe X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 738 Sender: majordomo-workers-owner@GreatCircle.COM Precedence: bulk Sorry for the double post, but the first one appeared to have bounced. [ I previously wrote: ] > Here's a stand-alone utility to lock and sort mailing lists. Obviously > not a lot of field time on this one either, so caveat user. I thought of a problem while I was driving home: sortlist works fine if you specify just one list, but I suspect it will merge each subsequent list. Add the following line after line 141 (just before the 'while ()') to reinitialize the hash for each list: %canonical = (); Sorry for any trouble this may have caused anyone, but I warned you it was new code. -- Dave Wolfe *Not a spokesman for Motorola* (512) 891-3246 Motorola MMTG 6501 Wm. Cannon Dr. W. OE112 Austin TX 78735-8598