procmail
[Top] [All Lists]

Re: Sendmail and Formail problem

2000-12-20 14:59:20
After working and trying to get the method of linking
/etc/smrsh/formail to /usr/bin/formail.  I gave up.  I was able
to alter the sendmail.cf file to looking in /bin/bash instead of
/usr/sbin/smrsh.
This method (from what I understand) would stirp my security.  So, I tried
you method and was very successful (don't know perl).  I reinstated the
/usr/sbin/smrsh in the sendmail (for security) and all works great now.

Thanks for your reply to my problem.
Steve Magee

Philip Guenther wrote:

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>