procmail
[Top] [All Lists]

Re: Sendmail and Formail problem

2000-12-16 12:46:59
Steve Magee <smagee(_at_)arb(_dot_)ca(_dot_)gov> writes:
...
When archiving the postings, we used formail to retain only the From:,
Subject:
and Date: from the e-mail and then archived the note.  This works in
/etc/aliases

mail-list-archive: "|/usr/bin/formail -k -X From: -X Subject: -X Date:
|/home/majordomo/majordomo-1.94.4/wrapper archive2.pl -f
/home/majordomo/majordomo-1.94.4/lists/mail-list.archive/mail-list -Y -a"

Now, I'm upgrading to..
...
The above entry in /etc/aliases file no longer works.  I get...

sh: cannot use | in command
554 "mail-list-archive: "entry above inserted here"
... Service unavailable

This is because of smrsh, the sendmail restricted shell.  You cannot
put multi-command pipelines in the alias file for .forward file when
using smrsh.  The solution in this case is to move the formail action
into the majordomo script, either by hunting up a majordomo option that
already does this (there program is one) or by having majordomo reopen
its input through formail.  Hmm, the following *UNTESTED* perl lines
_might_ work:

        $ENV{PATH} .= "/usr/bin:";      # Make sure /usr/bin is in the PATH
        open(STDIN, "formail -k -XFrom: -XSubject: -XDate: |")
                || die "$0: Unable to reopen stdin through formail: $!";

They might also throw away all your email and you have to place them at
the correct place in the majordomo archive2.pl script.

Isn't there a majordomo option specifying a regexp of header fields to
save?


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>