procmail
[Top] [All Lists]

Re: several quick questions

2000-01-31 19:46:58
"Jonathan Barlow" <jon(_at_)barlownet(_dot_)com> writes:
I would really very much appreciate any help on the below:

I have procmail running and am trying to use majordomo to handle
a mailing list.  The mailing list has quite a few members.
...
So, as you can see, mail sent to the list (crtl(_at_)reformed(_dot_)org)
goes to the majordomo wrapper where the subject line is added
or it is parsed for commands.  Then, the mail is resent to 
crtl-list(_at_)reformed(_dot_)org which procmail then cats to two different
files containing addresses of the list members.

The reason there are two files is because procmail apparently
has some limit on the size list it will handle at one time, 
so we split it up.  

1. Is it possible to cat a longer file so that I don't have
      to split it up?  Splitting the files up creates all
      kinds of problems because people try to subcribe to
      crtl, it gets filled up and then I have to add the
      addresses at the end of the list to crtl2.  Then when
      they want to unsubscribe, they don't know about crtl2
      and moan about not being able to get off the list.

2. Is there some workaround here?

The limit on line lengths in procmail is set by the LINEBUF variable.
HOWEVER, before you go setting it to some huge value, consider that the
kernel itself imposes a limit on the total space taken by command line
arguments.  This limit is 1MB under most OSes I've checked recently.
A better way to tackle the problem would be to use a program designed
for it.  I remember one called bulk_mailer (written by Keith Moore, an
IESG area director), while SmartList comes with one called 'choplist'
(part of the multigram program).  If nothing else, you can do it via
a shell script and xargs.  Put the following in a shell script:

        #!/bin/sh
        exec sendmail -f crtl-list-request(_at_)$DOMAIN -- "$@" < $FILENAME


The address passed via the -f flag should be the address to whiches
bounces go.  I'm not sure what that is in majordomo.  The '--' prevents
problems from addresses that look like flags because they start with a
'-'.

Then use the following recipe:

:0
* $ RECIP ?? ^^crtl-list(_at_)$DOMAIN
{
        FILENAME = /not/slash/tmp/crtl.message
        :0 w: $FILENAME.lock
        | cat >$FILENAME && \
          xargs </usr/local/majordomo/lists/crtl /path/to/above/shell/script
}


While this all should work (it's completely untested!), it has all
sorts of inefficiencies and general problems that a dedicated program
would solve.  For example, the above doesn't sort messages by domain, a
cheap way to save SMTP connections with most MTAs.  Also, xargs doesn't
pass back error return codes from sendmail in any useful way, so you
can only tell whether or not any failed, not how nor which.  I would
consider that a show-stopper on any system I ran, but your situation
may require a looser standard...


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>
  • Re: several quick questions, Philip Guenther <=