Great Circle Associates Majordomo-Users
(September 2001)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Archive/Digest HOW-TO, (was: Digest send problems)
From: Daniel Liston <dliston @ netscape . com>
Organization: iPlanet eCommerce Solutions, A Sun|Netscape Alliance
Date: Wed, 26 Sep 2001 23:56:20 -0500
To: 2n3ak3r <jruiz @ pandasoftware . es>
Cc: majordomo-users @ GreatCircle . Com, majordomo-docs @ GreatCircle . Com
References: <3BB1B813.6080202@pandasoftware.es>


Majordomo list owners often have trouble setting up a digest version of their list.  I am writing this in 
hopes of clearing up some of this confusion.

Assumptions:
Majordomo version 1.94.5
Sendmail version 8.8 (or higher)
You have root permission to create users, modify the aliases file, and rebuild the aliases database.
You have created a majordomo user and majordomo group.
The majordomo $HOME directory is /usr/local/majordomo and is owned by user majordomo and group majordomo.
The smrsh directory (if used) is /etc/smrsh and holds a link owned by root to /usr/local/majordomo/wrapper.
There are no group or world "writable" directories in the path to /usr/local/majordomo, including / (root).
Sendmail "trusts" majordomo. (you have a Tmajordomo line in sendmail.cf).
Sendmail only recognizes one "/etc/aliases" file.
Sendmail uses the "always_add_domain" feature.
The majordomo config file is /etc/majordomo.cf
The majordomo.cf variables are defined staticly. (no `/bin/dnsdomainname` in $whereami variable).
You already have a working list that utilizes resend. (wrapper resend -l <listname> <listname>-outgoing).

Preface:
The directories above may be different, but in that case, you will modify anything stated further to 
match your installation.  To set up a digest, you must also have a handle on archiving.  Digest has 
some dependencies, or I should say makes some assumptions.  One is that you have an archive directory 
configured to hold the digestified message before delivery, and another is that you will call your 
delivery address <list>-digest-outgoing.

Your digest and archive directories are defined in the majordomo.cf file as $digest_work_dir and $filedir.
$filedir_suffix is also (or can be) used for defining the location of your archives.  For the purpose of 
this recipe, I will keep these in the same directory tree as my other majordomo data files and directories.  
The sample.cf or default majordomo.cf gives an example of /usr/local/mail/digest when lists are in 
/usr/local/lists and archive files are in /usr/local/mail/files.  
Here are my suggested settings based on the assumptions above;

$homedir = "/usr/local/majordomo";
$digest_work_dir = "$homedir/digests";
$listdir = "$homedir/lists";
$filedir = "$homedir/archives";
$filedir_suffix = "";

What is not explained very well, is that you will need to create these directories (if you haven't 
already) as the majordomo user, or change ownership to the majordomo user if you created them as root.
Make sure these directories are not group or world writable, to prevent sendmail from complaining.
You will also have to reference these directories in your /etc/aliases so mail is passed to these
scripts that will be doing the actual work.  In some (maybe all) cases, there will also be
subdirectories involved that will need the same ownerhips and permissions as their parents.

A "test" mailing list that does archives AND digests will have aliases that look like this;

owner-test: test-owner,
test: "/usr/local/majordomo/wrapper resend -l test test-outgoing,nobody"
test-owner: someone@your.domain
test-request: "/usr/local/majordomo/wrapper majordomo -l test"
test-approval: moderator@your.domain #could also be pointed to test-owner
test-outgoing: :include:/usr/local/majordomo/test,test-archiver,test-digestify
test-archiver: "/usr/local/majordomo/wrapper archive2.pl -f /usr/local/majordomo/archives/test/test -a -M"
test-digestify: "/usr/local/majordomo/wrapper digest -r -C -l test-digest test-digest-outgoing"
owner-test-digest: owner-test
test-digest:	test,
test-digest-owner: test-owner,
test-digest-request: "|/usr/local/majordomo/wrapper majordomo -l test-digest"
test-digest-approval: test-approval,
test-digest-outgoing: :include:/usr/local/lists/test-digest,nobody"

The -approval addresses are not required, and will default to owner-<listname>(-digest), and
the -request addresses could just be pointed to the owner/moderator alias depending on your
specific needs or requirements.  Some of the "owner" aliases are redundant, but safe.

Let me also explain that you do not need to enable archiving to use a digest version of
your list, but you WILL need the majordomo.cf and archives directory properly configured
for digestification to happen.  The digest script also "assumes" your outgoing address
for the digest is called <listname>-digest-outgoing.  In the case above, test-digest-outgoing.

To continue with our example, we now have a dependency on subdirectories for archiver and
the digestify.  We need to create these before we run "newaliases" or "sendmail -bi".

mkdir /usr/local/majordomo/archives/test-digest /usr/local/majordomo/digests/test-digest
mkdir /usr/local/majordomo/archives/test 

The above need to be owner:group majordomo:majordomo and chmod 755. Loose security could
be tightened up, but that is a different HOW-TO. :)

NOTE:  To do digesting without the standard archive, there are two changes to the aliases.
test-outgoing: :include:/usr/local/majordomo/test,test-digestify
and you do not "need" the test-archiver: alias.  If this is the case, you also do not need
to create the /usr/local/majordomo/archives/test directory.  Leaving them in, even though
they are never used does not really hurt either.  It is all a matter of calling or not
calling the test-archiver: alias via the test-outgoing: alias.

The final steps in making your digest happen daily/nightly, is to set your test-digest.config
file variables high enough that digestification does not try to happen automatically, and to
create a crontab entry that will make majordomo execute the digest script.

In your test-digest.config file, depending on how busy you expect your list to be, adjust
these variables appropriately high.  I have not tried it, but maybe they can all be left blank.

digest_maxdays      =
digest_maxlines     =
maxlength           =

The maxlength is in bytes, not Kbytes.  The other two are self explanatory.  You only have
to set one value, but you will have to experiment to get it right.  A good starting point,
might be to set digest_maxdays to 7, and leave the other two blank.  Otherwise, you will 
probably have to tinker with the maxlength in hundreds of thousands or millions of bytes.

If your security uses cron.allow or cron.deny, install the appropriate setting for <user>.
Your crontab entry should not be owned by root or majordomo to avoid "Majordomo ABORT"
messages.  I typically fill in <user> with the uid of the list-owner.
Now to access the crontab...

crontab -u <user> -e

SHELL=/bin/sh
MAILTO=""
30  4  *  *  5  echo mkdigest test-digest <passwd> | mail majordomo
#|  |  |  |  | ^here to % or EOL is field 6 for commands
#|  |  |  |  +-- 3 letter day of week or 0-7 0=Sun
#|  |  |  +-- 3 letter month or 1-12
#|  |  +-- day 1-31
#|  +-- hours 0-23
#+-- minutes 0-59

The 5th line above sends majordomo an email forcing it to make a digest and send it to
the default test-digest-outgoing alias every Friday at 4:30AM.  If your delivery address
is not test-digest-outgoing, that line can be changed to something like

30  4  *  *  5  echo mkdigest test-digest test-digest-whatever <passwd> | mail majordomo

If you want the list to go out daily, change the "5" above, to a "*".

Having a password stored in the crontab is probably not a good idea either, but it does
get the job done.

Dan Liston

PS.  Please feel free to add comments/criticisms about this document.  It is after all
my first attempt at explaining this steps necessary to archive/digest a mailing list.



References:
Indexed By Date Previous: Receive but no Post Lists
From: "Richard Albrecht" <ralbrech@earthlink.com>
Next: Re: HTML Emails - Am Willing To Pay For An Answer
From: James <oneiros@darkspire.net>
Indexed By Thread Previous: Digest send problems
From: 2n3ak3r <jruiz@pandasoftware.es>
Next: HTML Emails - Am Willing To Pay For An Answer
From: "Adam Brooks" <Adam@ATonline.com>

Google
 
Search Internet Search www.greatcircle.com